b1c078eb6a354d46b7d1f4bb9f4cda288d94db53
[oota-llvm.git] / test / CodeGen / MIR / X86 / stack-object-operands.mir
1 # RUN: llc -march=x86 -start-after machine-sink -stop-after machine-sink -o /dev/null %s | FileCheck %s
2 # This test ensures that the MIR parser parses stack object machine operands
3 # correctly.
4
5 --- |
6
7   define i32 @test(i32 %a) {
8   entry:
9     %b = alloca i32
10     %0 = alloca i32
11     store i32 %a, i32* %b
12     store i32 2, i32* %0
13     %c = load i32, i32* %b
14     ret i32 %c
15   }
16
17 ...
18 ---
19 name:            test
20 isSSA:           true
21 tracksRegLiveness: true
22 registers:
23   - { id: 0, class: gr32 }
24   - { id: 1, class: gr32 }
25 frameInfo:
26   maxAlignment:    4
27 fixedStack:
28   - { id: 0, offset: 0, size: 4, isImmutable: true, isAliased: false }
29 stack:
30   - { id: 0, name: b, size: 4, alignment: 4 }
31   - { id: 1, size: 4, alignment: 4 }
32 body:
33   # CHECK: name: entry
34   # CHECK: instructions:
35   # CHECK-NEXT: - '%0 = MOV32rm %fixed-stack.0, 1, _, 0, _'
36   # CHECK-NEXT: - 'MOV32mr %stack.0.b, 1, _, 0, _, %0'
37   # CHECK-NEXT: - 'MOV32mi %stack.1, 1, _, 0, _, 2'
38   # CHECK-NEXT: - '%1 = MOV32rm %stack.0.b, 1, _, 0, _'
39   - id:          0
40     name:        entry
41     instructions:
42       - '%0 = MOV32rm %fixed-stack.0, 1, _, 0, _'
43       - 'MOV32mr %stack.0.b, 1, _, 0, _, %0'
44       - 'MOV32mi %stack.1, 1, _, 0, _, 2'
45       - '%1 = MOV32rm %stack.0, 1, _, 0, _'
46       - '%eax = COPY %1'
47       - 'RETL %eax'
48 ...