Re-commit r67334 and r67349 with fix.
authorEvan Cheng <evan.cheng@apple.com>
Sat, 21 Mar 2009 18:12:24 +0000 (18:12 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sat, 21 Mar 2009 18:12:24 +0000 (18:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67451 91177308-0d34-0410-b5e6-96231b3b80d8

test/BugPoint/misopt-basictest.ll
test/BugPoint/remove_arguments_test.ll
test/Makefile
test/lib/llvm.exp

index e59b4ed7d90807d8561fa5d9a6e6e6d04b19e018..11cc2ae7995ed45da447db245e3cdd9c30302dce 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: bugpoint %s -dce -bugpoint-deletecalls -simplifycfg -silence-passes
+; RUN: bugpoint %s -dce -bugpoint-deletecalls -simplifycfg -silence-passes %bugpoint_topts
 
 @.LC0 = internal global [13 x i8] c"Hello World\0A\00"          ; <[13 x i8]*> [#uses=1]
 
index 72bd8f882a0bfbe2e6cb0a9bc5f68e88e5c99fa8..e5655974f7e5c312595a1e3d27139240749fb1e7 100644 (file)
@@ -1,4 +1,4 @@
-; RUN: bugpoint %s  -bugpoint-crashcalls -silence-passes
+; RUN: bugpoint %s -bugpoint-crashcalls -silence-passes
 
 ; Test to make sure that arguments are removed from the function if they are 
 ; unnecessary.
index 8825c53d5b19b1f6a866d0d98985ff13b850f02a..8ba4f33541174a142ba6a1d0848f20ad2745c175 100644 (file)
@@ -87,6 +87,11 @@ DSYMUTIL=dsymutil
 else
 DSYMUTIL=true
 endif
+ifdef TargetCommonOpts
+BUGPOINT_TOPTS="-gcc-tool-args $(TargetCommonOpts)"
+else
+BUGPOINT_TOPTS=""
+endif
 
 FORCE:
 
@@ -108,12 +113,13 @@ site.exp: FORCE
        @echo 'set objdir "$(LLVM_OBJ_ROOT)/test"' >>site.tmp
        @echo 'set gccpath "$(CC)"' >>site.tmp
        @echo 'set gxxpath "$(CXX)"' >>site.tmp
-       @echo 'set compile_c "' $(CC) $(CPP.Flags) $(CompileCommonOpts) -c '"' >>site.tmp
-       @echo 'set compile_cxx "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) -c '"' >> site.tmp
-       @echo 'set link "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts) $(LD.Flags) '"' >>site.tmp
-       @echo 'set llvmgcc "$(LLVMGCC) $(EXTRA_OPTIONS)"' >> site.tmp
-       @echo 'set llvmgxx "$(LLVMGCC) $(EXTRA_OPTIONS)"' >> site.tmp
+       @echo 'set compile_c "' $(CC) $(CPP.Flags) $(TargetCommonOpts) $(CompileCommonOpts) -c '"' >>site.tmp
+       @echo 'set compile_cxx "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) -c '"' >> site.tmp
+       @echo 'set link "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) $(LD.Flags) '"' >>site.tmp
+       @echo 'set llvmgcc "$(LLVMGCC) $(TargetCommonOpts) $(EXTRA_OPTIONS)"' >> site.tmp
+       @echo 'set llvmgxx "$(LLVMGCC) $(TargetCommonOpts) $(EXTRA_OPTIONS)"' >> site.tmp
        @echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
+       @echo 'set bugpoint_topts $(BUGPOINT_TOPTS)' >> site.tmp
        @echo 'set shlibext "$(SHLIBEXT)"' >> site.tmp
        @echo 'set ocamlc "$(OCAMLC) -cc $(CXX) -I $(LibDir)/ocaml"' >> site.tmp
        @echo 'set valgrind "$(VALGRIND)"' >> site.tmp
index 254995bc4aeb58c9ce53ead66e35f7eafc0da42c..d2ddb8f757f9b73385942c7c4211963ef1517039 100644 (file)
@@ -48,8 +48,8 @@ proc execOneLine { test PRS outcome lineno line } {
 proc substitute { line test tmpFile } {
   global srcroot objroot srcdir objdir subdir target_triplet prcontext
   global llvmgcc llvmgxx llvmgcc_version llvmgccmajvers ocamlc
-  global gccpath gxxpath compile_c compile_cxx link shlibext llvmlibsdir llvmdsymutil
-  global valgrind grep gas
+  global gccpath gxxpath compile_c compile_cxx link shlibext llvmlibsdir
+  global llvmdsymutil valgrind grep gas bugpoint_topts
   set path [file join $srcdir $subdir]
 
   # Substitute all Tcl variables.
@@ -77,6 +77,8 @@ proc substitute { line test tmpFile } {
   regsub -all {%llvmdsymutil} $new_line "$llvmdsymutil" new_line
   #replace %llvmlibsdir with configure library directory
   regsub -all {%llvmlibsdir} $new_line "$llvmlibsdir" new_line
+  #replace %bugpoint_topts with actual bugpoint target options
+  regsub -all {%bugpoint_topts} $new_line "$bugpoint_topts" new_line
   #replace %p with path to source,
   regsub -all {%p} $new_line [file join $srcdir $subdir] new_line
   #replace %s with filename