summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2023-04-12 15:38:44 -0700
committerTom Stellard <tstellar@redhat.com>2023-04-18 18:07:46 -0700
commitc4ac4533ea2b275f92dc440547e1aceb0a5c1866 (patch)
treecda92350dc49184448fb88aad753b4601143dcfb
parentf2b0bf3208246f0b41e2b5dc73bccdc2064b17e2 (diff)
downloadllvm-c4ac4533ea2b275f92dc440547e1aceb0a5c1866.tar.gz
[test][asan] Simplify test
FileCheck is not very useful here. (cherry picked from commit fd2cafbdc480920bcf4eb598788a906ec1f63c41)
-rw-r--r--compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp b/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp
index 102e62f5d4e8..baa18f4a9318 100644
--- a/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp
+++ b/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp
@@ -1,9 +1,9 @@
// Check that ASan plays well with easy cases of makecontext/swapcontext.
-// RUN: %clangxx_asan -O0 %s -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -o %t && %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -o %t && %run %t
+// RUN: %clangxx_asan -O3 %s -o %t && %run %t
+// RUN: %clangxx_asan -fsanitize-address-use-after-return=never -O0 %s -o %t && %run %t
+// RUN: %clangxx_asan -fsanitize-address-use-after-return=never -O3 %s -o %t && %run %t
//
// This test is too sublte to try on non-x86 arch for now.
// Android and musl do not support swapcontext.
@@ -76,22 +76,12 @@ int Run(int arg, int mode, char *child_stack) {
int main(int argc, char **argv) {
char stack[kStackSize + 1];
- // CHECK: WARNING: ASan doesn't fully support makecontext/swapcontext
int ret = 0;
ret += Run(argc - 1, 0, stack);
- printf("Test1 passed\n");
- // CHECK: Test1 passed
ret += Run(argc - 1, 1, stack);
- printf("Test2 passed\n");
- // CHECK: Test2 passed
char *heap = new char[kStackSize + 1];
ret += Run(argc - 1, 0, heap);
- printf("Test3 passed\n");
- // CHECK: Test3 passed
ret += Run(argc - 1, 1, heap);
- printf("Test4 passed\n");
- // CHECK: Test4 passed
-
delete [] heap;
return ret;
}