diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/asan/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/asan/TestCases/Linux/global-overflow-bfd.cc | 18 | ||||
-rw-r--r-- | test/asan/TestCases/Linux/global-overflow-lld.cc | 19 | ||||
-rw-r--r-- | test/asan/TestCases/Linux/globals-gc-sections-lld.cc | 15 | ||||
-rw-r--r-- | test/asan/TestCases/Linux/globals-gc-sections.cc | 13 | ||||
-rw-r--r-- | test/cfi/CMakeLists.txt | 2 | ||||
-rw-r--r-- | test/lit.common.configured.in | 2 |
7 files changed, 16 insertions, 55 deletions
diff --git a/test/asan/CMakeLists.txt b/test/asan/CMakeLists.txt index b253742f0..893276767 100644 --- a/test/asan/CMakeLists.txt +++ b/test/asan/CMakeLists.txt @@ -16,7 +16,7 @@ endmacro() set(ASAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND ASAN_TEST_DEPS asan) - if(NOT APPLE AND COMPILER_RT_HAS_LLD) + if(WIN32 AND COMPILER_RT_HAS_LLD_SOURCES) list(APPEND ASAN_TEST_DEPS lld ) diff --git a/test/asan/TestCases/Linux/global-overflow-bfd.cc b/test/asan/TestCases/Linux/global-overflow-bfd.cc deleted file mode 100644 index 117a761af..000000000 --- a/test/asan/TestCases/Linux/global-overflow-bfd.cc +++ /dev/null @@ -1,18 +0,0 @@ -// Test that gc-sections-friendly instrumentation of globals does not introduce -// false negatives with the BFD linker. -// RUN: %clangxx_asan -fuse-ld=bfd -Wl,-gc-sections -ffunction-sections -fdata-sections -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s - -#include <string.h> -int main(int argc, char **argv) { - static char XXX[10]; - static char YYY[10]; - static char ZZZ[10]; - memset(XXX, 0, 10); - memset(YYY, 0, 10); - memset(ZZZ, 0, 10); - int res = YYY[argc * 10]; // BOOOM - // CHECK: {{READ of size 1 at}} - // CHECK: {{located 0 bytes to the right of global variable}} - res += XXX[argc] + ZZZ[argc]; - return res; -} diff --git a/test/asan/TestCases/Linux/global-overflow-lld.cc b/test/asan/TestCases/Linux/global-overflow-lld.cc deleted file mode 100644 index f4d0bc977..000000000 --- a/test/asan/TestCases/Linux/global-overflow-lld.cc +++ /dev/null @@ -1,19 +0,0 @@ -// Test that gc-sections-friendly instrumentation of globals does not introduce -// false negatives with the LLD linker. -// RUN: %clangxx_asan -fuse-ld=lld -Wl,-gc-sections -ffunction-sections -fdata-sections -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s -// REQUIRES: lld - -#include <string.h> -int main(int argc, char **argv) { - static char XXX[10]; - static char YYY[10]; - static char ZZZ[10]; - memset(XXX, 0, 10); - memset(YYY, 0, 10); - memset(ZZZ, 0, 10); - int res = YYY[argc * 10]; // BOOOM - // CHECK: {{READ of size 1 at}} - // CHECK: {{located 0 bytes to the right of global variable}} - res += XXX[argc] + ZZZ[argc]; - return res; -} diff --git a/test/asan/TestCases/Linux/globals-gc-sections-lld.cc b/test/asan/TestCases/Linux/globals-gc-sections-lld.cc deleted file mode 100644 index 0d8bcdd1c..000000000 --- a/test/asan/TestCases/Linux/globals-gc-sections-lld.cc +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -mllvm -asan-globals=0 -// RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -mllvm -asan-globals=1 - -// https://code.google.com/p/address-sanitizer/issues/detail?id=260 -// REQUIRES: lld - -int undefined(); - -// On i386 clang adds --export-dynamic when linking with ASan, which adds all -// non-hidden globals to GC roots. -__attribute__((visibility("hidden"))) int (*unused)() = undefined; - -int main() { - return 0; -} diff --git a/test/asan/TestCases/Linux/globals-gc-sections.cc b/test/asan/TestCases/Linux/globals-gc-sections.cc new file mode 100644 index 000000000..72a9e9498 --- /dev/null +++ b/test/asan/TestCases/Linux/globals-gc-sections.cc @@ -0,0 +1,13 @@ +// RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -ffunction-sections -mllvm -asan-globals=0 +// RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -ffunction-sections -mllvm -asan-globals=1 + +// https://code.google.com/p/address-sanitizer/issues/detail?id=260 +// XFAIL: * + +int undefined(); + +int (*unused)() = undefined; + +int main() { + return 0; +} diff --git a/test/cfi/CMakeLists.txt b/test/cfi/CMakeLists.txt index c3123a820..bd51eacb6 100644 --- a/test/cfi/CMakeLists.txt +++ b/test/cfi/CMakeLists.txt @@ -34,7 +34,7 @@ if(NOT COMPILER_RT_STANDALONE_BUILD) LTO ) endif() - if(WIN32 AND COMPILER_RT_HAS_LLD) + if(WIN32 AND COMPILER_RT_HAS_LLD_SOURCES) list(APPEND CFI_TEST_DEPS lld ) diff --git a/test/lit.common.configured.in b/test/lit.common.configured.in index 387f4d4a7..862d06bf2 100644 --- a/test/lit.common.configured.in +++ b/test/lit.common.configured.in @@ -26,7 +26,7 @@ set_default("compiler_rt_debug", @COMPILER_RT_DEBUG_PYBOOL@) set_default("compiler_rt_libdir", "@COMPILER_RT_LIBRARY_OUTPUT_DIR@") set_default("emulator", "@COMPILER_RT_EMULATOR@") set_default("sanitizer_can_use_cxxabi", @SANITIZER_CAN_USE_CXXABI_PYBOOL@) -set_default("has_lld", @COMPILER_RT_HAS_LLD_PYBOOL@) +set_default("has_lld", @COMPILER_RT_HAS_LLD_SOURCES_PYBOOL@) set_default("can_symbolize", @CAN_SYMBOLIZE@) config.available_features.add('target-is-%s' % config.target_arch) |