1 ; RUN: llc -mtriple=armv7-linux < %s | FileCheck %s
3 declare arm_aapcscc void @addrof_i32(ptr)
4 declare arm_aapcscc void @addrof_i64(ptr)
6 define arm_aapcscc void @simple(i32, i32, i32, i32, i32 %x) {
9 store i32 %x, ptr %x.addr
10 call void @addrof_i32(ptr %x.addr)
14 ; CHECK-LABEL: simple:
15 ; CHECK: push {r11, lr}
16 ; CHECK: add r0, sp, #8
17 ; CHECK: bl addrof_i32
18 ; CHECK: pop {r11, pc}
21 ; We need to load %x before calling addrof_i32 now because it could mutate %x in
24 define arm_aapcscc i32 @use_arg(i32, i32, i32, i32, i32 %x) {
27 store i32 %x, ptr %x.addr
28 call void @addrof_i32(ptr %x.addr)
32 ; CHECK-LABEL: use_arg:
33 ; CHECK: push {[[csr:[^ ]*]], lr}
34 ; CHECK: add r0, sp, #8
35 ; CHECK: ldr [[csr]], [sp, #8]
36 ; CHECK: bl addrof_i32
37 ; CHECK: mov r0, [[csr]]
38 ; CHECK: pop {[[csr]], pc}
41 define arm_aapcscc i64 @split_i64(i32, i32, i32, i32, i64 %x) {
43 %x.addr = alloca i64, align 4
44 store i64 %x, ptr %x.addr, align 4
45 call void @addrof_i64(ptr %x.addr)
49 ; CHECK-LABEL: split_i64:
50 ; CHECK: push {r4, r5, r11, lr}
51 ; CHECK: sub sp, sp, #8
52 ; CHECK: ldr r4, [sp, #28]
54 ; CHECK: ldr r5, [sp, #24]
55 ; CHECK: str r4, [sp, #4]
57 ; CHECK: bl addrof_i64
60 ; CHECK: add sp, sp, #8
61 ; CHECK: pop {r4, r5, r11, pc}