summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
diff options
context:
space:
mode:
authorAlexander Potapenko <glider@google.com>2014-01-31 14:58:54 +0000
committerAlexander Potapenko <glider@google.com>2014-01-31 14:58:54 +0000
commitc6864e9039b640dab4b19b95b08da758835a12ea (patch)
treea5140e88c4597c178a80559e6ef9cf7d55564bc3 /compiler-rt/lib
parentb760aa672270926bb47b6b5e65efd22b8f37d506 (diff)
downloadbcm5719-llvm-c6864e9039b640dab4b19b95b08da758835a12ea.tar.gz
bcm5719-llvm-c6864e9039b640dab4b19b95b08da758835a12ea.zip
[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
Diffstat (limited to 'compiler-rt/lib')
-rw-r--r--compiler-rt/lib/asan/lit_tests/TestCases/Linux/globals-gc-sections.cc13
1 files changed, 13 insertions, 0 deletions
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;
+}
OpenPOWER on IntegriCloud