]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/asan/TestCases/Linux/clang_gcc_abi.cc
1 // RUN: %clangxx_asan -O0 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s
2 // RUN: %clangxx_asan -O1 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s
3 // RUN: %clangxx_asan -O2 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s
4 // RUN: %clangxx_asan -O3 -x c %s -o %t && not %run %t 2>&1 | FileCheck %s
6 // REQUIRES: arm-target-arch
7 // XFAIL: armv7l-unknown-linux-gnueabihf
11 __attribute__((noinline
))
13 volatile int three
= 3;
14 char * volatile s
= (char *)malloc(three
);
15 // CHECK: #1 0x{{.*}} in boom {{.*}}clang_gcc_abi.cc:[[@LINE-1]]
16 return s
[three
]; //BOOM
19 __attribute__((naked
, noinline
)) void gcc_abi() {
20 // CHECK: #2 0x{{.*}} in gcc_abi {{.*}}clang_gcc_abi.cc:[[@LINE+1]]
21 asm volatile("str fp, [sp, #-8]!\n\t"
22 "str lr, [sp, #4]\n\t"
28 "ldr pc, [sp], #4\n\t"
32 __attribute__((naked
, noinline
)) void clang_abi() {
33 // CHECK: #3 0x{{.*}} in clang_abi {{.*}}clang_gcc_abi.cc:[[@LINE+1]]
34 asm volatile("push {r11, lr}\n\t"
44 // CHECK: #4 0x{{.*}} in main {{.*}}clang_gcc_abi.cc:[[@LINE-1]]