summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-04-11 20:57:39 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-04-11 20:57:39 +0000
commit3d89bc5845cb4c2577257483684deadd88cc06f9 (patch)
treee164968818b0a127e6f0c6964cd8473beccea6ce /test
parent461637ebde28561d45ba90852108662e04d4c37c (diff)
downloadllvm-3d89bc5845cb4c2577257483684deadd88cc06f9.tar.gz
llvm-3d89bc5845cb4c2577257483684deadd88cc06f9.tar.bz2
llvm-3d89bc5845cb4c2577257483684deadd88cc06f9.tar.xz
Make new variables available: compile_c, compile_cxx, link to handle tests
that want to use LLVM's notion of compiling and linking programs. This includes all the -I -L and optimization switches that LLVM would using to compile or link any of this files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35920 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Makefile6
-rw-r--r--test/lib/llvm-dg.exp36
2 files changed, 21 insertions, 21 deletions
diff --git a/test/Makefile b/test/Makefile
index 5ecc4a227c..ff9a67f52c 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -59,10 +59,14 @@ site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config
@echo 'set objroot "$(LLVM_OBJ_ROOT)"' >>site.tmp
@echo 'set srcdir "$(LLVM_SRC_ROOT)/test"' >>site.tmp
@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) $(C.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 "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp
@echo 'set llvmgxx "PATH=\"$(LLVMToolDir):$(PATH)\" \"$(LLVMGCC)\""' >> site.tmp
@echo 'set llvmgccmajvers "$(LLVMGCC_MAJVERS)"' >> site.tmp
- @echo 'set gxxcmd "$(CXX) $(CPP.Flags) $(CXX.Flags) $(CompileCommonOpts)"' >> site.tmp
@echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
@test ! -f site.exp || \
sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
diff --git a/test/lib/llvm-dg.exp b/test/lib/llvm-dg.exp
index 593108af4a..4d04713bce 100644
--- a/test/lib/llvm-dg.exp
+++ b/test/lib/llvm-dg.exp
@@ -1,6 +1,7 @@
proc llvm-runtest { programs } {
- global objdir srcdir subdir target_triplet llvmgcc llvmgxx prcontext
- global llvmgcc_version srcroot objroot llvmlibsdir
+ global srcroot objroot srcdir objdir subdir target_triplet prcontext
+ global llvmgcc llvmgxx global llvmgcc_version llvmgccmajvers
+ global gccpath gxxpath compile_c compile_cxx link
set timeout 60
@@ -46,30 +47,25 @@ proc llvm-runtest { programs } {
set runline
set hasRunline 1
- #replace %s with filename
- regsub -all {%s} $runline $test new_runline
-
- #replace %t with temp filenames
- regsub -all {%t} $new_runline [file join Output $tmpFile] new_runline
-
+ set new_runline $runline
#replace %prcontext with prcontext.tcl (Must replace before %p)
regsub -all {%prcontext} $new_runline $prcontext new_runline
-
- #replace %p with path to source,
- regsub -all {%p} $new_runline [file join $srcdir $subdir] new_runline
-
#replace %llvmgcc with actual path to llvmgcc
regsub -all {%llvmgcc} $new_runline "$llvmgcc -emit-llvm" new_runline
-
#replace %llvmgxx with actual path to llvmg++
regsub -all {%llvmgxx} $new_runline "$llvmgxx -emit-llvm" new_runline
-
- #replace %L with path to libraries
- regsub -all {%L} $new_runline "$llvmlibsdir" new_runline
-
- #replace %I with path to includes
- regsub -all {%I} $new_runline "$srcroot/include" new_runline
-
+ #replace %compile_c with C compilation command
+ regsub -all {%compile_c} $new_runline "$compile_c" new_runline
+ #replace %compile_cxx with C++ compilation command
+ regsub -all {%compile_cxx} $new_runline "$compile_cxx" new_runline
+ #replace %link with C++ link command
+ regsub -all {%link} $new_runline "$link" new_runline
+ #replace %p with path to source,
+ regsub -all {%p} $new_runline [file join $srcdir $subdir] new_runline
+ #replace %s with filename
+ regsub -all {%s} $new_runline $test new_runline
+ #replace %t with temp filenames
+ regsub -all {%t} $new_runline [file join Output $tmpFile] new_runline
puts $scriptFileId $new_runline
} elseif {[regexp {XFAIL:[ *](.+)} $line match targets]} {
set targets