aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Rytarowski <n54@gmx.com>2018-01-18 11:49:45 +0000
committerKamil Rytarowski <n54@gmx.com>2018-01-18 11:49:45 +0000
commit777298246d7218e615d17eb212ea1a435e8e8fae (patch)
tree45e0ac915e386cf0693f8c37c07a909ff7f920ac
parent5cf8b1fd2e75774b702d6b6439c663705fd64377 (diff)
Enable sanitizer_common tests on NetBSD
Summary: NetBSD can handle asan, ubsan, msan, tsan tests on 64-bit and when applicable 32-bit X86 OS. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Subscribers: srhines, llvm-commits, kubamracek, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42236 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@322842 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/sanitizer_common/CMakeLists.txt6
-rw-r--r--test/sanitizer_common/TestCases/NetBSD/lit.local.cfg9
-rw-r--r--test/sanitizer_common/lit.common.cfg2
3 files changed, 14 insertions, 3 deletions
diff --git a/test/sanitizer_common/CMakeLists.txt b/test/sanitizer_common/CMakeLists.txt
index 237f87b84..4e2c80390 100644
--- a/test/sanitizer_common/CMakeLists.txt
+++ b/test/sanitizer_common/CMakeLists.txt
@@ -7,12 +7,14 @@ set(SUPPORTED_TOOLS)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux|FreeBSD|NetBSD|SunOS")
list(APPEND SUPPORTED_TOOLS asan)
endif()
-if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID)
+if(CMAKE_SYSTEM_NAME MATCHES "NetBSD" OR (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID))
list(APPEND SUPPORTED_TOOLS tsan)
list(APPEND SUPPORTED_TOOLS msan)
- list(APPEND SUPPORTED_TOOLS lsan)
list(APPEND SUPPORTED_TOOLS ubsan)
endif()
+if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT ANDROID)
+ list(APPEND SUPPORTED_TOOLS lsan)
+endif()
# Create a separate config for each tool we support.
foreach(tool ${SUPPORTED_TOOLS})
diff --git a/test/sanitizer_common/TestCases/NetBSD/lit.local.cfg b/test/sanitizer_common/TestCases/NetBSD/lit.local.cfg
new file mode 100644
index 000000000..94023561f
--- /dev/null
+++ b/test/sanitizer_common/TestCases/NetBSD/lit.local.cfg
@@ -0,0 +1,9 @@
+def getRoot(config):
+ if not config.parent:
+ return config
+ return getRoot(config.parent)
+
+root = getRoot(config)
+
+if root.host_os not in ['NetBSD']:
+ config.unsupported = True
diff --git a/test/sanitizer_common/lit.common.cfg b/test/sanitizer_common/lit.common.cfg
index c7a1682f7..72e3e5e10 100644
--- a/test/sanitizer_common/lit.common.cfg
+++ b/test/sanitizer_common/lit.common.cfg
@@ -59,5 +59,5 @@ config.substitutions.append( ('%env_tool_opts=',
config.suffixes = ['.c', '.cc', '.cpp']
-if config.host_os not in ['Linux', 'Darwin']:
+if config.host_os not in ['Linux', 'Darwin', 'NetBSD']:
config.unsupported = True