blob: 40d7bb06fd3a9d0effac759834c567f6c0b80bf3 [file] [log] [blame]
// Check that LSan annotations work fine.
// RUN: %clangxx_lsan -O0 %s -o %t && %run %t
// RUN: %clangxx_lsan -O3 %s -o %t && %run %t
#include <sanitizer/lsan_interface.h>
#include <stdlib.h>
int *x, *y, *z;
int main() {
x = new int;
__lsan_ignore_object(x);
z = new int[1000000]; // Large enough for the secondary allocator.
__lsan_ignore_object(z);
{
__lsan::ScopedDisabler disabler;
y = new int;
}
x = y = z = nullptr;
return 0;
}