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 3 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. 8 9# This caused r302876 to die with a failed assertion. 10 11--- | 12 declare void @__stack_chk_fail() 13 declare void @bar() 14 15 define void @foo() { 16 ret void 17 } 18... 19--- 20name: foo 21body: | 22 ; CHECK-LABEL: name: foo 23 ; CHECK: bb.0: 24 ; CHECK: successors: %bb.2(0x40000000), %bb.1(0x40000000) 25 ; CHECK: tBcc %bb.2, 1 /* CC::ne */, $cpsr 26 ; CHECK: bb.1: 27 ; CHECK: successors: 28 ; CHECK: tBL 14 /* CC::al */, $cpsr, @__stack_chk_fail 29 ; CHECK: bb.2: 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 34 35 bb.0: 36 tBcc %bb.1, 1, $cpsr 37 tB %bb.2, 14, $noreg 38 39 bb.1: 40 tBcc %bb.3, 0, $cpsr 41 42 bb.2: 43 successors: 44 tBL 14, $cpsr, @__stack_chk_fail 45 46 bb.3: 47 successors: 48 $sp = tADDspi $sp, 2, 14, _ 49 $sp = tADDspi $sp, 2, 14, _ 50 tTAILJMPdND @bar, 14, $cpsr 51... 52