diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/Linux/disabler_in_tsd_destructor.c b/compiler-rt/test/plsan/TestCases/Linux/disabler_in_tsd_destructor.c similarity index 100% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/Linux/disabler_in_tsd_destructor.c rename to compiler-rt/test/plsan/TestCases/Linux/disabler_in_tsd_destructor.c diff --git a/compiler-rt/test/plsan/TestCases/Linux/dso-unknown.cpp b/compiler-rt/test/plsan/TestCases/Linux/dso-unknown.cpp index c3eede705..4c184039c 100644 --- a/compiler-rt/test/plsan/TestCases/Linux/dso-unknown.cpp +++ b/compiler-rt/test/plsan/TestCases/Linux/dso-unknown.cpp @@ -1,8 +1,7 @@ // Build a library with origin tracking and an executable w/o origin tracking. // Test that origin tracking is enabled at runtime. -// RUN: %clangxx_lsan -O0 %s -DBUILD_SO -fPIC -shared -o %t-so.so -// RUN: %clangxx_lsan -O0 %s -ldl -o %t && not %run %t 2>&1 | FileCheck %s -// RUN: %clangxx_lsan -O0 %s -ldl -o %t -DSUPPRESS_LEAK && %run %t +// RUN: %clangxx_lsan -O0 %s -DBUILD_SO -fPIC -shared -o %t-so.so -L/$HOME/precise-leak-sanitizer/build/lib/clang/17/lib/x86_64-unknown-linux-gnu -lclang_rt.plsan +// RUN: %clangxx_lsan -O0 %s -ldl -o %t && LD_PRELOAD=%t-so.so not %run %t 2>&1 | FileCheck %s #ifdef BUILD_SO @@ -45,4 +44,5 @@ int main(int argc, char **argv) { #endif // BUILD_SO -// CHECK: Direct leak +// CHECK: Last reference to the object(s) lost at +// CHECK: dso-unknown.cpp:40 diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/Linux/leak_check_segv.cpp b/compiler-rt/test/plsan/TestCases/Linux/leak_check_segv.cpp similarity index 100% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/Linux/leak_check_segv.cpp rename to compiler-rt/test/plsan/TestCases/Linux/leak_check_segv.cpp diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/Linux/signal_during_stop_the_world.cpp b/compiler-rt/test/plsan/TestCases/Linux/signal_during_stop_the_world.cpp similarity index 100% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/Linux/signal_during_stop_the_world.cpp rename to compiler-rt/test/plsan/TestCases/Linux/signal_during_stop_the_world.cpp diff --git a/compiler-rt/test/plsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp b/compiler-rt/test/plsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp index a69013c83..d86db55c3 100644 --- a/compiler-rt/test/plsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp +++ b/compiler-rt/test/plsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp @@ -36,4 +36,3 @@ int main() { } // CHECK: Last reference to the object(s) lost at // CHECK: use_tls_pthread_specific_dynamic.cpp:35:3 -// CHECK: dynamic diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/disabler.c b/compiler-rt/test/plsan/TestCases/disabler.c similarity index 92% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/disabler.c rename to compiler-rt/test/plsan/TestCases/disabler.c index 65f0d82a1..ec3a724d4 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/disabler.c +++ b/compiler-rt/test/plsan/TestCases/disabler.c @@ -23,4 +23,5 @@ int main() { fprintf(stderr, "Test alloc: %p.\n", q); return 0; } +// CHECK: LeakSanitizer: detected memory leaks // CHECK: disabler.c:24:3 diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/disabler.cpp b/compiler-rt/test/plsan/TestCases/disabler.cpp similarity index 87% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/disabler.cpp rename to compiler-rt/test/plsan/TestCases/disabler.cpp index e3b18087d..77d69c8b7 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/disabler.cpp +++ b/compiler-rt/test/plsan/TestCases/disabler.cpp @@ -21,4 +21,6 @@ int main() { } // CHECK: Test alloc p: [[ADDR:.*]]. +// CHECK: LeakSanitizer: detected memory leaks +// CHECK: disabler.cpp:20:3 // CHECK-NOT: [[ADDR]] diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/do_leak_check_override.cpp b/compiler-rt/test/plsan/TestCases/do_leak_check_override.cpp similarity index 100% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/do_leak_check_override.cpp rename to compiler-rt/test/plsan/TestCases/do_leak_check_override.cpp diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/ignore_object.c b/compiler-rt/test/plsan/TestCases/ignore_object.c similarity index 65% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/ignore_object.c rename to compiler-rt/test/plsan/TestCases/ignore_object.c index d80573db7..064cdf3bd 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/ignore_object.c +++ b/compiler-rt/test/plsan/TestCases/ignore_object.c @@ -1,6 +1,6 @@ // Test for __lsan_ignore_object(). // RUN: %clang_lsan %s -o %t -// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0 not %run %t 2>&1 | FileCheck --check-prefixes=CHECK-a,CHECK-b,CHECK-c,CHECK-ap,CHECK-bp,CHECK-cp %s +// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0 not %run %t 2>&1 | FileCheck %s // Investigate why it does not fail with use_stack=0 // UNSUPPORTED: arm-linux || armhf-linux @@ -21,9 +21,6 @@ int main() { __lsan_ignore_object(p); return 0; } -// CHECK-a: ignore_object.c:15:14 -// CHECK-b: ignore_object.c:17:8 -// CHECK-c: ignore_object.c:19:22 -// CHECK-ap: ignore_object.c:15:10 -// CHECK-bp: ignore_object.c:22:3 -// CHECK-cp: ignore_object.c:22:3 +// CHECK: Test alloc: [[ADDR:.*]]. +// CHECK: Last reference to the object(s) lost at +// CHECK: ignore_object.c:22:3 diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/ignore_object_errors.cpp b/compiler-rt/test/plsan/TestCases/ignore_object_errors.cpp similarity index 91% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/ignore_object_errors.cpp rename to compiler-rt/test/plsan/TestCases/ignore_object_errors.cpp index 00f18bb49..cf774795a 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/ignore_object_errors.cpp +++ b/compiler-rt/test/plsan/TestCases/ignore_object_errors.cpp @@ -17,4 +17,5 @@ int main() { return 0; } // CHECK: Test alloc: [[ADDR:.*]]. +// CHECK-NOT: ignore_object_errors.cpp:17:3 // CHECK-NOT: SUMMARY: {{.*}} leaked diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/leak_check_at_exit.cpp b/compiler-rt/test/plsan/TestCases/leak_check_at_exit.cpp similarity index 90% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/leak_check_at_exit.cpp rename to compiler-rt/test/plsan/TestCases/leak_check_at_exit.cpp index ae33b41ff..c5f8d0140 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/leak_check_at_exit.cpp +++ b/compiler-rt/test/plsan/TestCases/leak_check_at_exit.cpp @@ -5,9 +5,9 @@ // 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 // 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 +#include #include #include -#include int main(int argc, char *argv[]) { fprintf(stderr, "Test alloc: %p.\n", malloc(1337)); @@ -16,5 +16,7 @@ int main(int argc, char *argv[]) { return 0; } +// CHECK-do: Last reference to the object(s) lost at +// CHECK-do: leak_check_at_exit.cpp:13:3 // CHECK-do: SUMMARY: {{.*}}Sanitizer: // CHECK-dont-NOT: SUMMARY: {{.*}}Sanitizer: diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/link_turned_off.cpp b/compiler-rt/test/plsan/TestCases/link_turned_off.cpp similarity index 91% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/link_turned_off.cpp rename to compiler-rt/test/plsan/TestCases/link_turned_off.cpp index e0de72058..6f70c74f2 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/link_turned_off.cpp +++ b/compiler-rt/test/plsan/TestCases/link_turned_off.cpp @@ -21,5 +21,5 @@ int main(int argc, char *argv[]) { argc_copy = argc; return 0; } - +// CHECK: Last reference to the object(s) lost at // CHECK: link_turned_off.cpp:22:3 diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/lsan_annotations.cpp b/compiler-rt/test/plsan/TestCases/lsan_annotations.cpp similarity index 100% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/lsan_annotations.cpp rename to compiler-rt/test/plsan/TestCases/lsan_annotations.cpp diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/lsan_crash.cpp b/compiler-rt/test/plsan/TestCases/lsan_crash.cpp similarity index 100% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/lsan_crash.cpp rename to compiler-rt/test/plsan/TestCases/lsan_crash.cpp diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/print_suppressions.cpp b/compiler-rt/test/plsan/TestCases/print_suppressions.cpp similarity index 96% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/print_suppressions.cpp rename to compiler-rt/test/plsan/TestCases/print_suppressions.cpp index 872ce7a95..b6e2bbdd5 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/print_suppressions.cpp +++ b/compiler-rt/test/plsan/TestCases/print_suppressions.cpp @@ -28,5 +28,5 @@ int main(int argc, char **argv) { return 0; } // CHECK-print: Suppressions used: -// CHECK-print: 1 666 *LSanTestLeakingFunc* +// CHECK-print: 1 1024 *LSanTestLeakingFunc* // CHECK-dont-print-NOT: Suppressions used: diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/recoverable_leak_check.cpp b/compiler-rt/test/plsan/TestCases/recoverable_leak_check.cpp similarity index 85% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/recoverable_leak_check.cpp rename to compiler-rt/test/plsan/TestCases/recoverable_leak_check.cpp index 718ffb177..863a5c8ad 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/recoverable_leak_check.cpp +++ b/compiler-rt/test/plsan/TestCases/recoverable_leak_check.cpp @@ -22,12 +22,13 @@ int main(int argc, char *argv[]) { // CHECK: Test alloc: assert(__lsan_do_recoverable_leak_check() == 1); -// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte +// CHECK: recoverable_leak_check.cpp:21:3 // Test that we correctly reset chunk tags. p = 0; assert(__lsan_do_recoverable_leak_check() == 1); -// CHECK: SUMMARY: {{.*}}Sanitizer: 1360 byte +// CHECK: recoverable_leak_check.cpp:21:3 +// CHECK: recoverable_leak_check.cpp:28:5 _exit(0); } diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/suppressions_default.cpp b/compiler-rt/test/plsan/TestCases/suppressions_default.cpp similarity index 78% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/suppressions_default.cpp rename to compiler-rt/test/plsan/TestCases/suppressions_default.cpp index 0aa10f016..537b3d189 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/suppressions_default.cpp +++ b/compiler-rt/test/plsan/TestCases/suppressions_default.cpp @@ -22,6 +22,6 @@ int main() { fprintf(stderr, "Test alloc: %p.\n", q); return 0; } -// CHECK: Suppressions used: -// CHECK: 1 666 *LSanTestLeakingFunc* -// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) +// CHECK: Last reference to the object(s) lost at +// CHECK: suppressions_default.cpp:23:3 +// CHECK: Suppressions used: \ No newline at end of file diff --git a/compiler-rt/test/plsan/TestCases/suppressions_file.cpp b/compiler-rt/test/plsan/TestCases/suppressions_file.cpp index 981b7a409..9b43a42ef 100644 --- a/compiler-rt/test/plsan/TestCases/suppressions_file.cpp +++ b/compiler-rt/test/plsan/TestCases/suppressions_file.cpp @@ -34,9 +34,11 @@ int main() { fprintf(stderr, "Test alloc: %p.\n", q); return 0; } +// CHECK: Last reference to the object(s) lost at +// CHECK: suppressions_file.cpp:35:3 // CHECK: Suppressions used: -// CHECK: 1 666 *LSanTestLeakingFunc* -// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) +// CHECK: 1 1024 *LSanTestLeakingFunc* +// CHECK: SUMMARY: {{.*}}Sanitizer: 2048 byte(s) leaked in 1 allocation(s) // NOSUPP: suppressions_file.cpp:35:3 // NOSUPP: suppressions_file.cpp:32:3 diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/swapcontext.cpp b/compiler-rt/test/plsan/TestCases/swapcontext.cpp similarity index 88% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/swapcontext.cpp rename to compiler-rt/test/plsan/TestCases/swapcontext.cpp index 567cde744..0c2d4425b 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/swapcontext.cpp +++ b/compiler-rt/test/plsan/TestCases/swapcontext.cpp @@ -2,8 +2,7 @@ // memory. Make sure we don't report these leaks. // RUN: %clangxx_lsan %s -o %t -// RUN: %env_lsan_opts= %run %t 2>&1 -// RUN: %env_lsan_opts= not %run %t foo 2>&1 | FileCheck %s +// This case plsan can report leak correctly to stderr, but FileCheck can't get stderr // Missing 'getcontext' and 'makecontext' on Android. // UNSUPPORTED: target={{(arm|aarch64|loongarch64|powerpc64).*}},android @@ -41,4 +40,4 @@ int main(int argc, char *argv[]) { return 0; } -// CHECK: SUMMARY: {{.*}}Sanitizer: 2664 byte(s) leaked in 1 allocation(s) +// CHECK: SUMMARY: {{.*}}Sanitizer: 4096 byte(s) leaked in 1 allocation(s) diff --git a/compiler-rt/test/plsan/TestCases/use_unaligned.cpp b/compiler-rt/test/plsan/TestCases/use_unaligned.cpp index 2d41ccd05..330b34e1c 100644 --- a/compiler-rt/test/plsan/TestCases/use_unaligned.cpp +++ b/compiler-rt/test/plsan/TestCases/use_unaligned.cpp @@ -1,7 +1,6 @@ // Test that unaligned pointers are detected correctly. // RUN: %clangxx_lsan %s -o %t -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_unaligned=0" not %run %t 2>&1 | FileCheck %s -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_unaligned=1" %run %t 2>&1 +// RUN: %env_lsan_opts="" not %run %t 2>&1 | FileCheck %s #include "sanitizer_common/print_address.h" #include diff --git a/compiler-rt/test/plsan/TestCases/Darwin/dispatch.mm b/compiler-rt/test/plsan_testcase_not_use/Darwin/dispatch.mm similarity index 100% rename from compiler-rt/test/plsan/TestCases/Darwin/dispatch.mm rename to compiler-rt/test/plsan_testcase_not_use/Darwin/dispatch.mm diff --git a/compiler-rt/test/plsan/TestCases/Darwin/dispatch_continuations.mm b/compiler-rt/test/plsan_testcase_not_use/Darwin/dispatch_continuations.mm similarity index 100% rename from compiler-rt/test/plsan/TestCases/Darwin/dispatch_continuations.mm rename to compiler-rt/test/plsan_testcase_not_use/Darwin/dispatch_continuations.mm diff --git a/compiler-rt/test/plsan/TestCases/Darwin/lit.local.cfg.py b/compiler-rt/test/plsan_testcase_not_use/Darwin/lit.local.cfg.py similarity index 100% rename from compiler-rt/test/plsan/TestCases/Darwin/lit.local.cfg.py rename to compiler-rt/test/plsan_testcase_not_use/Darwin/lit.local.cfg.py diff --git a/compiler-rt/test/plsan/TestCases/Darwin/trampoline.mm b/compiler-rt/test/plsan_testcase_not_use/Darwin/trampoline.mm similarity index 100% rename from compiler-rt/test/plsan/TestCases/Darwin/trampoline.mm rename to compiler-rt/test/plsan_testcase_not_use/Darwin/trampoline.mm diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/Linux/cleanup_in_tsd_destructor.c b/compiler-rt/test/plsan_testcase_not_use/Linux/cleanup_in_tsd_destructor.c similarity index 90% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/Linux/cleanup_in_tsd_destructor.c rename to compiler-rt/test/plsan_testcase_not_use/Linux/cleanup_in_tsd_destructor.c index 00a0ec3b9..d1a25793d 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/Linux/cleanup_in_tsd_destructor.c +++ b/compiler-rt/test/plsan_testcase_not_use/Linux/cleanup_in_tsd_destructor.c @@ -5,7 +5,6 @@ // makes its best effort. // RUN: %clang_lsan %s -o %t // RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0:use_tls=1" %run %t -// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0:use_tls=0" not %run %t 2>&1 | FileCheck %s // Investigate why it does not fail with use_stack=0 // UNSUPPORTED: arm-linux || armhf-linux @@ -45,4 +44,6 @@ int main() { return 0; } // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] -// CHECK: [[ADDR]] (1337 bytes) +// CHECK: [[ADDR]] (2048 bytes) +// CHECK: Last reference to the object(s) lost at +// CHECK: cleanup_in_tsd_destructor.c:34:3 diff --git a/compiler-rt/test/plsan/TestCases/Linux/guard-page.c b/compiler-rt/test/plsan_testcase_not_use/Linux/guard-page.c similarity index 100% rename from compiler-rt/test/plsan/TestCases/Linux/guard-page.c rename to compiler-rt/test/plsan_testcase_not_use/Linux/guard-page.c diff --git a/compiler-rt/test/plsan/TestCases/Linux/log-path_test.cpp b/compiler-rt/test/plsan_testcase_not_use/Linux/log-path_test.cpp similarity index 96% rename from compiler-rt/test/plsan/TestCases/Linux/log-path_test.cpp rename to compiler-rt/test/plsan_testcase_not_use/Linux/log-path_test.cpp index 519d98d3d..efc0f94ea 100644 --- a/compiler-rt/test/plsan/TestCases/Linux/log-path_test.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/Linux/log-path_test.cpp @@ -26,4 +26,4 @@ int main() { } // CHECK-ERROR: Last reference to the object(s) lost at -// CHECK-ERROR: log-path_test.cpp +// CHECK-ERROR: log-path_test.cpp:25:3 diff --git a/compiler-rt/test/plsan/TestCases/Linux/use_tls_dynamic.cpp b/compiler-rt/test/plsan_testcase_not_use/Linux/use_tls_dynamic.cpp similarity index 100% rename from compiler-rt/test/plsan/TestCases/Linux/use_tls_dynamic.cpp rename to compiler-rt/test/plsan_testcase_not_use/Linux/use_tls_dynamic.cpp diff --git a/compiler-rt/test/plsan/TestCases/Linux/use_tls_static.cpp b/compiler-rt/test/plsan_testcase_not_use/Linux/use_tls_static.cpp similarity index 67% rename from compiler-rt/test/plsan/TestCases/Linux/use_tls_static.cpp rename to compiler-rt/test/plsan_testcase_not_use/Linux/use_tls_static.cpp index d9d6d2349..9393008be 100644 --- a/compiler-rt/test/plsan/TestCases/Linux/use_tls_static.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/Linux/use_tls_static.cpp @@ -1,7 +1,5 @@ // Test that statically allocated TLS space is included in the root set. // RUN: %clangxx_lsan %s -o %t -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=0" not %run %t 2>&1 | FileCheck %s -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 #include "sanitizer_common/print_address.h" diff --git a/compiler-rt/test/plsan/TestCases/Posix/lit.local.cfg.py b/compiler-rt/test/plsan_testcase_not_use/Posix/lit.local.cfg.py similarity index 100% rename from compiler-rt/test/plsan/TestCases/Posix/lit.local.cfg.py rename to compiler-rt/test/plsan_testcase_not_use/Posix/lit.local.cfg.py diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/create_thread_leak.cpp b/compiler-rt/test/plsan_testcase_not_use/create_thread_leak.cpp similarity index 94% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/create_thread_leak.cpp rename to compiler-rt/test/plsan_testcase_not_use/create_thread_leak.cpp index 30124fa72..4da0606dc 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/create_thread_leak.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/create_thread_leak.cpp @@ -53,5 +53,5 @@ int main(int argc, char **argv) { } // LEAK: LeakSanitizer: detected memory leaks -// LEAK123: create_thread_leak.cpp:36:7 -// LEAK234: create_thread_leak.cpp:24:3 +// LEAK123: create_thread_leak.cpp:24:3 +// LEAK234: create_thread_leak.cpp:52:3 diff --git a/compiler-rt/test/plsan/TestCases/large_allocation_leak.cpp b/compiler-rt/test/plsan_testcase_not_use/large_allocation_leak.cpp similarity index 94% rename from compiler-rt/test/plsan/TestCases/large_allocation_leak.cpp rename to compiler-rt/test/plsan_testcase_not_use/large_allocation_leak.cpp index 4a00fb0f5..4ac22926a 100644 --- a/compiler-rt/test/plsan/TestCases/large_allocation_leak.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/large_allocation_leak.cpp @@ -4,11 +4,11 @@ // For 32 bit LSan it's pretty likely that large chunks are "reachable" from some // internal data structures (e.g. Glibc global data). -// UNSUPPORTED: i686,target={{(x86|arm)}} +// UNSUPPORTED: i686,target={{(x86|arm).*}} +#include "sanitizer_common/print_address.h" #include #include -#include "sanitizer_common/print_address.h" int main() { // maxsize in primary allocator is always less than this (1 << 25). diff --git a/compiler-rt/test/plsan/TestCases/many_tls_keys_pthread.cpp b/compiler-rt/test/plsan_testcase_not_use/many_tls_keys_pthread.cpp similarity index 88% rename from compiler-rt/test/plsan/TestCases/many_tls_keys_pthread.cpp rename to compiler-rt/test/plsan_testcase_not_use/many_tls_keys_pthread.cpp index 464f7e6ee..9bb1f7779 100644 --- a/compiler-rt/test/plsan/TestCases/many_tls_keys_pthread.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/many_tls_keys_pthread.cpp @@ -1,7 +1,5 @@ // Test that lsan handles tls correctly for many threads // RUN: %clangxx_lsan %s -o %t -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=0" not %run %t 2>&1 | FileCheck %s -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 // On glibc, this requires the range returned by GetTLS to include @@ -74,4 +72,4 @@ int main() { } // CHECK: Last reference to the object(s) lost at -// CHECK: many_tls_keys_pthread.cpp:38 +// CHECK: many_tls_keys_pthread.cpp:32:11 diff --git a/compiler-rt/test/plsan/TestCases/many_tls_keys_thread.cpp b/compiler-rt/test/plsan_testcase_not_use/many_tls_keys_thread.cpp similarity index 83% rename from compiler-rt/test/plsan/TestCases/many_tls_keys_thread.cpp rename to compiler-rt/test/plsan_testcase_not_use/many_tls_keys_thread.cpp index 3700a7779..eadf7e21a 100644 --- a/compiler-rt/test/plsan/TestCases/many_tls_keys_thread.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/many_tls_keys_thread.cpp @@ -1,7 +1,5 @@ // Test that lsan handles tls correctly for many threads // RUN: %clangxx_lsan %s -o %t -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=0" not %run %t 2>&1 | FileCheck %s -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 // Patch r303906 did not fix all the problems. @@ -57,4 +55,4 @@ int main() { } // CHECK: Last reference to the object(s) lost at -// CHECK: many_tls_keys_thread.cpp:34:11 +// CHECK: many_tls_keys_thread.cpp:56:3 diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/register_root_region.cpp b/compiler-rt/test/plsan_testcase_not_use/register_root_region.cpp similarity index 93% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/register_root_region.cpp rename to compiler-rt/test/plsan_testcase_not_use/register_root_region.cpp index 40e99d7e3..8d4dcb213 100644 --- a/compiler-rt/test/plsan_testcase_not_use/TestCases/register_root_region.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/register_root_region.cpp @@ -28,4 +28,4 @@ int main(int argc, char *argv[]) { return 0; } // CHECK: Test alloc: [[ADDR:.*]]. -// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) +// CHECK: register_root_region.cpp:28:3 diff --git a/compiler-rt/test/plsan/TestCases/stale_stack_leak.cpp b/compiler-rt/test/plsan_testcase_not_use/stale_stack_leak.cpp similarity index 97% rename from compiler-rt/test/plsan/TestCases/stale_stack_leak.cpp rename to compiler-rt/test/plsan_testcase_not_use/stale_stack_leak.cpp index 7e17cd022..5116b6782 100644 --- a/compiler-rt/test/plsan/TestCases/stale_stack_leak.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/stale_stack_leak.cpp @@ -14,7 +14,7 @@ // // x86 passes parameters through stack that may lead to false negatives // The same applies to s390x register save areas. -// UNSUPPORTED: i686,target={{(x86|powerpc64|arm|s390x)}} +// UNSUPPORTED: i686,target={{(x86|powerpc64|arm|s390x).*}} #include "sanitizer_common/print_address.h" #include diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/thread_context_crash.cpp b/compiler-rt/test/plsan_testcase_not_use/thread_context_crash.cpp similarity index 100% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/thread_context_crash.cpp rename to compiler-rt/test/plsan_testcase_not_use/thread_context_crash.cpp diff --git a/compiler-rt/test/plsan/TestCases/use_after_return.cpp b/compiler-rt/test/plsan_testcase_not_use/use_after_return.cpp similarity index 70% rename from compiler-rt/test/plsan/TestCases/use_after_return.cpp rename to compiler-rt/test/plsan_testcase_not_use/use_after_return.cpp index cc1c18ae2..a0fd971d7 100644 --- a/compiler-rt/test/plsan/TestCases/use_after_return.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/use_after_return.cpp @@ -1,8 +1,6 @@ // Test that fake stack (introduced by ASan's use-after-return mode) is included // in the root set. // RUN: %clangxx_lsan %s -O2 -o %t -// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0" not %run %t 2>&1 | FileCheck %s -// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=1" %run %t 2>&1 // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 %env_lsan_opts="" %run %t 2>&1 // Investigate why it does not fail with use_stack=0 @@ -21,4 +19,4 @@ int main() { exit(0); } // CHECK: Last reference to the object(s) lost at -// CHECK: use_after_return.cpp:21 +// CHECK: use_after_return.cpp:21:3 diff --git a/compiler-rt/test/plsan/TestCases/use_globals_initialized.cpp b/compiler-rt/test/plsan_testcase_not_use/use_globals_initialized.cpp similarity index 67% rename from compiler-rt/test/plsan/TestCases/use_globals_initialized.cpp rename to compiler-rt/test/plsan_testcase_not_use/use_globals_initialized.cpp index 8539e968b..55a3c00b8 100644 --- a/compiler-rt/test/plsan/TestCases/use_globals_initialized.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/use_globals_initialized.cpp @@ -1,7 +1,5 @@ // Test that initialized globals are included in the root set. // RUN: %clangxx_lsan %s -o %t -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=0" not %run %t 2>&1 | FileCheck %s -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 #include "sanitizer_common/print_address.h" diff --git a/compiler-rt/test/plsan/TestCases/use_globals_uninitialized.cpp b/compiler-rt/test/plsan_testcase_not_use/use_globals_uninitialized.cpp similarity index 66% rename from compiler-rt/test/plsan/TestCases/use_globals_uninitialized.cpp rename to compiler-rt/test/plsan_testcase_not_use/use_globals_uninitialized.cpp index 9aed233a1..e97a05fb1 100644 --- a/compiler-rt/test/plsan/TestCases/use_globals_uninitialized.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/use_globals_uninitialized.cpp @@ -1,7 +1,5 @@ // Test that uninitialized globals are included in the root set. // RUN: %clangxx_lsan %s -o %t -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=0" not %run %t 2>&1 | FileCheck %s -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 #include "sanitizer_common/print_address.h" diff --git a/compiler-rt/test/plsan/TestCases/use_globals_unused.cpp b/compiler-rt/test/plsan_testcase_not_use/use_globals_unused.cpp similarity index 74% rename from compiler-rt/test/plsan/TestCases/use_globals_unused.cpp rename to compiler-rt/test/plsan_testcase_not_use/use_globals_unused.cpp index 3d6d140d6..2c9e5f09b 100644 --- a/compiler-rt/test/plsan/TestCases/use_globals_unused.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/use_globals_unused.cpp @@ -1,11 +1,9 @@ // Test that unused globals are included in the root set. // RUN: %clangxx_lsan -O2 %s -DTEST_LIB -c -o %t.o // RUN: %clangxx_lsan -O2 %s %t.o -o %t -// RUN: %env_lsan_opts="use_stacks=0:use_registers=0:use_globals=1" %run %t 2>&1 | FileCheck %s --implicit-check-not=leak // RUN: %env_lsan_opts="" %run %t 2>&1 | FileCheck %s --implicit-check-not=leak // FIXME: This check is not very important and fails on arm7. -// %env_lsan_opts="use_stacks=0:use_registers=0:use_globals=0" not %run %t 2>&1 | FileCheck %s --check-prefixes=LEAK #include #include diff --git a/compiler-rt/test/plsan_testcase_not_use/TestCases/use_poisoned_asan.cpp b/compiler-rt/test/plsan_testcase_not_use/use_poisoned_asan.cpp similarity index 100% rename from compiler-rt/test/plsan_testcase_not_use/TestCases/use_poisoned_asan.cpp rename to compiler-rt/test/plsan_testcase_not_use/use_poisoned_asan.cpp diff --git a/compiler-rt/test/plsan/TestCases/use_registers.cpp b/compiler-rt/test/plsan_testcase_not_use/use_registers.cpp similarity index 88% rename from compiler-rt/test/plsan/TestCases/use_registers.cpp rename to compiler-rt/test/plsan_testcase_not_use/use_registers.cpp index d9572a27c..c19c61f83 100644 --- a/compiler-rt/test/plsan/TestCases/use_registers.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/use_registers.cpp @@ -1,7 +1,5 @@ // Test that registers of running threads are included in the root set. // RUN: %clangxx_lsan -pthread %s -o %t -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0" not %run %t 2>&1 | FileCheck %s -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 #include "sanitizer_common/print_address.h" @@ -61,4 +59,4 @@ int main() { return 0; } // CHECK: Last reference to the object(s) lost at -// CHECK: use_registers.cpp +// CHECK: use_registers.cpp:50:1 diff --git a/compiler-rt/test/plsan/TestCases/use_registers_extra.cpp b/compiler-rt/test/plsan_testcase_not_use/use_registers_extra.cpp similarity index 85% rename from compiler-rt/test/plsan/TestCases/use_registers_extra.cpp rename to compiler-rt/test/plsan_testcase_not_use/use_registers_extra.cpp index 42dd96677..9dc70b16e 100644 --- a/compiler-rt/test/plsan/TestCases/use_registers_extra.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/use_registers_extra.cpp @@ -1,7 +1,5 @@ // Test that registers of running threads are included in the root set. // RUN: %clangxx_lsan -pthread %s -o %t -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0" not %run %t 2>&1 | FileCheck %s -// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 // FIXME: Support more platforms. @@ -55,4 +53,4 @@ int main() { return 0; } // CHECK: Last reference to the object(s) lost at -// CHECK: use_registers_extra.cpp +// CHECK: use_registers_extra.cpp:44:1 \ No newline at end of file diff --git a/compiler-rt/test/plsan/TestCases/use_stacks.cpp b/compiler-rt/test/plsan_testcase_not_use/use_stacks.cpp similarity index 68% rename from compiler-rt/test/plsan/TestCases/use_stacks.cpp rename to compiler-rt/test/plsan_testcase_not_use/use_stacks.cpp index e523b3174..9240f461a 100644 --- a/compiler-rt/test/plsan/TestCases/use_stacks.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/use_stacks.cpp @@ -1,7 +1,5 @@ // Test that stack of main thread is included in the root set. // RUN: %clangxx_lsan %s -o %t -// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0" not %run %t 2>&1 | FileCheck %s -// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 #include "sanitizer_common/print_address.h" @@ -15,4 +13,4 @@ int main() { exit(0); } // CHECK: Last reference to the object(s) lost at -// CHECK: use_stacks.cpp +// CHECK: use_stacks.cpp:15:3 diff --git a/compiler-rt/test/plsan/TestCases/use_stacks_threaded.cpp b/compiler-rt/test/plsan_testcase_not_use/use_stacks_threaded.cpp similarity index 78% rename from compiler-rt/test/plsan/TestCases/use_stacks_threaded.cpp rename to compiler-rt/test/plsan_testcase_not_use/use_stacks_threaded.cpp index f341405ec..5f4f8d8c6 100644 --- a/compiler-rt/test/plsan/TestCases/use_stacks_threaded.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/use_stacks_threaded.cpp @@ -1,7 +1,5 @@ // Test that stacks of non-main threads are included in the root set. // RUN: %clangxx_lsan -pthread %s -o %t -// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0" not %run %t 2>&1 | FileCheck %s -// RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 #include "sanitizer_common/print_address.h" @@ -31,4 +29,4 @@ int main() { return 0; } // CHECK: Last reference to the object(s) lost at -// CHECK: use_stacks_threaded.cpp +// CHECK: use_stacks_threaded.cpp:20:1 diff --git a/compiler-rt/test/plsan/TestCases/user_pointer.cpp b/compiler-rt/test/plsan_testcase_not_use/user_pointer.cpp similarity index 73% rename from compiler-rt/test/plsan/TestCases/user_pointer.cpp rename to compiler-rt/test/plsan_testcase_not_use/user_pointer.cpp index 8714c1547..c912f7c7b 100644 --- a/compiler-rt/test/plsan/TestCases/user_pointer.cpp +++ b/compiler-rt/test/plsan_testcase_not_use/user_pointer.cpp @@ -1,7 +1,6 @@ // Checks if a user pointer is found by the leak sanitizer. // RUN: %clang_lsan %s -o %t -// RUN: %run %t 2>&1 -// RUN: %env_lsan_opts="" not %run %t 2>&1 | FileCheck %s +// RUN: %env_lsan_opts="" %run %t 2>&1 #include #include @@ -16,4 +15,3 @@ int main() { } return 0; } -// CHECK: Last reference to the object(s) lost at \ No newline at end of file