Move MSan lit-tests under test/msan
[blocksruntime.git] / lib / asan / lit_tests / TestCases / partial_right.cc
bloba000a913d6bee6e6d25fea2b508e54365bf29c63
1 // RUN: %clangxx_asan -O0 %s -o %t && not %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_asan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
3 // RUN: %clangxx_asan -O2 %s -o %t && not %t 2>&1 | FileCheck %s
4 // RUN: %clangxx_asan -O3 %s -o %t && not %t 2>&1 | FileCheck %s
6 #include <stdlib.h>
7 int main(int argc, char **argv) {
8 volatile int *x = (int*)malloc(2*sizeof(int) + 2);
9 int res = x[2]; // BOOOM
10 // CHECK: {{READ of size 4 at 0x.* thread T0}}
11 // CHECK: [[ADDR:0x[01-9a-fa-f]+]] is located 0 bytes to the right of {{.*}}-byte region [{{.*}},{{.*}}[[ADDR]])
12 return res;