summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/output_tests/stack-overflow.cc
blob: 2a0a1383e4918c42ea81cab5aa4aae7eb47c8186 (plain)
1
2
3
4
5
6
7
8
9
10
11
#include <string.h>
int main(int argc, char **argv) {
  char x[10];
  memset(x, 0, 10);
  int res = x[argc * 10];  // BOOOM
  return res;
}

// CHECK: {{READ of size 1 at 0x.* thread T0}}
// CHECK: {{    #0 0x.* in main .*stack-overflow.cc:5}}
// CHECK: {{Address 0x.* is .* frame <main>}}
OpenPOWER on IntegriCloud