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