1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=thumb-apple-ios -run-pass=if-converter %s -o - | FileCheck %s
4 # bb.2 has no successors, presumably because __stack_chk_fail doesn't return,
5 # so there should be no edge from bb.2 to bb.3.
6 # Nevertheless, IfConversion treats bb.1, bb.2, bb.3 as a triangle and
7 # inserts a predicated copy of bb.2 in bb.1.
9 # This caused r302876 to die with a failed assertion.
12 declare void @__stack_chk_fail()
22 ; CHECK-LABEL: name: foo
24 ; CHECK: successors: %bb.2(0x40000000), %bb.1(0x40000000)
25 ; CHECK: tBcc %bb.2, 1 /* CC::ne */, $cpsr
28 ; CHECK: tBL 14 /* CC::al */, $cpsr, @__stack_chk_fail
30 ; CHECK: tBL 1 /* CC::ne */, $cpsr, @__stack_chk_fail
31 ; CHECK: $sp = tADDspi $sp, 2, 14 /* CC::al */, $noreg
32 ; CHECK: $sp = tADDspi $sp, 2, 14 /* CC::al */, $noreg
33 ; CHECK: tTAILJMPdND @bar, 14 /* CC::al */, $cpsr
44 tBL 14, $cpsr, @__stack_chk_fail
48 $sp = tADDspi $sp, 2, 14, _
49 $sp = tADDspi $sp, 2, 14, _
50 tTAILJMPdND @bar, 14, $cpsr