2 // https://code.google.com/p/address-sanitizer/issues/detail?id=183
4 // RUN: %clangxx_asan -O2 %s -o %t
5 // RUN: not %run %t 12 2>&1 | FileCheck %s
6 // RUN: not %run %t 100 2>&1 | FileCheck %s
7 // RUN: not %run %t 10000 2>&1 | FileCheck %s
13 int main(int argc
, char *argv
[]) {
14 fprintf(stderr
, "main\n");
16 memset(x
, 0, sizeof(x
[0]) * 5);
17 int index
= atoi(argv
[1]);
18 unsigned res
= x
[index
];
20 // CHECK-NOT: CHECK failed
22 return (res
% 10) + 1;