1 // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
2 // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
3 // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
4 // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s --check-prefix=CHECK-%os --check-prefix=CHECK
8 char * volatile x
= new char[10];
11 // CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
12 // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
13 // CHECK: {{READ of size 1 at 0x.* thread T0}}
14 // CHECK: {{ #0 0x.* in main .*use-after-delete.cc:10}}
15 // CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
16 // CHECK: {{freed by thread T0 here:}}
18 // CHECK-Linux: {{ #0 0x.* in operator delete\[\]}}
19 // CHECK-Linux: {{ #1 0x.* in main .*use-after-delete.cc:9}}
21 // CHECK: {{previously allocated by thread T0 here:}}
23 // CHECK-Linux: {{ #0 0x.* in operator new\[\]}}
24 // CHECK-Linux: {{ #1 0x.* in main .*use-after-delete.cc:8}}
26 // CHECK: Shadow byte legend (one shadow byte represents 8 application bytes):
27 // CHECK: Global redzone:
28 // CHECK: ASan internal: