]>
git.proxmox.com Git - rustc.git/blob - src/llvm/projects/compiler-rt/lib/asan/lit_tests/large_func_test.cc
1 // RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
2 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
3 // RUN: %clangxx_asan -m64 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
4 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
5 // RUN: %clangxx_asan -m64 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
6 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
7 // RUN: %clangxx_asan -m64 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
8 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
9 // RUN: %clangxx_asan -m32 -O0 %s -o %t && %t 2>&1 | %symbolize > %t.out
10 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
11 // RUN: %clangxx_asan -m32 -O1 %s -o %t && %t 2>&1 | %symbolize > %t.out
12 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
13 // RUN: %clangxx_asan -m32 -O2 %s -o %t && %t 2>&1 | %symbolize > %t.out
14 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
15 // RUN: %clangxx_asan -m32 -O3 %s -o %t && %t 2>&1 | %symbolize > %t.out
16 // RUN: FileCheck %s < %t.out && FileCheck %s --check-prefix=CHECK-%os < %t.out
19 __attribute__((noinline
))
20 static void LargeFunction(int *x
, int zero
) {
32 x
[zero
+ 111]++; // we should report this exact line
46 int main(int argc
, char **argv
) {
47 int *x
= new int[100];
48 LargeFunction(x
, argc
- 1);
52 // CHECK: {{.*ERROR: AddressSanitizer heap-buffer-overflow on address}}
53 // CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
54 // CHECK: {{READ of size 4 at 0x.* thread T0}}
56 // atos incorrectly extracts the symbol name for the static functions on
58 // CHECK-Linux: {{ #0 0x.* in LargeFunction.*large_func_test.cc:32}}
59 // CHECK-Darwin: {{ #0 0x.* in .*LargeFunction.*large_func_test.cc:32}}
61 // CHECK: {{ #1 0x.* in main .*large_func_test.cc:48}}
62 // CHECK: {{0x.* is located 44 bytes to the right of 400-byte region}}
63 // CHECK: {{allocated by thread T0 here:}}
64 // CHECK: {{ #0 0x.* in operator new.*}}
65 // CHECK: {{ #1 0x.* in main .*large_func_test.cc:47}}