1# RUN: llc -march=x86-64 -run-pass none -o - %s | FileCheck %s
2# This test ensures that the MIR parser parses variable sized stack objects
3# correctly.
4
5--- |
6
7  define i32 @test(i32 %a) {
8  entry:
9    %b = alloca i32
10    %x = alloca i64
11    %y = alloca i32, i32 %a
12    store i32 %a, i32* %b
13    store i64 2, i64* %x
14    %c = load i32, i32* %b
15    ret i32 %c
16  }
17
18...
19---
20name:            test
21frameInfo:
22  stackSize:       24
23  offsetAdjustment: -16
24  maxAlignment:    8
25  adjustsStack:    true
26# CHECK: stack:
27# CHECK-NEXT: - { id: 0, name: '', type: default, offset: -20, size: 4, alignment: 4,
28# CHECK-NEXT:  callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' }
29# CHECK-NEXT: - { id: 1, name: '', type: default, offset: -32, size: 8, alignment: 8,
30# CHECK-NEXT:  callee-saved-register: '', di-variable: '', di-expression: '', di-location: '' }
31# CHECK-NEXT: - { id: 2, name: y, type: variable-sized, offset: -32, alignment: 1,
32stack:
33  - { id: 0, offset: -20, size: 4, alignment: 4 }
34  - { id: 1, offset: -32, size: 8, alignment: 8 }
35  - { id: 2, name: y, type: variable-sized, offset: -32, alignment: 1 }
36body: |
37  bb.0.entry:
38    MOV32mr %rsp, 1, _, -4, _, %edi
39    MOV64mi32 %rsp, 1, _, -16, _, 2
40    %eax = MOV32rm %rsp, 1, _, -4, _
41    RETQ %eax
42...
43