1 // Check that LSan annotations work fine. 2 // RUN: %clangxx_asan -O0 %s -o %t && %run %t 3 // RUN: %clangxx_asan -O3 %s -o %t && %run %t 4 5 #include <sanitizer/lsan_interface.h> 6 #include <stdlib.h> 7 8 int *x, *y; 9 main()10int main() { 11 x = new int; 12 __lsan_ignore_object(x); 13 14 { 15 __lsan::ScopedDisabler disabler; 16 y = new int; 17 } 18 19 x = y = nullptr; 20 return 0; 21 } 22