blob: 8bbee16232ec76bda71d72a3e9c098aec652b090 [file] [log] [blame]
Tim Northover00ed9962014-03-29 10:18:08 +00001; This test should cause the TargetMaterializeAlloca to be invoked
2; RUN: llc < %s -O0 -fast-isel-abort -mtriple=arm64-apple-darwin | FileCheck %s
3
4%struct.S1Ty = type { i64 }
5%struct.S2Ty = type { %struct.S1Ty, %struct.S1Ty }
6
7define void @takeS1(%struct.S1Ty* %V) nounwind {
8entry:
9 %V.addr = alloca %struct.S1Ty*, align 8
10 store %struct.S1Ty* %V, %struct.S1Ty** %V.addr, align 8
11 ret void
12}
13
14define void @main() nounwind {
15entry:
16; CHECK: main
17; CHECK: mov x[[REG:[0-9]+]], sp
18; CHECK-NEXT: orr x[[REG1:[0-9]+]], xzr, #0x8
19; CHECK-NEXT: add x0, x[[REG]], x[[REG1]]
20 %E = alloca %struct.S2Ty, align 4
21 %B = getelementptr inbounds %struct.S2Ty* %E, i32 0, i32 1
22 call void @takeS1(%struct.S1Ty* %B)
23 ret void
24}