1 // Test for the leak_check_at_exit flag.
2 // RUN: %clangxx_lsan %s -o %t
3 // RUN: %env_lsan_opts=use_stacks=0:use_registers=0 not %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-do
4 // RUN: %env_lsan_opts=use_stacks=0:use_registers=0 not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-do
5 // RUN: %env_lsan_opts=use_stacks=0:use_registers=0:leak_check_at_exit=0 not %run %t foo 2>&1 | FileCheck %s --check-prefix=CHECK-do
6 // RUN: %env_lsan_opts=use_stacks=0:use_registers=0:leak_check_at_exit=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-dont
10 #include <sanitizer/lsan_interface.h>
12 int main(int argc
, char *argv
[]) {
13 fprintf(stderr
, "Test alloc: %p.\n", malloc(1337));
15 __lsan_do_leak_check();
19 // CHECK-do: SUMMARY: {{.*}}Sanitizer:
20 // CHECK-dont-NOT: SUMMARY: {{.*}}Sanitizer: