summaryrefslogtreecommitdiff
path: root/test/tsan
diff options
context:
space:
mode:
authorKuba Mracek <mracek@apple.com>2018-06-20 13:33:42 +0000
committerKuba Mracek <mracek@apple.com>2018-06-20 13:33:42 +0000
commitec24a604d8796844dac8a3817e604a7b1b039504 (patch)
tree1f9983200ffa38b78416ecc2d54e2dbc9e88c5f2 /test/tsan
parenta0ddec879cc5bf65904736b3fb88c1f2699080e4 (diff)
[sanitizer] Unify and generalize Apple platforms in CMake and lit test configs
There's more platforms than just "ios" and "iossim" that we should support, and adding more lit config variables for each platform isn't great. Let's generalize and have a single value that determines what the platform under test is. Differential Revision: https://reviews.llvm.org/D48309 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@335123 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/tsan')
-rw-r--r--test/tsan/CMakeLists.txt17
-rw-r--r--test/tsan/lit.cfg2
-rw-r--r--test/tsan/lit.site.cfg.in3
3 files changed, 7 insertions, 15 deletions
diff --git a/test/tsan/CMakeLists.txt b/test/tsan/CMakeLists.txt
index 2b1d3004b..ba0fd9f23 100644
--- a/test/tsan/CMakeLists.txt
+++ b/test/tsan/CMakeLists.txt
@@ -24,10 +24,7 @@ if(APPLE)
endif()
foreach(arch ${TSAN_TEST_ARCH})
- set(TSAN_TEST_IOS "0")
- pythonize_bool(TSAN_TEST_IOS)
- set(TSAN_TEST_IOSSIM "0")
- pythonize_bool(TSAN_TEST_IOSSIM)
+ set(TSAN_TEST_APPLE_PLATFORM "osx")
set(TSAN_TEST_TARGET_ARCH ${arch})
string(TOLOWER "-${arch}" TSAN_TEST_CONFIG_SUFFIX)
@@ -51,15 +48,12 @@ if(APPLE)
set(EXCLUDE_FROM_ALL ON)
set(TSAN_TEST_TARGET_CC ${COMPILER_RT_TEST_COMPILER})
- set(TSAN_TEST_IOS "1")
- pythonize_bool(TSAN_TEST_IOS)
+ set(TSAN_TEST_APPLE_PLATFORM "iossim")
set(arch "x86_64")
- set(TSAN_TEST_IOSSIM "1")
- pythonize_bool(TSAN_TEST_IOSSIM)
set(TSAN_TEST_TARGET_ARCH ${arch})
set(TSAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_iossim_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
- set(TSAN_TEST_CONFIG_SUFFIX "-${arch}-iossim")
+ set(TSAN_TEST_CONFIG_SUFFIX "-${arch}-${TSAN_TEST_APPLE_PLATFORM}")
string(TOUPPER ${arch} ARCH_UPPER_CASE)
set(CONFIG_NAME "IOSSim${ARCH_UPPER_CASE}Config")
configure_lit_site_cfg(
@@ -70,12 +64,11 @@ if(APPLE)
${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/
DEPENDS ${TSAN_TEST_DEPS})
+ set(TSAN_TEST_APPLE_PLATFORM "ios")
set(arch "arm64")
- set(TSAN_TEST_IOSSIM "0")
- pythonize_bool(TSAN_TEST_IOSSIM)
set(TSAN_TEST_TARGET_ARCH ${arch})
set(TSAN_TEST_TARGET_CFLAGS "-arch ${arch} -isysroot ${DARWIN_ios_SYSROOT} ${COMPILER_RT_TEST_COMPILER_CFLAGS}")
- set(TSAN_TEST_CONFIG_SUFFIX "-${arch}-ios")
+ set(TSAN_TEST_CONFIG_SUFFIX "-${arch}-${TSAN_TEST_APPLE_PLATFORM}")
string(TOUPPER ${arch} ARCH_UPPER_CASE)
set(CONFIG_NAME "IOS${ARCH_UPPER_CASE}Config")
configure_lit_site_cfg(
diff --git a/test/tsan/lit.cfg b/test/tsan/lit.cfg
index 0128d958b..233d273f3 100644
--- a/test/tsan/lit.cfg
+++ b/test/tsan/lit.cfg
@@ -88,5 +88,5 @@ if config.android:
if config.host_os == 'Darwin':
if config.target_arch in ["x86_64", "x86_64h"]:
config.parallelism_group = "darwin-64bit-sanitizer"
- elif config.ios and not config.iossim:
+ elif config.apple_platform != "osx" and not config.apple_platform.endswith("sim"):
config.parallelism_group = "darwin-ios-device-sanitizer"
diff --git a/test/tsan/lit.site.cfg.in b/test/tsan/lit.site.cfg.in
index a215e664a..6dec5f92b 100644
--- a/test/tsan/lit.site.cfg.in
+++ b/test/tsan/lit.site.cfg.in
@@ -3,8 +3,7 @@
config.name_suffix = "@TSAN_TEST_CONFIG_SUFFIX@"
config.tsan_lit_source_dir = "@TSAN_LIT_SOURCE_DIR@"
config.has_libcxx = @TSAN_HAS_LIBCXX@
-config.ios = @TSAN_TEST_IOS_PYBOOL@
-config.iossim = @TSAN_TEST_IOSSIM_PYBOOL@
+config.apple_platform = "@TSAN_TEST_APPLE_PLATFORM@"
config.target_cflags = "@TSAN_TEST_TARGET_CFLAGS@"
config.target_arch = "@TSAN_TEST_TARGET_ARCH@"