1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py 2# RUN: llc -mtriple thumbv7-apple-ios -run-pass none -o - %s | FileCheck %s 3# This test ensures that the MIR parser parses the bundled machine instructions 4# and 'internal' register flags correctly. 5 6--- | 7 8 define i32 @test1(i32 %a) { 9 entry: 10 %cmp = icmp sgt i32 %a, -78 11 %. = zext i1 %cmp to i32 12 ret i32 %. 13 } 14 15 define i32 @test2(i32 %a) { 16 entry: 17 %cmp = icmp sgt i32 %a, -78 18 %. = zext i1 %cmp to i32 19 ret i32 %. 20 } 21 22... 23--- 24name: test1 25tracksRegLiveness: true 26liveins: 27 - { reg: '$r0' } 28body: | 29 bb.0.entry: 30 liveins: $r0 31 ; CHECK-LABEL: name: test1 32 ; CHECK: liveins: $r0 33 ; CHECK: $r1 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg 34 ; CHECK: t2CMNri killed $r0, 78, 14 /* CC::al */, $noreg, implicit-def $cpsr 35 ; CHECK: BUNDLE implicit-def dead $itstate, implicit-def $r1, implicit killed $cpsr { 36 ; CHECK: t2IT 12, 8, implicit-def $itstate 37 ; CHECK: $r1 = t2MOVi 1, 12 /* CC::gt */, killed $cpsr, $noreg, implicit internal killed $itstate 38 ; CHECK: } 39 ; CHECK: $r0 = tMOVr killed $r1, 14 /* CC::al */, $noreg 40 ; CHECK: tBX_RET 14 /* CC::al */, $noreg, implicit killed $r0 41 $r1 = t2MOVi 0, 14, _, _ 42 t2CMNri killed $r0, 78, 14, _, implicit-def $cpsr 43 BUNDLE implicit-def dead $itstate, implicit-def $r1, implicit killed $cpsr { 44 t2IT 12, 8, implicit-def $itstate 45 $r1 = t2MOVi 1, 12, killed $cpsr, _, implicit internal killed $itstate 46 } 47 $r0 = tMOVr killed $r1, 14, _ 48 tBX_RET 14, _, implicit killed $r0 49... 50--- 51name: test2 52tracksRegLiveness: true 53liveins: 54 - { reg: '$r0' } 55body: | 56 bb.0.entry: 57 liveins: $r0 58 59 ; Verify that the next machine instruction can be on the same line as 60 ; '{' or '}'. 61 62 ; CHECK-LABEL: name: test2 63 ; CHECK: liveins: $r0 64 ; CHECK: $r1 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg 65 ; CHECK: t2CMNri killed $r0, 78, 14 /* CC::al */, $noreg, implicit-def $cpsr 66 ; CHECK: BUNDLE implicit-def dead $itstate, implicit-def $r1, implicit killed $cpsr { 67 ; CHECK: t2IT 12, 8, implicit-def $itstate 68 ; CHECK: $r1 = t2MOVi 1, 12 /* CC::gt */, killed $cpsr, $noreg, implicit internal killed $itstate 69 ; CHECK: } 70 ; CHECK: $r0 = tMOVr killed $r1, 14 /* CC::al */, $noreg 71 ; CHECK: tBX_RET 14 /* CC::al */, $noreg, implicit killed $r0 72 $r1 = t2MOVi 0, 14, _, _ 73 t2CMNri killed $r0, 78, 14, _, implicit-def $cpsr 74 BUNDLE implicit-def dead $itstate, implicit-def $r1, implicit killed $cpsr { t2IT 12, 8, implicit-def $itstate 75 $r1 = t2MOVi 1, 12, killed $cpsr, _, internal implicit killed $itstate 76 } $r0 = tMOVr killed $r1, 14, _ 77 tBX_RET 14, _, implicit killed $r0 78... 79