[llvm-branch-commits] [compiler-rt] c4ac453 - [test][asan] Simplify test
Tom Stellard via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Apr 18 18:08:16 PDT 2023
Author: Vitaly Buka
Date: 2023-04-18T18:07:46-07:00
New Revision: c4ac4533ea2b275f92dc440547e1aceb0a5c1866
URL: https://github.com/llvm/llvm-project/commit/c4ac4533ea2b275f92dc440547e1aceb0a5c1866
DIFF: https://github.com/llvm/llvm-project/commit/c4ac4533ea2b275f92dc440547e1aceb0a5c1866.diff
LOG: [test][asan] Simplify test
FileCheck is not very useful here.
(cherry picked from commit fd2cafbdc480920bcf4eb598788a906ec1f63c41)
Added:
Modified:
compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp
Removed:
################################################################################
diff --git a/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp b/compiler-rt/test/asan/TestCases/Linux/swapcontext_test.cpp
index 102e62f5d4e8a..baa18f4a9318e 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;
}
More information about the llvm-branch-commits
mailing list