From d7f0361ab11a060931eb3ee09f342ec3c2265d31 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Thu, 21 Sep 2017 00:06:08 +0000 Subject: [PATCH] [asan] Remove "rm -f" in tests where it was needed only because of >> llvm-svn: 313843 --- .../TestCases/Posix/halt_on_error-signals.c | 5 ++--- .../TestCases/Posix/halt_on_error-torture.cc | 19 ++++++++----------- .../Posix/halt_on_error_suppress_equal_pcs.cc | 5 ++--- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/compiler-rt/test/asan/TestCases/Posix/halt_on_error-signals.c b/compiler-rt/test/asan/TestCases/Posix/halt_on_error-signals.c index 6bdf30bb4dd3..931ab8635a15 100644 --- a/compiler-rt/test/asan/TestCases/Posix/halt_on_error-signals.c +++ b/compiler-rt/test/asan/TestCases/Posix/halt_on_error-signals.c @@ -2,10 +2,9 @@ // // RUN: %clang_asan -fsanitize-recover=address -pthread %s -o %t // -// RUN: rm -f %t.log -// RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false %run %t 100 >>%t.log 2>&1 || true +// RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false %run %t 100 >%t.log 2>&1 || true // Collision will almost always get triggered but we still need to check the unlikely case: -// RUN: FileCheck --check-prefix=CHECK-COLLISION %s < %t.log || FileCheck --check-prefix=CHECK-NO-COLLISION %s < %t.log +// RUN: FileCheck --check-prefix=CHECK-COLLISION %s <%t.log || FileCheck --check-prefix=CHECK-NO-COLLISION %s <%t.log #define _SVID_SOURCE 1 // SA_NODEFER diff --git a/compiler-rt/test/asan/TestCases/Posix/halt_on_error-torture.cc b/compiler-rt/test/asan/TestCases/Posix/halt_on_error-torture.cc index 829568e2682b..220bbff850c7 100644 --- a/compiler-rt/test/asan/TestCases/Posix/halt_on_error-torture.cc +++ b/compiler-rt/test/asan/TestCases/Posix/halt_on_error-torture.cc @@ -2,21 +2,18 @@ // // RUN: %clangxx_asan -fsanitize-recover=address -pthread %s -o %t // -// RUN: rm -f 1.txt -// RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false %run %t 1 10 >>1.txt 2>&1 -// RUN: FileCheck %s < 1.txt -// RUN: grep 'ERROR: AddressSanitizer: use-after-poison' 1.txt | count 10 -// RUN: FileCheck --check-prefix=CHECK-NO-COLLISION %s < 1.txt +// RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false %run %t 1 10 >%t.log 2>&1 +// RUN: FileCheck %s <%t.log +// RUN: grep 'ERROR: AddressSanitizer: use-after-poison' %t.log | count 10 +// RUN: FileCheck --check-prefix=CHECK-NO-COLLISION %s <%t.log // // Collisions are unlikely but still possible so we need the ||. -// RUN: rm -f 10.txt -// RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false:exitcode=0 %run %t 10 20 2>&1 | cat > 10.txt -// RUN: FileCheck --check-prefix=CHECK-COLLISION %s < 10.txt || FileCheck --check-prefix=CHECK-NO-COLLISION %s < 10.txt +// RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false:exitcode=0 %run %t 10 20 >%t.log 2>&1 +// RUN: FileCheck --check-prefix=CHECK-COLLISION %s <%t.log || FileCheck --check-prefix=CHECK-NO-COLLISION %s <%t.log // // Collisions are unlikely but still possible so we need the ||. -// RUN: rm -f 20.txt -// RUN: %env_asan_opts=halt_on_error=false:exitcode=0 %run %t 10 20 2>&1 | cat > 20.txt -// RUN: FileCheck --check-prefix=CHECK-COLLISION %s < 20.txt || FileCheck --check-prefix=CHECK-NO-COLLISION %s < 20.txt +// RUN: %env_asan_opts=halt_on_error=false:exitcode=0 %run %t 10 20 >%t.log 2>&1 +// RUN: FileCheck --check-prefix=CHECK-COLLISION %s <%t.log || FileCheck --check-prefix=CHECK-NO-COLLISION %s <%t.log #include #include diff --git a/compiler-rt/test/asan/TestCases/Posix/halt_on_error_suppress_equal_pcs.cc b/compiler-rt/test/asan/TestCases/Posix/halt_on_error_suppress_equal_pcs.cc index b9d85ef94b23..6b926180cc2f 100644 --- a/compiler-rt/test/asan/TestCases/Posix/halt_on_error_suppress_equal_pcs.cc +++ b/compiler-rt/test/asan/TestCases/Posix/halt_on_error_suppress_equal_pcs.cc @@ -6,8 +6,7 @@ // RUN: %env_asan_opts=halt_on_error=false %run %t 2>&1 | FileCheck %s // // Check that we die after reaching different reports number threshold. -// RUN: rm -f %t1.log -// RUN: %env_asan_opts=halt_on_error=false not %run %t 1 >> %t1.log 2>&1 +// RUN: %env_asan_opts=halt_on_error=false not %run %t 1 >%t1.log 2>&1 // RUN: grep 'ERROR: AddressSanitizer: stack-buffer-overflow' %t1.log | count 25 // // Check suppress_equal_pcs=true behavior is equal to default one. @@ -15,7 +14,7 @@ // // Check suppress_equal_pcs=false behavior isn't equal to default one. // RUN: rm -f %t2.log -// RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false %run %t >> %t2.log 2>&1 +// RUN: %env_asan_opts=halt_on_error=false:suppress_equal_pcs=false %run %t >%t2.log 2>&1 // RUN: grep 'ERROR: AddressSanitizer: stack-buffer-overflow' %t2.log | count 30 #define ACCESS_ARRAY_FIVE_ELEMENTS(array, i) \