diff options
Diffstat (limited to 'lib/asan/lit_tests/TestCases/lsan_annotations.cc')
-rw-r--r-- | lib/asan/lit_tests/TestCases/lsan_annotations.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/asan/lit_tests/TestCases/lsan_annotations.cc b/lib/asan/lit_tests/TestCases/lsan_annotations.cc new file mode 100644 index 0000000000000..c55ab8692eb5f --- /dev/null +++ b/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; +} |