2 ; RUN: llc < %s -mtriple=thumbv7-apple-ios -arm-atomic-cfg-tidy=0 -stats 2>&1 | FileCheck %s
4 ; If ARMBaseInstrInfo::AnalyzeBlocks returns the wrong value, which was possible
5 ; for blocks with indirect branches, the IfConverter could end up deleting
6 ; blocks that were the destinations of indirect branches, leaving branches to
8 ; <rdar://problem/14464830>
10 define i32 @preserve_blocks(i32 %x) {
12 ; CHECK: Block address taken
15 ; CHECK: Block address taken
18 ; CHECK-NOT: Address of block that was removed by CodeGen
20 ; Separate bug. There are no valid diamonds to if-convert in this file.
21 ; There was a bug in the if-conversion code that would if-convert a false
22 ; diamond where one side had a return and the other had an indirect branch.
23 ; Make sure no diamond conversions occurred while compiling this file.
24 ; CHECK: Statistics Collected
25 ; CHECK-NOT: 1 ifcvt - Number of diamond if-conversions performed
27 %c2 = icmp slt i32 %x, 3
28 %blockaddr = select i1 %c2, ptr blockaddress(@preserve_blocks, %ibt1), ptr blockaddress(@preserve_blocks, %ibt2)
29 %c1 = icmp eq i32 %x, 0
30 br i1 %c1, label %pre_ib, label %nextblock
42 indirectbr ptr %blockaddr, [ label %ibt1, label %ibt2 ]