[PATCH] [lsan] Remove old LSan tests. Convert one of them to a LIT test.
Kostya Serebryany
kcc at google.com
Mon May 27 00:54:23 PDT 2013
================
Comment at: lib/lsan/lit_tests/use_globals_initialized.cc:5
@@ +4,3 @@
+// RUN: LSAN_OPTIONS=$LSAN_BASE:"use_globals=0" %t 2>&1 | FileCheck --check-prefix=CHECK-leak %s
+// RUN: LSAN_OPTIONS=$LSAN_BASE:"use_globals=1" %t 2>&1
+// RUN: LSAN_OPTIONS="" %t 2>&1
----------------
Is this correct?
use_globals=1 has no leaks, but use_globals=0 has them?
================
Comment at: lib/lsan/lit_tests/use_globals_initialized.cc:11
@@ +10,3 @@
+
+unsigned kSmallAllocSize = 1337;
+
----------------
This constant is used just once and then in the CHECK section you use 1337 again.
So, I'd just use malloc(1337);
================
Comment at: lib/lsan/lit_tests/use_globals_initialized.cc:20
@@ +19,3 @@
+}
+// CHECK-leak: Test alloc: [[ADDR:.*]].
+// CHECK-leak: Directly leaked 1337 byte block at [[ADDR]]
----------------
lsan report should have a header, like asan/msan/tsan do
==1234== WARNING: LeakSanitizer: memory leaks
and the tests need to check for it.
http://llvm-reviews.chandlerc.com/D860
More information about the llvm-commits
mailing list