Skip to content

Commit b4abbf1

Browse files
committed
[LSAN] Enable more tests which are passing as is in HWASAN.
Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D143126
1 parent b612143 commit b4abbf1

11 files changed

+13
-46
lines changed

compiler-rt/test/lsan/TestCases/Linux/log-path_test.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
// RUN: %clangxx_lsan %s -o %t
2-
3-
// Fixme: remove once test passes with hwasan
4-
// UNSUPPORTED: hwasan
52
// The globs below do not work in the lit shell.
63

74
// Regular run.
@@ -30,4 +27,4 @@ int main() {
3027

3128
// CHECK-ERROR: LeakSanitizer: detected memory leaks
3229
// CHECK-ERROR: Direct leak of 1337 byte(s) in 1 object(s) allocated from
33-
// CHECK-ERROR: SUMMARY: {{(Leak|Address)}}Sanitizer:
30+
// CHECK-ERROR: SUMMARY: {{.*}}Sanitizer:

compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
// RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=1" %run %t 2>&1
55
// RUN: %env_lsan_opts="" %run %t 2>&1
66

7-
// Fixme: remove once test passes with hwasan
8-
// UNSUPPORTED: hwasan
9-
107
// Investigate why it does not fail with use_tls=0
118
// UNSUPPORTED: arm-linux || armhf-linux
129

compiler-rt/test/lsan/TestCases/disabler.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// RUN: %clang_lsan %s -o %t
33
// RUN: %env_lsan_opts=report_objects=1:use_registers=0:use_stacks=0:use_tls=0 not %run %t 2>&1 | FileCheck %s
44

5-
// Fixme: remove once test passes with hwasan
6-
// UNSUPPORTED: hwasan
7-
85
// Investigate why it does not fail with use_tls=0
96
// UNSUPPORTED: arm-linux || armhf-linux
107

@@ -26,4 +23,4 @@ int main() {
2623
fprintf(stderr, "Test alloc: %p.\n", q);
2724
return 0;
2825
}
29-
// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
26+
// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)

compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Test for __lsan_do_leak_check(). We test it by making the leak check run
22
// before global destructors, which also tests compatibility with HeapChecker's
3-
4-
// Fixme: remove once test passes with hwasan
5-
// UNSUPPORTED: hwasan
63
// "normal" mode (LSan runs in "strict" mode by default).
74
// RUN: %clangxx_lsan %s -o %t
85
// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-strict %s
@@ -37,5 +34,5 @@ int main(int argc, char *argv[]) {
3734
return 0;
3835
}
3936

40-
// CHECK-strict: SUMMARY: {{(Leak|Address)}}Sanitizer: 2003 byte(s) leaked in 2 allocation(s)
41-
// CHECK-normal: SUMMARY: {{(Leak|Address)}}Sanitizer: 666 byte(s) leaked in 1 allocation(s)
37+
// CHECK-strict: SUMMARY: {{.*}}Sanitizer: 2003 byte(s) leaked in 2 allocation(s)
38+
// CHECK-normal: SUMMARY: {{.*}}Sanitizer: 666 byte(s) leaked in 1 allocation(s)

compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// 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
66
// 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
77

8-
// Fixme: remove once test passes with hwasan
9-
// UNSUPPORTED: hwasan
10-
118
#include <stdio.h>
129
#include <stdlib.h>
1310
#include <sanitizer/lsan_interface.h>
@@ -19,5 +16,5 @@ int main(int argc, char *argv[]) {
1916
return 0;
2017
}
2118

22-
// CHECK-do: SUMMARY: {{(Leak|Address)}}Sanitizer:
23-
// CHECK-dont-NOT: SUMMARY: {{(Leak|Address)}}Sanitizer:
19+
// CHECK-do: SUMMARY: {{.*}}Sanitizer:
20+
// CHECK-dont-NOT: SUMMARY: {{.*}}Sanitizer:

compiler-rt/test/lsan/TestCases/leak_check_before_thread_started.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// RUN: %clangxx_lsan %s -o %t
44
// RUN: %env_lsan_opts="log_pointers=1:log_threads=1" %run %t
55

6-
// Fixme: remove once test passes with hwasan
7-
// UNSUPPORTED: hwasan
8-
96
#include <assert.h>
107
#include <pthread.h>
118
#include <stdio.h>

compiler-rt/test/lsan/TestCases/link_turned_off.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// RUN: %clangxx_lsan %s -o %t
33
// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 %run %t
44
// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 not %run %t foo 2>&1 | FileCheck %s
5-
6-
// Fixme: remove once test passes with hwasan
7-
// UNSUPPORTED: hwasan
85
//
96
// UNSUPPORTED: darwin
107

@@ -25,4 +22,4 @@ int main(int argc, char *argv[]) {
2522
return 0;
2623
}
2724

28-
// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 4 byte(s) leaked in 1 allocation(s)
25+
// CHECK: SUMMARY: {{(.*)}}Sanitizer: 4 byte(s) leaked in 1 allocation(s)

compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 %run %t foo 2>&1 | FileCheck %s
44
// RUN: %env_lsan_opts=use_stacks=0:use_registers=0 %run %t 2>&1 | FileCheck %s
55

6-
// Fixme: remove once test passes with hwasan
7-
// UNSUPPORTED: hwasan
8-
//
96
// UNSUPPORTED: darwin
107

118
#include <assert.h>
@@ -25,12 +22,12 @@ int main(int argc, char *argv[]) {
2522
// CHECK: Test alloc:
2623

2724
assert(__lsan_do_recoverable_leak_check() == 1);
28-
// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte
25+
// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte
2926

3027
// Test that we correctly reset chunk tags.
3128
p = 0;
3229
assert(__lsan_do_recoverable_leak_check() == 1);
33-
// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1360 byte
30+
// CHECK: SUMMARY: {{.*}}Sanitizer: 1360 byte
3431

3532
_exit(0);
3633
}

compiler-rt/test/lsan/TestCases/suppressions_default.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// RUN: %clangxx_lsan %s -o %t
22
// RUN: %env_lsan_opts=use_registers=0:use_stacks=0 not %run %t 2>&1 | FileCheck %s
33

4-
// Fixme: remove once test passes with hwasan
5-
// UNSUPPORTED: hwasan
6-
74
#include <stdio.h>
85
#include <stdlib.h>
96

@@ -27,4 +24,4 @@ int main() {
2724
}
2825
// CHECK: Suppressions used:
2926
// CHECK: 1 666 *LSanTestLeakingFunc*
30-
// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
27+
// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)

compiler-rt/test/lsan/TestCases/suppressions_file.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// RUN: %clangxx_lsan %s -o %t
22

3-
// Fixme: remove once test passes with hwasan
4-
// UNSUPPORTED: hwasan
5-
63
// RUN: rm -f %t.supp
74
// RUN: touch %t.supp
85
// RUN: %push_to_device %t.supp %device_rundir/%t.supp
@@ -39,6 +36,6 @@ int main() {
3936
}
4037
// CHECK: Suppressions used:
4138
// CHECK: 1 666 *LSanTestLeakingFunc*
42-
// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
39+
// CHECK: SUMMARY: {{.*}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s)
4340

44-
// NOSUPP: SUMMARY: {{(Leak|Address)}}Sanitizer: 2780 byte(s) leaked in 3 allocation(s).
41+
// NOSUPP: SUMMARY: {{.*}}Sanitizer: 2780 byte(s) leaked in 3 allocation(s).

compiler-rt/test/lsan/TestCases/swapcontext.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// We can't unwind stack if we're running coroutines on heap-allocated
22
// memory. Make sure we don't report these leaks.
33

4-
// Fixme: remove once test passes with hwasan
5-
// UNSUPPORTED: hwasan
6-
74
// RUN: %clangxx_lsan %s -o %t
85
// RUN: %env_lsan_opts= %run %t 2>&1
96
// RUN: %env_lsan_opts= not %run %t foo 2>&1 | FileCheck %s
@@ -44,4 +41,4 @@ int main(int argc, char *argv[]) {
4441
return 0;
4542
}
4643

47-
// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 2664 byte(s) leaked in 1 allocation(s)
44+
// CHECK: SUMMARY: {{.*}}Sanitizer: 2664 byte(s) leaked in 1 allocation(s)

0 commit comments

Comments
 (0)