[asan] Fix test to properly handle collisions.

llvm-svn: 253025
This commit is contained in:
Yury Gribov 2015-11-13 10:32:13 +00:00
parent 67ca6edbb1
commit a085297030
1 changed files with 6 additions and 6 deletions

View File

@ -4,13 +4,13 @@
//
// RUN: env ASAN_OPTIONS=halt_on_error=false %run %t 1 10 >1.txt 2>&1
// RUN: FileCheck %s < 1.txt
// RUN: [ $(wc -l < 1.txt) -gt 1 ]
// RUN: [ $(wc -l < 1.txt) -eq 10 ]
// RUN: FileCheck --check-prefix=CHECK-NO-COLLISION %s < 1.txt
//
// RUN: env ASAN_OPTIONS=halt_on_error=false %run %t 10 20 >10.txt 2>&1
// Collisions are unlikely but still possible so we need the ||.
// RUN: env ASAN_OPTIONS=halt_on_error=false %run %t 10 20 >10.txt 2>&1 || true
// This one is racy although _very_ unlikely to fail:
// RUN: FileCheck %s < 10.txt
// This one is racy although very unlikely to fail:
// RUN: [ $(wc -l < 10.txt) -gt 1 ]
// Collisions are highly unlikely but still possible so we need the alternative:
// RUN: FileCheck --check-prefix=CHECK-COLLISION %s < 1.txt || FileCheck --check-prefix=CHECK-NO-COLLISION %s < 1.txt
//
// REQUIRES: stable-runtime
@ -40,7 +40,7 @@ void *run(void *arg) {
for (size_t i = 0; i < niter; ++i) {
random_delay(&seed);
// Expect error collisions here
// CHECK: AddressSanitizer: use-after-poison
// CHECK: ERROR: AddressSanitizer: use-after-poison
volatile int idx = 0;
tmp[idx] = 0;
}