<p dir="ltr">Thanks for taking care of this!</p>
<p dir="ltr">On Nov 6, 2013 6:06 AM, "Alexander Potapenko" <<a href="mailto:glider@google.com">glider@google.com</a>> wrote:<br>
><br>
> Author: glider<br>
> Date: Wed Nov  6 08:00:37 2013<br>
> New Revision: 194150<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=194150&view=rev">http://llvm.org/viewvc/llvm-project?rev=194150&view=rev</a><br>
> Log:<br>
> [ASan] Use OS-specific matches in the malloc_context_size.cc lit test.<br>
><br>
> The top stack frames for operator new and operator delete are different on Linux and Darwin.<br>
><br>
> Modified:<br>
>     compiler-rt/trunk/lib/asan/lit_tests/TestCases/malloc_context_size.cc<br>
><br>
> Modified: compiler-rt/trunk/lib/asan/lit_tests/TestCases/malloc_context_size.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/malloc_context_size.cc?rev=194150&r1=194149&r2=194150&view=diff">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/lit_tests/TestCases/malloc_context_size.cc?rev=194150&r1=194149&r2=194150&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/lib/asan/lit_tests/TestCases/malloc_context_size.cc (original)<br>
> +++ compiler-rt/trunk/lib/asan/lit_tests/TestCases/malloc_context_size.cc Wed Nov  6 08:00:37 2013<br>
> @@ -1,18 +1,26 @@<br>
>  // RUN: %clangxx_asan -O0 %s -o %t<br>
> -// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %t 2>&1 | FileCheck %s<br>
> -// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %t 2>&1 | FileCheck %s<br>
> -// RUN: ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=0 not %t 2>&1 | FileCheck %s<br>
> -// RUN: ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=1 not %t 2>&1 | FileCheck %s<br>
> +// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=0 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os<br>
> +// RUN: ASAN_OPTIONS=malloc_context_size=0:fast_unwind_on_malloc=1 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os<br>
> +// RUN: ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=0 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os<br>
> +// RUN: ASAN_OPTIONS=malloc_context_size=1:fast_unwind_on_malloc=1 not %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os<br>
><br>
>  int main() {<br>
>    char *x = new char[20];<br>
>    delete[] x;<br>
>    return x[0];<br>
> -  // CHECK: freed by thread T{{.*}} here:<br>
> -  // CHECK-NEXT: #0 0x{{.*}} in operator delete[]<br>
> +  // We need to keep duplicate lines with different 'CHECK-%os' prefixes,<br>
> +  // otherwise FileCheck barks on missing 'CHECK-%os' before 'CHECK-%os-NEXT'.<br>
> +<br>
> +  // CHECK-Linux: freed by thread T{{.*}} here:<br>
> +  // CHECK-Linux-NEXT: #0 0x{{.*}} in operator delete[]<br>
> +  // CHECK-Darwin: freed by thread T{{.*}} here:<br>
> +  // CHECK-Darwin-NEXT: #0 0x{{.*}} in wrap__ZdaPv<br>
>    // CHECK-NOT: #1 0x{{.*}}<br>
> -  // CHECK: previously allocated by thread T{{.*}} here:<br>
> -  // CHECK-NEXT: #0 0x{{.*}} in operator new[]<br>
> +<br>
> +  // CHECK-Linux: previously allocated by thread T{{.*}} here:<br>
> +  // CHECK-Linux-NEXT: #0 0x{{.*}} in operator new[]<br>
> +  // CHECK-Darwin: previously allocated by thread T{{.*}} here:<br>
> +  // CHECK-Darwin-NEXT: #0 0x{{.*}} in wrap__Znam<br>
>    // CHECK-NOT: #1 0x{{.*}}<br>
><br>
>    // CHECK: SUMMARY: AddressSanitizer: heap-use-after-free</p>
<p dir="ltr">Looks like this line should also be duplicated for CHECK-Linux and CHECK-Darwin.</p>
<p dir="ltr">><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</p>