1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=thumbv7-apple-ios -run-pass=if-converter -verify-machineinstrs %s -o - | FileCheck %s
3
4# Both branches in bb.3 jump to bb.1. IfConversion shouldn't treat this as a
5# tringle and insert the tADDspi in bb3, but leave it as it is.
6
7...
8---
9name:            foo
10body:             |
11  ; CHECK-LABEL: name: foo
12  ; CHECK: bb.0:
13  ; CHECK:   successors: %bb.2(0x40000000), %bb.1(0x40000000)
14  ; CHECK:   tBcc %bb.2, 1 /* CC::ne */, $cpsr
15  ; CHECK: bb.1:
16  ; CHECK:   successors: %bb.1(0x80000000)
17  ; CHECK:   $sp = tADDspi $sp, 2, 14 /* CC::al */, $noreg
18  ; CHECK:   tB %bb.1, 14 /* CC::al */, $noreg
19  ; CHECK: bb.2:
20  ; CHECK:   successors: %bb.3(0x40000000), %bb.2(0x40000000)
21  ; CHECK:   tBcc %bb.3, 0 /* CC::eq */, $cpsr
22  ; CHECK:   tB %bb.2, 14 /* CC::al */, $noreg
23  ; CHECK: bb.3:
24  ; CHECK:   successors: %bb.1(0x80000000)
25  ; CHECK:   tBcc %bb.1, 1 /* CC::ne */, $cpsr
26  ; CHECK:   tB %bb.1, 14 /* CC::al */, $noreg
27  bb.0:
28    tBcc %bb.2, 1, $cpsr
29
30  bb.1:
31    $sp = tADDspi $sp, 2, 14, _
32    tB %bb.1, 14, $noreg
33
34  bb.2:
35    tBcc %bb.3, 0, $cpsr
36    tB %bb.2, 14, $noreg
37
38  bb.3:
39    tBcc %bb.1, 1, $cpsr
40    tB %bb.1, 14, $noreg
41...
42