15 lines · cpp
1// RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -mllvm -asan-globals=02// RUN: %clangxx_asan %s -o %t -Wl,--gc-sections -fuse-ld=lld -ffunction-sections -fdata-sections -mllvm -asan-globals=13 4// https://code.google.com/p/address-sanitizer/issues/detail?id=2605// REQUIRES: lld6int undefined();7 8// On i386 clang adds --export-dynamic when linking with ASan, which adds all9// non-hidden globals to GC roots.10__attribute__((visibility("hidden"))) int (*unused)() = undefined;11 12int main() {13 return 0;14}15