[llvm-branch-commits] [compiler-rt-branch] r183180 - Merge r182726:
Bill Wendling
isanbard at gmail.com
Mon Jun 3 21:23:20 PDT 2013
Author: void
Date: Mon Jun 3 23:23:20 2013
New Revision: 183180
URL: http://llvm.org/viewvc/llvm-project?rev=183180&view=rev
Log:
Merge r182726:
Improve support for compiler-rt tests in CMake build.
Now compiler-rt tests run correctly if compiler-rt is checked out into
arbitrary directory (not necessarily projects/compiler-rt).
Patch by Greg Fitzgerald!
Modified:
compiler-rt/branches/release_33/lib/asan/lit_tests/Unit/lit.cfg
compiler-rt/branches/release_33/lib/asan/lit_tests/Unit/lit.site.cfg.in
compiler-rt/branches/release_33/lib/asan/lit_tests/lit.cfg
compiler-rt/branches/release_33/lib/asan/lit_tests/lit.site.cfg.in
compiler-rt/branches/release_33/lib/msan/lit_tests/Unit/lit.cfg
compiler-rt/branches/release_33/lib/msan/lit_tests/Unit/lit.site.cfg.in
compiler-rt/branches/release_33/lib/msan/lit_tests/lit.cfg
compiler-rt/branches/release_33/lib/msan/lit_tests/lit.site.cfg.in
compiler-rt/branches/release_33/lib/sanitizer_common/tests/lit.cfg
compiler-rt/branches/release_33/lib/sanitizer_common/tests/lit.site.cfg.in
compiler-rt/branches/release_33/lib/tsan/lit_tests/Unit/lit.cfg
compiler-rt/branches/release_33/lib/tsan/lit_tests/Unit/lit.site.cfg.in
compiler-rt/branches/release_33/lib/tsan/lit_tests/lit.cfg
compiler-rt/branches/release_33/lib/tsan/lit_tests/lit.site.cfg.in
compiler-rt/branches/release_33/lib/ubsan/lit_tests/lit.cfg
compiler-rt/branches/release_33/lib/ubsan/lit_tests/lit.site.cfg.in
Modified: compiler-rt/branches/release_33/lib/asan/lit_tests/Unit/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/asan/lit_tests/Unit/lit.cfg?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/asan/lit_tests/Unit/lit.cfg (original)
+++ compiler-rt/branches/release_33/lib/asan/lit_tests/Unit/lit.cfg Mon Jun 3 23:23:20 2013
@@ -11,9 +11,8 @@ def get_required_attr(config, attr_name)
return attr_value
# Setup attributes common for all compiler-rt projects.
-llvm_src_root = get_required_attr(config, 'llvm_src_root')
-compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
- "compiler-rt", "lib",
+compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
+compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib",
"lit.common.unit.cfg")
lit.load_config(config, compiler_rt_lit_unit_cfg)
Modified: compiler-rt/branches/release_33/lib/asan/lit_tests/Unit/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/asan/lit_tests/Unit/lit.site.cfg.in?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/asan/lit_tests/Unit/lit.site.cfg.in (original)
+++ compiler-rt/branches/release_33/lib/asan/lit_tests/Unit/lit.site.cfg.in Mon Jun 3 23:23:20 2013
@@ -3,6 +3,7 @@
config.target_triple = "@TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.asan_binary_dir = "@ASAN_BINARY_DIR@"
Modified: compiler-rt/branches/release_33/lib/asan/lit_tests/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/asan/lit_tests/lit.cfg?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/asan/lit_tests/lit.cfg (original)
+++ compiler-rt/branches/release_33/lib/asan/lit_tests/lit.cfg Mon Jun 3 23:23:20 2013
@@ -2,6 +2,14 @@
import os
+def get_required_attr(config, attr_name):
+ attr_value = getattr(config, attr_name, None)
+ if not attr_value:
+ lit.fatal("No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
+ return attr_value
+
# Setup config name.
config.name = 'AddressSanitizer'
@@ -30,14 +38,6 @@ if llvm_src_root is None:
if not llvm_config:
DisplayNoConfigMessage()
- # Validate that llvm-config points to the same source tree.
- llvm_src_root = lit.util.capture(["llvm-config", "--src-root"]).strip()
- asan_test_src_root = os.path.join(llvm_src_root, "projects", "compiler-rt",
- "lib", "asan", "lit_tests")
- if (os.path.realpath(asan_test_src_root) !=
- os.path.realpath(config.test_source_root)):
- DisplayNoConfigMessage()
-
# Find out the presumed location of generated site config.
llvm_obj_root = lit.util.capture(["llvm-config", "--obj-root"]).strip()
asan_site_cfg = os.path.join(llvm_obj_root, "projects", "compiler-rt",
@@ -49,8 +49,9 @@ if llvm_src_root is None:
raise SystemExit
# Setup attributes common for all compiler-rt projects.
-compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
- "lib", "lit.common.cfg")
+compiler_rt_src_root = get_required_attr(config, "compiler_rt_src_root")
+compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root, "lib",
+ "lit.common.cfg")
if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)):
lit.fatal("Can't find common compiler-rt lit config at: %r"
% compiler_rt_lit_cfg)
Modified: compiler-rt/branches/release_33/lib/asan/lit_tests/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/asan/lit_tests/lit.site.cfg.in?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/asan/lit_tests/lit.site.cfg.in (original)
+++ compiler-rt/branches/release_33/lib/asan/lit_tests/lit.site.cfg.in Mon Jun 3 23:23:20 2013
@@ -5,6 +5,7 @@ config.target_triple = "@TARGET_TRIPLE@"
config.host_os = "@HOST_OS@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
Modified: compiler-rt/branches/release_33/lib/msan/lit_tests/Unit/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/msan/lit_tests/Unit/lit.cfg?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/msan/lit_tests/Unit/lit.cfg (original)
+++ compiler-rt/branches/release_33/lib/msan/lit_tests/Unit/lit.cfg Mon Jun 3 23:23:20 2013
@@ -11,9 +11,8 @@ def get_required_attr(config, attr_name)
return attr_value
# Setup attributes common for all compiler-rt projects.
-llvm_src_root = get_required_attr(config, 'llvm_src_root')
-compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
- "compiler-rt", "lib",
+compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
+compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib",
"lit.common.unit.cfg")
lit.load_config(config, compiler_rt_lit_unit_cfg)
Modified: compiler-rt/branches/release_33/lib/msan/lit_tests/Unit/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/msan/lit_tests/Unit/lit.site.cfg.in?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/msan/lit_tests/Unit/lit.site.cfg.in (original)
+++ compiler-rt/branches/release_33/lib/msan/lit_tests/Unit/lit.site.cfg.in Mon Jun 3 23:23:20 2013
@@ -3,6 +3,7 @@
config.target_triple = "@TARGET_TRIPLE@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
config.msan_binary_dir = "@MSAN_BINARY_DIR@"
Modified: compiler-rt/branches/release_33/lib/msan/lit_tests/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/msan/lit_tests/lit.cfg?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/msan/lit_tests/lit.cfg (original)
+++ compiler-rt/branches/release_33/lib/msan/lit_tests/lit.cfg Mon Jun 3 23:23:20 2013
@@ -2,6 +2,14 @@
import os
+def get_required_attr(config, attr_name):
+ attr_value = getattr(config, attr_name, None)
+ if not attr_value:
+ lit.fatal("No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
+ return attr_value
+
# Setup config name.
config.name = 'MemorySanitizer'
@@ -30,14 +38,6 @@ if llvm_src_root is None:
if not llvm_config:
DisplayNoConfigMessage()
- # Validate that llvm-config points to the same source tree.
- llvm_src_root = lit.util.capture(["llvm-config", "--src-root"]).strip()
- msan_test_src_root = os.path.join(llvm_src_root, "projects", "compiler-rt",
- "lib", "msan", "lit_tests")
- if (os.path.realpath(msan_test_src_root) !=
- os.path.realpath(config.test_source_root)):
- DisplayNoConfigMessage()
-
# Find out the presumed location of generated site config.
llvm_obj_root = lit.util.capture(["llvm-config", "--obj-root"]).strip()
msan_site_cfg = os.path.join(llvm_obj_root, "projects", "compiler-rt",
@@ -49,8 +49,9 @@ if llvm_src_root is None:
raise SystemExit
# Setup attributes common for all compiler-rt projects.
-compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
- "lib", "lit.common.cfg")
+compiler_rt_src_root = get_required_attr(config, "compiler_rt_src_root")
+compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root, "lib",
+ "lit.common.cfg")
if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)):
lit.fatal("Can't find common compiler-rt lit config at: %r"
% compiler_rt_lit_cfg)
Modified: compiler-rt/branches/release_33/lib/msan/lit_tests/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/msan/lit_tests/lit.site.cfg.in?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/msan/lit_tests/lit.site.cfg.in (original)
+++ compiler-rt/branches/release_33/lib/msan/lit_tests/lit.site.cfg.in Mon Jun 3 23:23:20 2013
@@ -1,6 +1,7 @@
config.target_triple = "@TARGET_TRIPLE@"
config.host_os = "@HOST_OS@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
Modified: compiler-rt/branches/release_33/lib/sanitizer_common/tests/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/sanitizer_common/tests/lit.cfg?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/sanitizer_common/tests/lit.cfg (original)
+++ compiler-rt/branches/release_33/lib/sanitizer_common/tests/lit.cfg Mon Jun 3 23:23:20 2013
@@ -11,9 +11,8 @@ def get_required_attr(config, attr_name)
return attr_value
# Setup attributes common for all compiler-rt projects.
-llvm_src_root = get_required_attr(config, 'llvm_src_root')
-compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
- "compiler-rt", "lib",
+compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
+compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib",
"lit.common.unit.cfg")
lit.load_config(config, compiler_rt_lit_unit_cfg)
Modified: compiler-rt/branches/release_33/lib/sanitizer_common/tests/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/sanitizer_common/tests/lit.site.cfg.in?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/sanitizer_common/tests/lit.site.cfg.in (original)
+++ compiler-rt/branches/release_33/lib/sanitizer_common/tests/lit.site.cfg.in Mon Jun 3 23:23:20 2013
@@ -3,6 +3,7 @@
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
try:
Modified: compiler-rt/branches/release_33/lib/tsan/lit_tests/Unit/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/tsan/lit_tests/Unit/lit.cfg?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/tsan/lit_tests/Unit/lit.cfg (original)
+++ compiler-rt/branches/release_33/lib/tsan/lit_tests/Unit/lit.cfg Mon Jun 3 23:23:20 2013
@@ -11,9 +11,8 @@ def get_required_attr(config, attr_name)
return attr_value
# Setup attributes common for all compiler-rt projects.
-llvm_src_root = get_required_attr(config, 'llvm_src_root')
-compiler_rt_lit_unit_cfg = os.path.join(llvm_src_root, "projects",
- "compiler-rt", "lib",
+compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
+compiler_rt_lit_unit_cfg = os.path.join(compiler_rt_src_root, "lib",
"lit.common.unit.cfg")
lit.load_config(config, compiler_rt_lit_unit_cfg)
Modified: compiler-rt/branches/release_33/lib/tsan/lit_tests/Unit/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/tsan/lit_tests/Unit/lit.site.cfg.in?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/tsan/lit_tests/Unit/lit.site.cfg.in (original)
+++ compiler-rt/branches/release_33/lib/tsan/lit_tests/Unit/lit.site.cfg.in Mon Jun 3 23:23:20 2013
@@ -3,6 +3,7 @@
config.llvm_obj_root = "@LLVM_BINARY_DIR@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.llvm_build_mode = "@LLVM_BUILD_MODE@"
Modified: compiler-rt/branches/release_33/lib/tsan/lit_tests/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/tsan/lit_tests/lit.cfg?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/tsan/lit_tests/lit.cfg (original)
+++ compiler-rt/branches/release_33/lib/tsan/lit_tests/lit.cfg Mon Jun 3 23:23:20 2013
@@ -2,6 +2,14 @@
import os
+def get_required_attr(config, attr_name):
+ attr_value = getattr(config, attr_name, None)
+ if not attr_value:
+ lit.fatal("No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
+ return attr_value
+
# Setup config name.
config.name = 'ThreadSanitizer'
@@ -30,14 +38,6 @@ if llvm_src_root is None:
if not llvm_config:
DisplayNoConfigMessage()
- # Validate that llvm-config points to the same source tree.
- llvm_src_root = lit.util.capture(["llvm-config", "--src-root"]).strip()
- tsan_test_src_root = os.path.join(llvm_src_root, "projects", "compiler-rt",
- "lib", "tsan", "lit_tests")
- if (os.path.realpath(tsan_test_src_root) !=
- os.path.realpath(config.test_source_root)):
- DisplayNoConfigMessage()
-
# Find out the presumed location of generated site config.
llvm_obj_root = lit.util.capture(["llvm-config", "--obj-root"]).strip()
tsan_site_cfg = os.path.join(llvm_obj_root, "projects", "compiler-rt",
@@ -49,8 +49,9 @@ if llvm_src_root is None:
raise SystemExit
# Setup attributes common for all compiler-rt projects.
-compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
- "lib", "lit.common.cfg")
+compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
+compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root, "lib",
+ "lit.common.cfg")
if (not compiler_rt_lit_cfg) or (not os.path.exists(compiler_rt_lit_cfg)):
lit.fatal("Can't find common compiler-rt lit config at: %r"
% compiler_rt_lit_cfg)
Modified: compiler-rt/branches/release_33/lib/tsan/lit_tests/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/tsan/lit_tests/lit.site.cfg.in?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/tsan/lit_tests/lit.site.cfg.in (original)
+++ compiler-rt/branches/release_33/lib/tsan/lit_tests/lit.site.cfg.in Mon Jun 3 23:23:20 2013
@@ -4,6 +4,7 @@
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
config.host_os = "@HOST_OS@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
Modified: compiler-rt/branches/release_33/lib/ubsan/lit_tests/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/ubsan/lit_tests/lit.cfg?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/ubsan/lit_tests/lit.cfg (original)
+++ compiler-rt/branches/release_33/lib/ubsan/lit_tests/lit.cfg Mon Jun 3 23:23:20 2013
@@ -2,6 +2,14 @@
import os
+def get_required_attr(config, attr_name):
+ attr_value = getattr(config, attr_name, None)
+ if not attr_value:
+ lit.fatal("No attribute %r in test configuration! You may need to run "
+ "tests from your build directory or add this attribute "
+ "to lit.site.cfg " % attr_name)
+ return attr_value
+
# Setup config name.
config.name = 'UndefinedBehaviorSanitizer'
@@ -30,14 +38,6 @@ if llvm_src_root is None:
if not llvm_config:
DisplayNoConfigMessage()
- # Validate that llvm-config points to the same source tree.
- llvm_src_root = lit.util.capture(["llvm-config", "--src-root"]).strip()
- ubsan_test_src_root = os.path.join(llvm_src_root, "projects", "compiler-rt",
- "lib", "ubsan", "lit_tests")
- if (os.path.realpath(ubsan_test_src_root) !=
- os.path.realpath(config.test_source_root)):
- DisplayNoConfigMessage()
-
# Find out the presumed location of generated site config.
llvm_obj_root = lit.util.capture(["llvm-config", "--obj-root"]).strip()
ubsan_site_cfg = os.path.join(llvm_obj_root, "projects", "compiler-rt",
@@ -49,8 +49,9 @@ if llvm_src_root is None:
raise SystemExit
# Setup attributes common for all compiler-rt projects.
-compiler_rt_lit_cfg = os.path.join(llvm_src_root, "projects", "compiler-rt",
- "lib", "lit.common.cfg")
+compiler_rt_src_root = get_required_attr(config, 'compiler_rt_src_root')
+compiler_rt_lit_cfg = os.path.join(compiler_rt_src_root, "lib",
+ "lit.common.cfg")
if not compiler_rt_lit_cfg or not os.path.exists(compiler_rt_lit_cfg):
lit.fatal("Can't find common compiler-rt lit config at: %r"
% compiler_rt_lit_cfg)
Modified: compiler-rt/branches/release_33/lib/ubsan/lit_tests/lit.site.cfg.in
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_33/lib/ubsan/lit_tests/lit.site.cfg.in?rev=183180&r1=183179&r2=183180&view=diff
==============================================================================
--- compiler-rt/branches/release_33/lib/ubsan/lit_tests/lit.site.cfg.in (original)
+++ compiler-rt/branches/release_33/lib/ubsan/lit_tests/lit.site.cfg.in Mon Jun 3 23:23:20 2013
@@ -4,6 +4,7 @@
config.clang = "@LLVM_BINARY_DIR@/bin/clang"
config.host_os = "@HOST_OS@"
config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.compiler_rt_src_root = "@COMPILER_RT_SOURCE_DIR@"
config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
More information about the llvm-branch-commits
mailing list