diff options
author | Vedant Kumar <vsk@apple.com> | 2017-10-07 01:46:36 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2017-10-07 01:46:36 +0000 |
commit | 074a997b13bf42f49d239bb9fd3fe80ed08401b7 (patch) | |
tree | 7c83f7e0422a99766732fd86dcf3aa2dc5cc62a4 /compiler-rt/test/ubsan | |
parent | 358d642f65243b45eca0ae33d698a0d50b071e59 (diff) | |
download | bcm5719-llvm-074a997b13bf42f49d239bb9fd3fe80ed08401b7.tar.gz bcm5719-llvm-074a997b13bf42f49d239bb9fd3fe80ed08401b7.zip |
[ubsan] Add a static runtime on Darwin
As a follow-up to r315142, this makes it possible to use ubsan with a
static runtime on Darwin. I've also added a new StandaloneStatic testing
configuration so the new setup can be tested.
llvm-svn: 315143
Diffstat (limited to 'compiler-rt/test/ubsan')
-rw-r--r-- | compiler-rt/test/ubsan/CMakeLists.txt | 9 | ||||
-rw-r--r-- | compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cc | 1 | ||||
-rw-r--r-- | compiler-rt/test/ubsan/lit.common.cfg | 4 |
3 files changed, 14 insertions, 0 deletions
diff --git a/compiler-rt/test/ubsan/CMakeLists.txt b/compiler-rt/test/ubsan/CMakeLists.txt index 02088c35df1..14e7f3cfe1d 100644 --- a/compiler-rt/test/ubsan/CMakeLists.txt +++ b/compiler-rt/test/ubsan/CMakeLists.txt @@ -40,6 +40,15 @@ foreach(arch ${UBSAN_TEST_ARCH}) endif() endforeach() +if(APPLE) + foreach(arch ${UBSAN_TEST_ARCH}) + set(UBSAN_TEST_TARGET_ARCH ${arch}) + get_test_cc_for_arch(${arch} UBSAN_TEST_TARGET_CC UBSAN_TEST_TARGET_CFLAGS) + append("-lc++abi" UBSAN_TEST_TARGET_CFLAGS) + add_ubsan_testsuite("StandaloneStatic" ubsan ${arch}) + endforeach() +endif() + add_lit_testsuite(check-ubsan "Running UndefinedBehaviorSanitizer tests" ${UBSAN_TESTSUITES} DEPENDS ${UBSAN_TEST_DEPS}) diff --git a/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cc b/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cc index f96b487a487..05c19937ddf 100644 --- a/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cc +++ b/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cc @@ -22,6 +22,7 @@ // Coverage is not yet implemented in TSan. // XFAIL: ubsan-tsan +// UNSUPPORTED: ubsan-standalone-static volatile int sink; int main(int argc, char **argv) { diff --git a/compiler-rt/test/ubsan/lit.common.cfg b/compiler-rt/test/ubsan/lit.common.cfg index 718d66741d2..8c6801e2c12 100644 --- a/compiler-rt/test/ubsan/lit.common.cfg +++ b/compiler-rt/test/ubsan/lit.common.cfg @@ -21,6 +21,10 @@ if ubsan_lit_test_mode == "Standalone": config.name = 'UBSan-Standalone-' + config.target_arch config.available_features.add("ubsan-standalone") clang_ubsan_cflags = [] +elif ubsan_lit_test_mode == "StandaloneStatic": + config.name = 'UBSan-StandaloneStatic-' + config.target_arch + config.available_features.add("ubsan-standalone-static") + clang_ubsan_cflags = ['-static-libsan'] elif ubsan_lit_test_mode == "AddressSanitizer": config.name = 'UBSan-ASan-' + config.target_arch config.available_features.add("ubsan-asan") |