1 ; RUN: llc -mtriple=arm-linux-gnueabihf < %s | FileCheck %s
3 %struct4bytes = type { i32 }
4 %struct8bytes8align = type { i64 }
5 %struct12bytes = type { i32, i32, i32 }
7 declare void @useIntPtr(%struct4bytes*)
8 declare void @useLong(i64)
9 declare void @usePtr(%struct8bytes8align*)
14 define void @foo1(i32 %a, %struct12bytes* byval %b, i64 %c) {
16 ; CHECK: sub sp, sp, #12
17 ; CHECK: push {r11, lr}
18 ; CHECK: sub sp, sp, #4
19 ; CHECK: add [[SCRATCH:r[0-9]+]], sp, #12
20 ; CHECK: stm [[SCRATCH]], {r1, r2, r3}
21 ; CHECK: ldr r0, [sp, #24]
22 ; CHECK: ldr r1, [sp, #28]
24 ; CHECK: pop {r11, lr}
25 ; CHECK: add sp, sp, #12
27 call void @useLong(i64 %c)
33 define void @foo2(i32 %a, %struct8bytes8align* byval %b) {
35 ; CHECK: sub sp, sp, #8
36 ; CHECK: push {r11, lr}
37 ; CHECK: add r0, sp, #8
38 ; CHECK-DAG: str r3, [sp, #12]
39 ; CHECK-DAG: str r2, [sp, #8]
41 ; CHECK: pop {r11, lr}
42 ; CHECK: add sp, sp, #8
44 call void @usePtr(%struct8bytes8align* %b)
50 define void @foo3(%struct8bytes8align* byval %a, %struct4bytes* byval %b) {
52 ; CHECK: sub sp, sp, #16
53 ; CHECK: push {r11, lr}
54 ; CHECK: add [[SCRATCH:r[0-9]+]], sp, #8
55 ; CHECK: stm [[SCRATCH]], {r0, r1, r2}
56 ; CHECK: add r0, sp, #8
58 ; CHECK: pop {r11, lr}
59 ; CHECK: add sp, sp, #16
61 call void @usePtr(%struct8bytes8align* %a)
67 define void @foo4(%struct4bytes* byval %a, %struct8bytes8align* byval %b) {
69 ; CHECK: sub sp, sp, #16
70 ; CHECK: push {r11, lr}
71 ; CHECK: str r0, [sp, #8]
72 ; CHECK: add r0, sp, #16
73 ; CHECK-DAG: str r3, [sp, #20]
74 ; CHECK-DAG: str r2, [sp, #16]
76 ; CHECK: pop {r11, lr}
77 ; CHECK: add sp, sp, #16
80 call void @usePtr(%struct8bytes8align* %b)
87 define void @foo5(%struct8bytes8align* byval %a, %struct4bytes* byval %b, %struct4bytes* byval %c) {
89 ; CHECK: sub sp, sp, #16
90 ; CHECK: push {r11, lr}
91 ; CHECK: add [[SCRATCH:r[0-9]+]], sp, #8
92 ; CHECK: stm [[SCRATCH]], {r0, r1, r2, r3}
93 ; CHECK: add r0, sp, #8
95 ; CHECK: pop {r11, lr}
96 ; CHECK: add sp, sp, #16
99 call void @usePtr(%struct8bytes8align* %a)
105 define void @foo6(i32 %a, i32 %b, i32 %c, %struct8bytes8align* byval %d) {
107 ; CHECK: push {r11, lr}
108 ; CHECK: add r0, sp, #8
110 ; CHECK: pop {r11, lr}
113 call void @usePtr(%struct8bytes8align* %d)