Index: test/lsan/TestCases/cleanup_in_tsd_destructor.c =================================================================== --- test/lsan/TestCases/cleanup_in_tsd_destructor.c +++ test/lsan/TestCases/cleanup_in_tsd_destructor.c @@ -4,7 +4,7 @@ // additional cleanup tasks). LSan doesn't actually meet that goal 100%, but it // makes its best effort. // RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0" -// RUN: %clangxx_lsan %s -o %t +// RUN: %clang_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE:use_tls=1 %run %t // RUN: LSAN_OPTIONS=$LSAN_BASE:use_tls=0 not %run %t 2>&1 | FileCheck %s Index: test/lsan/TestCases/disabler.c =================================================================== --- test/lsan/TestCases/disabler.c +++ test/lsan/TestCases/disabler.c @@ -1,6 +1,6 @@ -// Test for ScopedDisabler. +// Test for __lsan_disable() / __lsan_enable(). // RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=0" -// RUN: %clangxx_lsan %s -o %t +// RUN: %clang_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck %s #include @@ -11,10 +11,11 @@ int main() { void **p; { - __lsan::ScopedDisabler d; - p = new void *; + __lsan_disable(); + p = malloc(sizeof(void *)); + __lsan_enable(); } - *reinterpret_cast(p) = malloc(666); + *p = malloc(666); void *q = malloc(1337); // Break optimization. fprintf(stderr, "Test alloc: %p.\n", q); Index: test/lsan/TestCases/disabler.cc =================================================================== --- test/lsan/TestCases/disabler.cc +++ test/lsan/TestCases/disabler.cc @@ -13,11 +13,13 @@ { __lsan::ScopedDisabler d; p = new void *; + fprintf(stderr, "Test alloc p: %p.\n", p); } - *reinterpret_cast(p) = malloc(666); + *p = malloc(666); void *q = malloc(1337); - // Break optimization. - fprintf(stderr, "Test alloc: %p.\n", q); + fprintf(stderr, "Test alloc q: %p.\n", q); return 0; } -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) + +// CHECK: Test alloc p: [[ADDR:.*]]. +// CHECK-NOT: [[ADDR]] Index: test/lsan/TestCases/disabler_in_tsd_destructor.c =================================================================== --- test/lsan/TestCases/disabler_in_tsd_destructor.c +++ test/lsan/TestCases/disabler_in_tsd_destructor.c @@ -1,6 +1,6 @@ // Regression test. Disabler should not depend on TSD validity. // RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=1" -// RUN: %clangxx_lsan %s -o %t +// RUN: %clang_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE %run %t #include @@ -13,11 +13,12 @@ pthread_key_t key; void key_destructor(void *arg) { - __lsan::ScopedDisabler d; + __lsan_disable(); void *p = malloc(1337); // Break optimization. fprintf(stderr, "Test alloc: %p.\n", p); pthread_setspecific(key, 0); + __lsan_enable(); } void *thread_func(void *arg) { Index: test/lsan/TestCases/ignore_object.c =================================================================== --- test/lsan/TestCases/ignore_object.c +++ test/lsan/TestCases/ignore_object.c @@ -1,6 +1,6 @@ // Test for __lsan_ignore_object(). // RUN: LSAN_BASE="report_objects=1:use_registers=0:use_stacks=0:use_globals=0:use_tls=0" -// RUN: %clangxx_lsan %s -o %t +// RUN: %clang_lsan %s -o %t // RUN: LSAN_OPTIONS=$LSAN_BASE not %run %t 2>&1 | FileCheck %s #include @@ -10,7 +10,7 @@ int main() { // Explicitly ignored object. - void **p = new void *; + void **p = malloc(sizeof(void *)); // Transitively ignored object. *p = malloc(666); // Non-ignored object.