summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Kruse <llvm@meinersbur.de>2017-04-22 23:02:53 +0000
committerMichael Kruse <llvm@meinersbur.de>2017-04-22 23:02:53 +0000
commitabf05b18dbcdfa6990a480d8e351bddd2a90e069 (patch)
treea514a008ee821f5bf9a76a02f6d3956bdddcce2a
parent9c19d1f3aa0c14ae04a9e94b11e5c8519698f9c9 (diff)
downloadbcm5719-llvm-abf05b18dbcdfa6990a480d8e351bddd2a90e069.tar.gz
bcm5719-llvm-abf05b18dbcdfa6990a480d8e351bddd2a90e069.zip
[CMake] Fix polly-isl-test execution in out-of-LLVM-tree builds.
The isl unittest modified its PATH variable to point to the LLVM bin dir. When building out-of-LLVM-tree, it does not contain the polly-isl-test executable, hence the test fails. Ensure that the polly-isl-test is written to a bin directory in the build root, just like it would happen in an inside-LLVM build. Then, change PATH to include that dir such that the executable in it is prioritized before any other location. llvm-svn: 301096
-rw-r--r--polly/CMakeLists.txt3
-rw-r--r--polly/test/UnitIsl/lit.cfg13
-rw-r--r--polly/test/UnitIsl/lit.site.cfg.in1
3 files changed, 10 insertions, 7 deletions
diff --git a/polly/CMakeLists.txt b/polly/CMakeLists.txt
index e7bdda43507..a5db35895d6 100644
--- a/polly/CMakeLists.txt
+++ b/polly/CMakeLists.txt
@@ -114,6 +114,9 @@ if (NOT DEFINED LLVM_MAIN_SRC_DIR)
# Make sure the isl c files are built as fPIC
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+
+ # Set directory for polly-isl-test.
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
else ()
set(LLVM_SOURCE_ROOT "${LLVM_MAIN_SRC_DIR}")
set(POLLY_GTEST_AVAIL 1)
diff --git a/polly/test/UnitIsl/lit.cfg b/polly/test/UnitIsl/lit.cfg
index 874875a1d05..9c732a15a49 100644
--- a/polly/test/UnitIsl/lit.cfg
+++ b/polly/test/UnitIsl/lit.cfg
@@ -34,13 +34,12 @@ if polly_obj_root is not None:
config.llvm_src_root = getattr(config, 'llvm_src_root', None)
config.llvm_obj_root = getattr(config, 'llvm_obj_root', None)
-# Tweak the PATH to include the tools dir and the scripts dir.
-if polly_obj_root is not None:
- llvm_tools_dir = getattr(config, 'llvm_tools_dir', None)
- if not llvm_tools_dir:
- lit_config.fatal('No LLVM tools dir set!')
- path = os.path.pathsep.join((llvm_tools_dir, config.environment['PATH']))
- config.environment['PATH'] = path
+# Tweak the PATH to ensure that built files are the ones executed.
+bin_dir = getattr(config, 'bin_dir', None)
+if bin_dir is None:
+ lit_config.fatal('No executable dir set!')
+path = os.path.pathsep.join((bin_dir, config.environment['PATH']))
+config.environment['PATH'] = path
config.environment['srcdir'] = os.path.join(config.test_source_root,
'../../lib/External/isl')
diff --git a/polly/test/UnitIsl/lit.site.cfg.in b/polly/test/UnitIsl/lit.site.cfg.in
index b0ad505f3b2..80de8fc0b85 100644
--- a/polly/test/UnitIsl/lit.site.cfg.in
+++ b/polly/test/UnitIsl/lit.site.cfg.in
@@ -4,6 +4,7 @@ import sys
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.polly_obj_root = "@POLLY_BINARY_DIR@"
+config.bin_dir = "@CMAKE_RUNTIME_OUTPUT_DIRECTORY@"
# Let the main config do the real work.
lit_config.load_config(config, "@POLLY_SOURCE_DIR@/test/UnitIsl/lit.cfg")
OpenPOWER on IntegriCloud