From c6864e9039b640dab4b19b95b08da758835a12ea Mon Sep 17 00:00:00 2001 From: Alexander Potapenko Date: Fri, 31 Jan 2014 14:58:54 +0000 Subject: [ASan] Add a failing test that demonstrates that ASan currently breaks dead code stripping on Linux. See https://code.google.com/p/address-sanitizer/issues/detail?id=260 for more info. llvm-svn: 200553 --- .../asan/lit_tests/TestCases/Linux/globals-gc-sections.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 compiler-rt/lib/asan/lit_tests/TestCases/Linux/globals-gc-sections.cc (limited to 'compiler-rt') diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/Linux/globals-gc-sections.cc b/compiler-rt/lib/asan/lit_tests/TestCases/Linux/globals-gc-sections.cc new file mode 100644 index 00000000000..72a9e9498f8 --- /dev/null +++ b/compiler-rt/lib/asan/lit_tests/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; +} -- cgit v1.2.3