summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/CMakeLists.txt17
-rw-r--r--test/LLVMC/Alias.td2
-rw-r--r--test/LLVMC/AppendCmdHook.td2
-rw-r--r--test/LLVMC/EmptyCompilationGraph.td2
-rw-r--r--test/LLVMC/EnvParentheses.td2
-rw-r--r--test/LLVMC/ForwardAs.td2
-rw-r--r--test/LLVMC/ForwardTransformedValue.td2
-rw-r--r--test/LLVMC/ForwardValue.td2
-rw-r--r--test/LLVMC/HookWithArguments.td2
-rw-r--r--test/LLVMC/HookWithInFile.td2
-rw-r--r--test/LLVMC/Init.td2
-rw-r--r--test/LLVMC/LanguageMap.td2
-rw-r--r--test/LLVMC/MultiValuedOption.td2
-rw-r--r--test/LLVMC/MultipleCompilationGraphs.td2
-rw-r--r--test/LLVMC/NoActions.td2
-rw-r--r--test/LLVMC/NoCompilationGraph.td2
-rw-r--r--test/LLVMC/OneOrMore.td2
-rw-r--r--test/LLVMC/OptionPreprocessor.td2
-rw-r--r--test/LLVMC/OutputSuffixHook.td2
-rw-r--r--test/Makefile4
-rw-r--r--test/lit.cfg8
21 files changed, 45 insertions, 20 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 433af900dd..ad9a2432db 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -24,6 +24,23 @@ endif()
include(FindPythonInterp)
if(PYTHONINTERP_FOUND)
+ get_directory_property(DEFINITIONS COMPILE_DEFINITIONS)
+ foreach(DEF ${DEFINITIONS})
+ set(DEFS "${DEFS} -D${DEF}")
+ endforeach()
+ get_directory_property(INC_DIRS INCLUDE_DIRECTORIES)
+ foreach(INC_DIR ${INC_DIRS})
+ set(IDIRS "${IDIRS} -I${INC_DIR}")
+ endforeach()
+ string(REPLACE "<CMAKE_CXX_COMPILER>" "${CMAKE_CXX_COMPILER}" TEST_COMPILE_CXX_CMD ${CMAKE_CXX_COMPILE_OBJECT})
+ string(REPLACE "<DEFINES>" "${DEFS}" TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
+ string(REPLACE "<FLAGS>" "${CMAKE_CXX_FLAGS}" TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
+ string(REPLACE "-o" "" TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
+ string(REGEX REPLACE "<[^>]+>" "" TEST_COMPILE_CXX_CMD ${TEST_COMPILE_CXX_CMD})
+ set(TEST_COMPILE_CXX_CMD "${TEST_COMPILE_CXX_CMD} ${IDIRS}")
+ if(NOT MSVC)
+ set(TEST_COMPILE_CXX_CMD "${TEST_COMPILE_CXX_CMD} -x c++")
+ endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/site.exp.in
${CMAKE_CURRENT_BINARY_DIR}/site.exp)
diff --git a/test/LLVMC/Alias.td b/test/LLVMC/Alias.td
index 88e142dae2..5d37889304 100644
--- a/test/LLVMC/Alias.td
+++ b/test/LLVMC/Alias.td
@@ -1,7 +1,7 @@
// Test alias generation.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/AppendCmdHook.td b/test/LLVMC/AppendCmdHook.td
index 690ece779d..c85f002e6e 100644
--- a/test/LLVMC/AppendCmdHook.td
+++ b/test/LLVMC/AppendCmdHook.td
@@ -1,7 +1,7 @@
// Check that hooks can be invoked from 'append_cmd'.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/EmptyCompilationGraph.td b/test/LLVMC/EmptyCompilationGraph.td
index 3d2210a0ff..a52b8a8c19 100644
--- a/test/LLVMC/EmptyCompilationGraph.td
+++ b/test/LLVMC/EmptyCompilationGraph.td
@@ -1,6 +1,6 @@
// Check that the compilation graph can be empty.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/EnvParentheses.td b/test/LLVMC/EnvParentheses.td
index 403beb9521..ce0cb82460 100644
--- a/test/LLVMC/EnvParentheses.td
+++ b/test/LLVMC/EnvParentheses.td
@@ -2,7 +2,7 @@
// http://llvm.org/bugs/show_bug.cgi?id=4157
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: not grep {FOO")));} %t
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/ForwardAs.td b/test/LLVMC/ForwardAs.td
index 326e94b0e8..99b240e30f 100644
--- a/test/LLVMC/ForwardAs.td
+++ b/test/LLVMC/ForwardAs.td
@@ -2,7 +2,7 @@
// http://llvm.org/bugs/show_bug.cgi?id=4159
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/ForwardTransformedValue.td b/test/LLVMC/ForwardTransformedValue.td
index 10038f68d3..9184ede361 100644
--- a/test/LLVMC/ForwardTransformedValue.td
+++ b/test/LLVMC/ForwardTransformedValue.td
@@ -2,7 +2,7 @@
// The dummy tool and graph are required to silence warnings.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/ForwardValue.td b/test/LLVMC/ForwardValue.td
index 402fa50f7a..a42a3f06ec 100644
--- a/test/LLVMC/ForwardValue.td
+++ b/test/LLVMC/ForwardValue.td
@@ -2,7 +2,7 @@
// The dummy tool and graph are required to silence warnings.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/HookWithArguments.td b/test/LLVMC/HookWithArguments.td
index b3260a973b..bbba2e9845 100644
--- a/test/LLVMC/HookWithArguments.td
+++ b/test/LLVMC/HookWithArguments.td
@@ -1,7 +1,7 @@
// Check that hooks with arguments work.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/HookWithInFile.td b/test/LLVMC/HookWithInFile.td
index cc5da43b66..ed08b5321c 100644
--- a/test/LLVMC/HookWithInFile.td
+++ b/test/LLVMC/HookWithInFile.td
@@ -1,7 +1,7 @@
// Check that a hook can be given $INFILE as an argument.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/Init.td b/test/LLVMC/Init.td
index 8ab07d880b..c384679702 100644
--- a/test/LLVMC/Init.td
+++ b/test/LLVMC/Init.td
@@ -1,7 +1,7 @@
// Check that (init true/false) and (init "str") work.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/LanguageMap.td b/test/LLVMC/LanguageMap.td
index aa1149ca7f..a0502142e6 100644
--- a/test/LLVMC/LanguageMap.td
+++ b/test/LLVMC/LanguageMap.td
@@ -1,7 +1,7 @@
// Check that LanguageMap is processed properly.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/MultiValuedOption.td b/test/LLVMC/MultiValuedOption.td
index b6da6ce4c1..08c753380d 100644
--- a/test/LLVMC/MultiValuedOption.td
+++ b/test/LLVMC/MultiValuedOption.td
@@ -2,7 +2,7 @@
// The dummy tool and graph are required to silence warnings.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/MultipleCompilationGraphs.td b/test/LLVMC/MultipleCompilationGraphs.td
index 0eaad872a7..b3746c03b6 100644
--- a/test/LLVMC/MultipleCompilationGraphs.td
+++ b/test/LLVMC/MultipleCompilationGraphs.td
@@ -1,6 +1,6 @@
// Check that multiple compilation graphs are allowed.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/NoActions.td b/test/LLVMC/NoActions.td
index 2573fbe2f2..34b4440663 100644
--- a/test/LLVMC/NoActions.td
+++ b/test/LLVMC/NoActions.td
@@ -1,7 +1,7 @@
// Check that tools without associated actions are accepted.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/NoCompilationGraph.td b/test/LLVMC/NoCompilationGraph.td
index 1208f2c5f0..4182882c45 100644
--- a/test/LLVMC/NoCompilationGraph.td
+++ b/test/LLVMC/NoCompilationGraph.td
@@ -1,6 +1,6 @@
// Check that the compilation graph is not required.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/OneOrMore.td b/test/LLVMC/OneOrMore.td
index bb0ad8b11b..54fa62d1ff 100644
--- a/test/LLVMC/OneOrMore.td
+++ b/test/LLVMC/OneOrMore.td
@@ -2,7 +2,7 @@
// The dummy tool and graph are required to silence warnings.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/OptionPreprocessor.td b/test/LLVMC/OptionPreprocessor.td
index 556530b8f7..8019c42634 100644
--- a/test/LLVMC/OptionPreprocessor.td
+++ b/test/LLVMC/OptionPreprocessor.td
@@ -1,7 +1,7 @@
// Test for the OptionPreprocessor and related functionality.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/LLVMC/OutputSuffixHook.td b/test/LLVMC/OutputSuffixHook.td
index 6bb2866c38..1f5ecd1237 100644
--- a/test/LLVMC/OutputSuffixHook.td
+++ b/test/LLVMC/OutputSuffixHook.td
@@ -1,7 +1,7 @@
// Check that hooks can be invoked from 'output_suffix'.
// RUN: tblgen -I %p/../../include --gen-llvmc %s -o %t
// RUN: FileCheck -input-file %t %s
-// RUN: %compile_cxx -x c++ %t
+// RUN: %compile_cxx %t
// XFAIL: vg_leak
include "llvm/CompilerDriver/Common.td"
diff --git a/test/Makefile b/test/Makefile
index 1e179da008..5bec0eb7ad 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -145,8 +145,8 @@ 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) $(TargetCommonOpts) $(CompileCommonOpts) -c '"' >>site.tmp
- @echo 'set compile_cxx "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) -c '"' >> site.tmp
+ @echo 'set compile_c "' $(CC) $(CPP.Flags) $(TargetCommonOpts) $(CompileCommonOpts) -c -x c '"' >>site.tmp
+ @echo 'set compile_cxx "' $(CXX) $(CPP.Flags) $(CXX.Flags) $(TargetCommonOpts) $(CompileCommonOpts) -c -x 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
diff --git a/test/lit.cfg b/test/lit.cfg
index 28f336ba20..f15777c999 100644
--- a/test/lit.cfg
+++ b/test/lit.cfg
@@ -49,6 +49,14 @@ if llvm_obj_root is not None:
if 'HOME' in os.environ:
config.environment['HOME'] = os.environ['HOME']
+# Propogate 'INCLUDE' through the environment.
+if 'INCLUDE' in os.environ:
+ config.environment['INCLUDE'] = os.environ['INCLUDE']
+
+# Propogate 'LIB' through the environment.
+if 'LIB' in os.environ:
+ config.environment['LIB'] = os.environ['LIB']
+
# Propogate LLVM_SRC_ROOT into the environment.
config.environment['LLVM_SRC_ROOT'] = getattr(config, 'llvm_src_root', '')