Files
clang-p2996/compiler-rt/test/asan/TestCases/Linux/globals-gc-sections-lld.cpp
Mitch Phillips 1d03a54d94 Revert "[test] Fix asan/TestCases/Linux/globals-gc-sections-lld.cpp with -fsanitize-address-globals-dead-stripping"
This reverts commit 140808768d.

Reason: Broke the upstream bots - discussed offline.
2020-12-07 14:30:53 -08:00

17 lines
637 B
C++

// 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
// FIXME: This may pass on Android, with non-emulated-tls.
// XFAIL: android
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;
}