1 // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_asan -O1 %s -o %t && not %run %t 2>&1 | FileCheck %s
3 // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
4 // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s
7 int main(int argc
, char **argv
) {
10 int res
= x
[argc
* 10]; // BOOOM
11 // CHECK: {{READ of size 1 at 0x.* thread T0}}
12 // CHECK: {{ #0 0x.* in main .*stack-buffer-overflow.cc:}}[[@LINE-2]]
13 // CHECK: {{Address 0x.* is located in stack of thread T0 at offset}}
14 // CHECK-NEXT: in{{.*}}main{{.*}}stack-buffer-overflow.cc