1 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=DARWIN-ARM
2 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=armv7-linux-gnueabi | FileCheck %s --check-prefix=LINUX-ARM
3 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=DARWIN-THUMB2
4 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=thumbv7-linux-gnueabi | FileCheck %s --check-prefix=LINUX-THUMB2
6 define ptr @frameaddr_index0() nounwind {
8 ; DARWIN-ARM-LABEL: frameaddr_index0:
9 ; DARWIN-ARM: push {r7, lr}
10 ; DARWIN-ARM: mov r7, sp
11 ; DARWIN-ARM: mov r0, r7
13 ; DARWIN-THUMB2-LABEL: frameaddr_index0:
14 ; DARWIN-THUMB2: push {r7, lr}
15 ; DARWIN-THUMB2: mov r7, sp
16 ; DARWIN-THUMB2: mov r0, r7
18 ; LINUX-ARM-LABEL: frameaddr_index0:
19 ; LINUX-ARM: push {r11, lr}
20 ; LINUX-ARM: mov r11, sp
21 ; LINUX-ARM: mov r0, r11
23 ; LINUX-THUMB2-LABEL: frameaddr_index0:
24 ; LINUX-THUMB2: push {r7, lr}
25 ; LINUX-THUMB2: mov r7, sp
26 ; LINUX-THUMB2: mov r0, r7
28 %0 = call ptr @llvm.frameaddress(i32 0)
32 define ptr @frameaddr_index1() nounwind {
34 ; DARWIN-ARM-LABEL: frameaddr_index1:
35 ; DARWIN-ARM: push {r7, lr}
36 ; DARWIN-ARM: mov r7, sp
37 ; DARWIN-ARM: ldr r0, [r7]
39 ; DARWIN-THUMB2-LABEL: frameaddr_index1:
40 ; DARWIN-THUMB2: push {r7, lr}
41 ; DARWIN-THUMB2: mov r7, sp
42 ; DARWIN-THUMB2: ldr r0, [r7]
44 ; LINUX-ARM-LABEL: frameaddr_index1:
45 ; LINUX-ARM: push {r11, lr}
46 ; LINUX-ARM: mov r11, sp
47 ; LINUX-ARM: ldr r0, [r11]
49 ; LINUX-THUMB2-LABEL: frameaddr_index1:
50 ; LINUX-THUMB2: push {r7, lr}
51 ; LINUX-THUMB2: mov r7, sp
52 ; LINUX-THUMB2: mov r0, r7
53 ; LINUX-THUMB2: ldr r0, [r0]
55 %0 = call ptr @llvm.frameaddress(i32 1)
59 define ptr @frameaddr_index3() nounwind {
61 ; DARWIN-ARM-LABEL: frameaddr_index3:
62 ; DARWIN-ARM: push {r7, lr}
63 ; DARWIN-ARM: mov r7, sp
64 ; DARWIN-ARM: ldr r0, [r7]
65 ; DARWIN-ARM: ldr r0, [r0]
66 ; DARWIN-ARM: ldr r0, [r0]
68 ; DARWIN-THUMB2-LABEL: frameaddr_index3:
69 ; DARWIN-THUMB2: push {r7, lr}
70 ; DARWIN-THUMB2: mov r7, sp
71 ; DARWIN-THUMB2: ldr r0, [r7]
72 ; DARWIN-THUMB2: ldr r0, [r0]
73 ; DARWIN-THUMB2: ldr r0, [r0]
75 ; LINUX-ARM-LABEL: frameaddr_index3:
76 ; LINUX-ARM: push {r11, lr}
77 ; LINUX-ARM: mov r11, sp
78 ; LINUX-ARM: ldr r0, [r11]
79 ; LINUX-ARM: ldr r0, [r0]
80 ; LINUX-ARM: ldr r0, [r0]
82 ; LINUX-THUMB2-LABEL: frameaddr_index3:
83 ; LINUX-THUMB2: push {r7, lr}
84 ; LINUX-THUMB2: mov r7, sp
85 ; LINUX-THUMB2: mov r0, r7
86 ; LINUX-THUMB2: ldr r0, [r0]
87 ; LINUX-THUMB2: ldr r0, [r0]
88 ; LINUX-THUMB2: ldr r0, [r0]
90 %0 = call ptr @llvm.frameaddress(i32 3)
94 declare ptr @llvm.frameaddress(i32) nounwind readnone