Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 1 | ; This test should cause the TargetMaterializeAlloca to be invoked |
Geoff Berry | 62c1a1e | 2016-03-02 17:58:31 +0000 | [diff] [blame] | 2 | ; RUN: llc -O0 -fast-isel-abort=1 -verify-machineinstrs -mtriple=arm64-apple-darwin -disable-fp-elim < %s | FileCheck %s |
Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 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 |
Geoff Berry | a533564 | 2016-05-06 16:34:59 +0000 | [diff] [blame] | 17 | ; CHECK: add x29, sp, #16 |
Juergen Ributzka | f82c987 | 2014-10-15 18:58:07 +0000 | [diff] [blame] | 18 | ; CHECK: mov [[REG:x[0-9]+]], sp |
| 19 | ; CHECK-NEXT: add x0, [[REG]], #8 |
Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 20 | %E = alloca %struct.S2Ty, align 4 |
David Blaikie | 79e6c74 | 2015-02-27 19:29:02 +0000 | [diff] [blame] | 21 | %B = getelementptr inbounds %struct.S2Ty, %struct.S2Ty* %E, i32 0, i32 1 |
Tim Northover | 00ed996 | 2014-03-29 10:18:08 +0000 | [diff] [blame] | 22 | call void @takeS1(%struct.S1Ty* %B) |
| 23 | ret void |
| 24 | } |