blob: 2c64ec6635d67cb39e81767676dc80ed898a03d8 [file] [log] [blame]
Alexey Samsonov9fe914b2012-08-15 11:26:57 +00001// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
2// RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
3// RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
4// RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
5// RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
6// RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
7// RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
8// RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
Alexey Samsonov60164862012-08-15 08:29:17 +00009
10#include <string.h>
11int main(int argc, char **argv) {
12 char x[10];
13 memset(x, 0, 10);
14 int res = x[argc * 10]; // BOOOM
15 // CHECK: {{READ of size 1 at 0x.* thread T0}}
Alexey Samsonov9fe914b2012-08-15 11:26:57 +000016 // CHECK: {{ #0 0x.* in main .*stack-overflow.cc:14}}
Alexey Samsonov60164862012-08-15 08:29:17 +000017 // CHECK: {{Address 0x.* is .* frame <main>}}
18 return res;
19}