1 // 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 9 10 #include <string.h> 11 int 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}} 16 // CHECK: {{ #0 0x.* in _?main .*stack-overflow.cc:}}[[@LINE-2]] 17 // CHECK: {{Address 0x.* is .* frame <main>}} 18 return res; 19 } 20