1 // Test that unused globals are included in the root set.
2 // RUN: %clangxx_lsan -O2 %s -DTEST_LIB -c -o %t.o
3 // RUN: %clangxx_lsan -O2 %s %t.o -o %t
4 // RUN: %env_lsan_opts="use_stacks=0:use_registers=0:use_globals=1" %run %t 2>&1 | FileCheck %s --implicit-check-not=leak
5 // RUN: %env_lsan_opts="" %run %t 2>&1 | FileCheck %s --implicit-check-not=leak
7 // FIXME: This check is not very important and fails on arm7.
8 // %env_lsan_opts="use_stacks=0:use_registers=0:use_globals=0" not %run %t 2>&1 | FileCheck %s --check-prefixes=LEAK
26 // Store from a different function to suppress global localization.
34 printf("%p %s\n", b
, b
);
40 // LEAK: LeakSanitizer: detected memory leaks