1 // RUN: %clangxx_asan -O0 -x c %s -o %t && not %env_asan_opts=fast_unwind_on_malloc=1 %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_asan -O1 -x c %s -o %t && not %env_asan_opts=fast_unwind_on_malloc=1 %run %t 2>&1 | FileCheck %s
3 // RUN: %clangxx_asan -O2 -x c %s -o %t && not %env_asan_opts=fast_unwind_on_malloc=1 %run %t 2>&1 | FileCheck %s
4 // RUN: %clangxx_asan -O3 -x c %s -o %t && not %env_asan_opts=fast_unwind_on_malloc=1 %run %t 2>&1 | FileCheck %s
6 // REQUIRES: (arm-target-arch || armhf-target-arch), fast-unwinder-works
10 __attribute__((noinline
))
12 volatile int three
= 3;
13 char * volatile s
= (char *)malloc(three
);
14 // CHECK: #1 0x{{.*}} in boom {{.*}}clang_gcc_abi.cpp:[[@LINE-1]]
15 return s
[three
]; //BOOM
18 __attribute__((naked
, noinline
)) void gcc_abi() {
19 // CHECK: #2 0x{{.*}} in gcc_abi {{.*}}clang_gcc_abi.cpp:[[@LINE+1]]
20 asm volatile("str fp, [sp, #-8]!\n\t"
21 "str lr, [sp, #4]\n\t"
27 "ldr pc, [sp], #4\n\t"
31 __attribute__((naked
, noinline
)) void clang_abi() {
32 // CHECK: #3 0x{{.*}} in clang_abi {{.*}}clang_gcc_abi.cpp:[[@LINE+1]]
33 asm volatile("push {r11, lr}\n\t"
43 // CHECK: #4 0x{{.*}} in main {{.*}}clang_gcc_abi.cpp:[[@LINE-1]]