Move MSan lit-tests under test/msan
[blocksruntime.git] / lib / asan / lit_tests / TestCases / deep_tail_call.cc
blob2e7aa8e0208f87a7157a2069fb3518ad4366a7bd
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 // CHECK: AddressSanitizer: global-buffer-overflow
7 int global[10];
8 // CHECK: {{#0.*call4}}
9 void __attribute__((noinline)) call4(int i) { global[i+10]++; }
10 // CHECK: {{#1.*call3}}
11 void __attribute__((noinline)) call3(int i) { call4(i); }
12 // CHECK: {{#2.*call2}}
13 void __attribute__((noinline)) call2(int i) { call3(i); }
14 // CHECK: {{#3.*call1}}
15 void __attribute__((noinline)) call1(int i) { call2(i); }
16 // CHECK: {{#4.*main}}
17 int main(int argc, char **argv) {
18 call1(argc);
19 return global[0];