From 817046e1f1945ce2e3aaf6239e849d5ad3112d26 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 19 Mar 2009 20:27:23 +0000 Subject: More makefile changes to allow dejagnu tests to pass when system tools default to a different target from the llvm configuration (e.g. 64-bit gcc and 32-bit llvm). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67334 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/BugPoint/misopt-basictest.ll | 2 +- test/BugPoint/remove_arguments_test.ll | 2 +- test/Makefile | 14 +++++++++----- test/lib/llvm.exp | 6 ++++-- 4 files changed, 15 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/BugPoint/misopt-basictest.ll b/test/BugPoint/misopt-basictest.ll index e59b4ed7d9..c3459d5ee2 100644 --- a/test/BugPoint/misopt-basictest.ll +++ b/test/BugPoint/misopt-basictest.ll @@ -1,4 +1,4 @@ -; RUN: bugpoint %s -dce -bugpoint-deletecalls -simplifycfg -silence-passes +; RUN: bugpoint %s -dce -bugpoint-deletecalls -simplifycfg -silence-passes %bugpoint_tops @.LC0 = internal global [13 x i8] c"Hello World\0A\00" ; <[13 x i8]*> [#uses=1] diff --git a/test/BugPoint/remove_arguments_test.ll b/test/BugPoint/remove_arguments_test.ll index 72bd8f882a..e5655974f7 100644 --- a/test/BugPoint/remove_arguments_test.ll +++ b/test/BugPoint/remove_arguments_test.ll @@ -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. diff --git a/test/Makefile b/test/Makefile index 8825c53d5b..583e2757d2 100644 --- a/test/Makefile +++ b/test/Makefile @@ -87,6 +87,9 @@ DSYMUTIL=dsymutil else DSYMUTIL=true endif +ifeq ($(OS),Darwin) +BUGPOINT_TOPTS="-gcc-tool-args $(TargetCommonOpts)" +endif FORCE: @@ -108,12 +111,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 diff --git a/test/lib/llvm.exp b/test/lib/llvm.exp index 254995bc4a..2ef7e6fefb 100644 --- a/test/lib/llvm.exp +++ b/test/lib/llvm.exp @@ -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_tops with actual bugpoint target options + regsub -all {%bugpoint_tops} $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 -- cgit v1.2.3