1 # RUN: llc -march=x86-64 -enable-shrink-wrap=true -start-after shrink-wrap -stop-after shrink-wrap -o /dev/null %s | FileCheck %s
2 # This test ensures that the MIR parser parses the save and restore points in
3 # the machine frame info correctly.
7 define i32 @foo(i32 %a, i32 %b) {
9 %tmp = alloca i32, align 4
10 %tmp2 = icmp slt i32 %a, %b
11 br i1 %tmp2, label %true, label %false
14 store i32 %a, i32* %tmp, align 4
15 %tmp4 = call i32 @doSomething(i32 0, i32* %tmp)
19 %tmp.0 = phi i32 [ %tmp4, %true ], [ %a, %entry ]
23 declare i32 @doSomething(i32, i32*)
28 tracksRegLiveness: true
33 # CHECK: savePoint: '%bb.2.true'
34 # CHECK-NEXT: restorePoint: '%bb.2.true'
39 savePoint: '%bb.2.true'
40 restorePoint: '%bb.2.true'
42 - { id: 0, name: tmp, offset: 0, size: 4, alignment: 4 }
45 successors: [ '%bb.2.true', '%bb.1' ]
46 liveins: [ '%edi', '%esi' ]
49 - 'CMP32rr %eax, killed %esi, implicit-def %eflags'
50 - 'JL_1 %bb.2.true, implicit killed %eflags'
52 successors: [ '%bb.3.false' ]
58 successors: [ '%bb.3.false' ]
61 - 'MOV32mr %stack.0.tmp, 1, _, 0, _, killed %eax'
62 - 'ADJCALLSTACKDOWN64 0, 0, implicit-def %rsp, implicit-def dead %eflags, implicit %rsp'
63 - '%rsi = LEA64r %stack.0.tmp, 1, _, 0, _'
64 - '%edi = MOV32r0 implicit-def dead %eflags'
65 - 'CALL64pcrel32 @doSomething, csr_64, implicit %rsp, implicit %edi, implicit %rsi, implicit-def %rsp, implicit-def %eax'
66 - 'ADJCALLSTACKUP64 0, 0, implicit-def %rsp, implicit-def dead %eflags, implicit %rsp'