xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/2012-10-18-PR14099-ByvalFrameAddress.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=armv7-linux-gnueabi | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker%struct.s = type { [4 x i32] }
4*9880d681SAndroid Build Coastguard Worker@v = constant %struct.s zeroinitializer;
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdeclare void @f(%struct.s* %p);
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: t:
9*9880d681SAndroid Build Coastguard Workerdefine void @t(i32 %a, %struct.s* byval %s) nounwind {
10*9880d681SAndroid Build Coastguard Workerentry:
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker; Here we need to only check proper start address of restored %s argument.
13*9880d681SAndroid Build Coastguard Worker; CHECK:      sub     sp, sp, #12
14*9880d681SAndroid Build Coastguard Worker; CHECK:      push    {r11, lr}
15*9880d681SAndroid Build Coastguard Worker; CHECK:      sub     sp, sp, #4
16*9880d681SAndroid Build Coastguard Worker; CHECK:      add     r0, sp, #12
17*9880d681SAndroid Build Coastguard Worker; CHECK:      stm     r0, {r1, r2, r3}
18*9880d681SAndroid Build Coastguard Worker; CHECK:      add     r0, sp, #12
19*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: bl f
20*9880d681SAndroid Build Coastguard Worker  call void @f(%struct.s* %s)
21*9880d681SAndroid Build Coastguard Worker  ret void
22*9880d681SAndroid Build Coastguard Worker}
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: caller:
25*9880d681SAndroid Build Coastguard Workerdefine void @caller() {
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard Worker; CHECK:      ldm     r0, {r1, r2, r3}
28*9880d681SAndroid Build Coastguard Worker  call void @t(i32 0, %struct.s* @v);
29*9880d681SAndroid Build Coastguard Worker  ret void
30*9880d681SAndroid Build Coastguard Worker}
31