[mlir] More fixes for 9fddaf6b14102963f12dbb9730f101fc52e662c1
[llvm-project.git] / compiler-rt / test / lsan / TestCases / lsan_annotations.cpp
blob40d7bb06fd3a9d0effac759834c567f6c0b80bf3
1 // Check that LSan annotations work fine.
2 // RUN: %clangxx_lsan -O0 %s -o %t && %run %t
3 // RUN: %clangxx_lsan -O3 %s -o %t && %run %t
5 #include <sanitizer/lsan_interface.h>
6 #include <stdlib.h>
8 int *x, *y, *z;
10 int main() {
11 x = new int;
12 __lsan_ignore_object(x);
14 z = new int[1000000]; // Large enough for the secondary allocator.
15 __lsan_ignore_object(z);
18 __lsan::ScopedDisabler disabler;
19 y = new int;
22 x = y = z = nullptr;
23 return 0;