Skip to content

Commit c4ac453

Browse files
vitalybukatstellar
authored andcommitted
[test][asan] Simplify test
FileCheck is not very useful here. (cherry picked from commit fd2cafb)
1 parent f2b0bf3 commit c4ac453

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// Check that ASan plays well with easy cases of makecontext/swapcontext.
22

3-
// RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
4-
// RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
5-
// RUN: %clangxx_asan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s
6-
// RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s
3+
// RUN: %clangxx_asan -O0 %s -o %t && %run %t
4+
// RUN: %clangxx_asan -O3 %s -o %t && %run %t
5+
// RUN: %clangxx_asan -fsanitize-address-use-after-return=never -O0 %s -o %t && %run %t
6+
// RUN: %clangxx_asan -fsanitize-address-use-after-return=never -O3 %s -o %t && %run %t
77
//
88
// This test is too sublte to try on non-x86 arch for now.
99
// Android and musl do not support swapcontext.
@@ -76,22 +76,12 @@ int Run(int arg, int mode, char *child_stack) {
7676

7777
int main(int argc, char **argv) {
7878
char stack[kStackSize + 1];
79-
// CHECK: WARNING: ASan doesn't fully support makecontext/swapcontext
8079
int ret = 0;
8180
ret += Run(argc - 1, 0, stack);
82-
printf("Test1 passed\n");
83-
// CHECK: Test1 passed
8481
ret += Run(argc - 1, 1, stack);
85-
printf("Test2 passed\n");
86-
// CHECK: Test2 passed
8782
char *heap = new char[kStackSize + 1];
8883
ret += Run(argc - 1, 0, heap);
89-
printf("Test3 passed\n");
90-
// CHECK: Test3 passed
9184
ret += Run(argc - 1, 1, heap);
92-
printf("Test4 passed\n");
93-
// CHECK: Test4 passed
94-
9585
delete [] heap;
9686
return ret;
9787
}

0 commit comments

Comments
 (0)