blob: bdc24aea2144b77405d571412661649458d30369 [file] [log] [blame]
Tim Northover00ed9962014-03-29 10:18:08 +00001; This test should cause the TargetMaterializeAlloca to be invoked
Geoff Berry62c1a1e2016-03-02 17:58:31 +00002; RUN: llc -O0 -fast-isel-abort=1 -verify-machineinstrs -mtriple=arm64-apple-darwin -disable-fp-elim < %s | FileCheck %s
Tim Northover00ed9962014-03-29 10:18:08 +00003
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
Geoff Berrya5335642016-05-06 16:34:59 +000017; CHECK: add x29, sp, #16
Juergen Ributzkaf82c9872014-10-15 18:58:07 +000018; CHECK: mov [[REG:x[0-9]+]], sp
19; CHECK-NEXT: add x0, [[REG]], #8
Tim Northover00ed9962014-03-29 10:18:08 +000020 %E = alloca %struct.S2Ty, align 4
David Blaikie79e6c742015-02-27 19:29:02 +000021 %B = getelementptr inbounds %struct.S2Ty, %struct.S2Ty* %E, i32 0, i32 1
Tim Northover00ed9962014-03-29 10:18:08 +000022 call void @takeS1(%struct.S1Ty* %B)
23 ret void
24}