Skip to content

Commit 1408087

Browse files
committed
[test] Fix asan/TestCases/Linux/globals-gc-sections-lld.cpp with -fsanitize-address-globals-dead-stripping
r302591 dropped -fsanitize-address-globals-dead-stripping for ELF platforms (to work around a gold<2.27 bug: https://sourceware.org/bugzilla/show_bug.cgi?id=19002) Upgrade REQUIRES: from lto (COMPILER_RT_TEST_USE_LLD (set by Android, but rarely used elsewhere)) to lto-available.
1 parent dde44f4 commit 1408087

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

compiler-rt/test/asan/TestCases/Linux/globals-gc-sections-lld.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
// RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -mllvm -asan-globals=0
2-
// RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -mllvm -asan-globals=1
1+
/// Without instrumenting globals, --gc-sections drops the undefined symbol.
2+
// RUN: %clangxx_asan %s -o /dev/null -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -mllvm -asan-globals=0
3+
/// With -fsanitize-address-globals-dead-stripping and -fdata-sections, a garbage
4+
/// collectable custom metadata section is used for instrumented globals.
5+
// RUN: %clangxx_asan %s -o /dev/null -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -fsanitize-address-globals-dead-stripping
36

4-
// https://code.google.com/p/address-sanitizer/issues/detail?id=260
5-
// REQUIRES: lld
6-
// FIXME: This may pass on Android, with non-emulated-tls.
7-
// XFAIL: android
7+
// https://github.com/google/sanitizers/issues/260
8+
// REQUIRES: lld-available
89
int undefined();
910

1011
// On i386 clang adds --export-dynamic when linking with ASan, which adds all

0 commit comments

Comments
 (0)