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
3 
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
8 int undefined();
9 
10 // On i386 clang adds --export-dynamic when linking with ASan, which adds all
11 // non-hidden globals to GC roots.
12 __attribute__((visibility("hidden"))) int (*unused)() = undefined;
13 
main()14 int main() {
15         return 0;
16 }
17