[ARMv8] Prevent generation of deprecated IT blocks on ARMv8 in Thumb mode.
[oota-llvm.git] / test / CodeGen / Thumb2 / v8_IT_5.ll
1 ; RUN: llc < %s -mtriple=thumbv8 | FileCheck %s
2 ; CHECK: it     ne
3 ; CHECK-NEXT: cmpne
4 ; CHECK-NEXT: beq
5 ; CHECK: cmp
6 ; CHECK-NEXT: beq
7 ; CHECK-NEXT: %if.else163
8 ; CHECK-NEXT: mov.w
9 ; CHECK-NEXT: b
10 ; CHECK-NEXT: %if.else145
11 ; CHECK-NEXT: mov.w
12
13 %struct.hc = type { i32, i32, i32, i32 }
14
15 define i32 @t(i32 %type) optsize {
16 entry:
17   br i1 undef, label %if.then, label %if.else
18
19 if.then:
20   unreachable
21
22 if.else:
23   br i1 undef, label %if.then15, label %if.else18
24
25 if.then15:
26   unreachable
27
28 if.else18:
29   switch i32 %type, label %if.else173 [
30     i32 3, label %if.then115
31     i32 1, label %if.then102
32   ]
33
34 if.then102:
35   br i1 undef, label %cond.true10.i, label %t.exit
36
37 cond.true10.i:
38   br label %t.exit
39
40 t.exit:
41   unreachable
42
43 if.then115:
44   br i1 undef, label %if.else163, label %if.else145
45
46 if.else145:
47   %call150 = call fastcc %struct.hc* @foo(%struct.hc* undef, i32 34865152) optsize
48   br label %while.body172
49
50 if.else163:
51   %call168 = call fastcc %struct.hc* @foo(%struct.hc* undef, i32 34078720) optsize
52   br label %while.body172
53
54 while.body172:
55   br label %while.body172
56
57 if.else173:
58   ret i32 -1
59 }
60
61 declare hidden fastcc %struct.hc* @foo(%struct.hc* nocapture, i32) nounwind optsize
62