summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib')
-rw-r--r--compiler-rt/lib/asan/lit_tests/TestCases/lsan_annotations.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/lsan_annotations.cc b/compiler-rt/lib/asan/lit_tests/TestCases/lsan_annotations.cc
new file mode 100644
index 00000000000..c55ab8692eb
--- /dev/null
+++ b/compiler-rt/lib/asan/lit_tests/TestCases/lsan_annotations.cc
@@ -0,0 +1,16 @@
+// Check that LSan annotations work fine.
+// RUN: %clangxx_asan -O0 %s -o %t && %t
+// RUN: %clangxx_asan -O3 %s -o %t && %t
+
+#include <sanitizer/lsan_interface.h>
+#include <stdlib.h>
+
+int main() {
+ int *x = new int;
+ __lsan_ignore_object(x);
+ {
+ __lsan::ScopedDisabler disabler;
+ double *y = new double;
+ }
+ return 0;
+}
OpenPOWER on IntegriCloud