[compiler-rt] r253025 - [asan] Fix test to properly handle collisions.

Alexey Samsonov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 11:46:18 PST 2015


On Fri, Nov 13, 2015 at 2:32 AM, Yury Gribov via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: ygribov
> Date: Fri Nov 13 04:32:13 2015
> New Revision: 253025
>
> URL: http://llvm.org/viewvc/llvm-project?rev=253025&view=rev
> Log:
> [asan] Fix test to properly handle collisions.
>
> Modified:
>     compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-torture.cc
>
> Modified:
> compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-torture.cc
> URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-torture.cc?rev=253025&r1=253024&r2=253025&view=diff
>
> ==============================================================================
> --- compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-torture.cc
> (original)
> +++ compiler-rt/trunk/test/asan/TestCases/Linux/halt_on_error-torture.cc
> Fri Nov 13 04:32:13 2015
> @@ -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
>

^^
Consider using %env_asan_opts here.


> +// 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;
>    }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>



-- 
Alexey Samsonov
vonosmas at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151113/9e044e26/attachment.html>


More information about the llvm-commits mailing list