~pali/+junk/llvm-toolchain-3.7

« back to all changes in this revision

Viewing changes to test/CodeGen/ARM/indirectbr-3.ll

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2015-07-15 17:51:08 UTC
  • Revision ID: package-import@ubuntu.com-20150715175108-l8mynwovkx4zx697
Tags: upstream-3.7~+rc2
ImportĀ upstreamĀ versionĀ 3.7~+rc2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
; RUN: llc < %s -mtriple=thumbv7-apple-ios -arm-atomic-cfg-tidy=0 | FileCheck %s
 
2
 
 
3
; If ARMBaseInstrInfo::AnalyzeBlocks returns the wrong value, which was possible
 
4
; for blocks with indirect branches, the IfConverter could end up deleting
 
5
; blocks that were the destinations of indirect branches, leaving branches to
 
6
; nowhere.
 
7
; <rdar://problem/14464830>
 
8
 
 
9
define i32 @preserve_blocks(i32 %x) {
 
10
; preserve_blocks:
 
11
; CHECK: Block address taken
 
12
; CHECK: movs r0, #2
 
13
; CHECK: movs r0, #1
 
14
; CHECK-NOT: Address of block that was removed by CodeGen
 
15
entry:
 
16
  %c2 = icmp slt i32 %x, 3
 
17
  %blockaddr = select i1 %c2, i8* blockaddress(@preserve_blocks, %ibt1), i8* blockaddress(@preserve_blocks, %ibt2)
 
18
  %c1 = icmp eq i32 %x, 0
 
19
  br i1 %c1, label %pre_ib, label %nextblock
 
20
 
 
21
nextblock:
 
22
  ret i32 3
 
23
 
 
24
ibt1:
 
25
  ret i32 2
 
26
 
 
27
ibt2:
 
28
  ret i32 1
 
29
 
 
30
pre_ib:
 
31
  indirectbr i8* %blockaddr, [ label %ibt1, label %ibt2 ]
 
32
}