1 # RUN: llc -mtriple thumbv7-apple-ios -run-pass none -o - %s | FileCheck %s
2 # This test ensures that the MIR parser parses the bundled machine instructions
3 # and 'internal' register flags correctly.
7 define i32 @test1(i32 %a) {
9 %cmp = icmp sgt i32 %a, -78
10 %. = zext i1 %cmp to i32
14 define i32 @test2(i32 %a) {
16 %cmp = icmp sgt i32 %a, -78
17 %. = zext i1 %cmp to i32
24 tracksRegLiveness: true
30 ; CHECK-LABEL: name: test1
31 ; CHECK: $r1 = t2MOVi 0, 14, $noreg, $noreg
32 ; CHECK-NEXT: t2CMNri killed $r0, 78, 14, $noreg, implicit-def $cpsr
33 ; CHECK-NEXT: BUNDLE implicit-def dead $itstate, implicit-def $r1, implicit killed $cpsr {
34 ; CHECK-NEXT: t2IT 12, 8, implicit-def $itstate
35 ; CHECK-NEXT: $r1 = t2MOVi 1, 12, killed $cpsr, $noreg, implicit internal killed $itstate
37 ; CHECK-NEXT: $r0 = tMOVr killed $r1, 14, $noreg
38 ; CHECK-NEXT: tBX_RET 14, $noreg, implicit killed $r0
39 $r1 = t2MOVi 0, 14, _, _
40 t2CMNri killed $r0, 78, 14, _, implicit-def $cpsr
41 BUNDLE implicit-def dead $itstate, implicit-def $r1, implicit killed $cpsr {
42 t2IT 12, 8, implicit-def $itstate
43 $r1 = t2MOVi 1, 12, killed $cpsr, _, implicit internal killed $itstate
45 $r0 = tMOVr killed $r1, 14, _
46 tBX_RET 14, _, implicit killed $r0
50 tracksRegLiveness: true
57 ; Verify that the next machine instruction can be on the same line as
60 ; CHECK-LABEL: name: test2
61 ; CHECK: $r1 = t2MOVi 0, 14, $noreg, $noreg
62 ; CHECK-NEXT: t2CMNri killed $r0, 78, 14, $noreg, implicit-def $cpsr
63 ; CHECK-NEXT: BUNDLE implicit-def dead $itstate, implicit-def $r1, implicit killed $cpsr {
64 ; CHECK-NEXT: t2IT 12, 8, implicit-def $itstate
65 ; CHECK-NEXT: $r1 = t2MOVi 1, 12, killed $cpsr, $noreg, implicit internal killed $itstate
67 ; CHECK-NEXT: $r0 = tMOVr killed $r1, 14, $noreg
68 ; CHECK-NEXT: tBX_RET 14, $noreg, implicit killed $r0
69 $r1 = t2MOVi 0, 14, _, _
70 t2CMNri killed $r0, 78, 14, _, implicit-def $cpsr
71 BUNDLE implicit-def dead $itstate, implicit-def $r1, implicit killed $cpsr { t2IT 12, 8, implicit-def $itstate
72 $r1 = t2MOVi 1, 12, killed $cpsr, _, internal implicit killed $itstate
73 } $r0 = tMOVr killed $r1, 14, _
74 tBX_RET 14, _, implicit killed $r0