blob: 55294280f5c8589704aa685e861259aa667777d7 [file] [log] [blame]
Dale Johannesen85b0ede2009-02-11 19:19:41 +00001; RUN: llvm-as < %s | llc -march=x86 | not grep btl
2
3; This tests some cases where BT must not be generated. See also bt.ll.
4; Fixes 20040709-[12].c in gcc testsuite.
5
6define void @test2(i32 %x, i32 %n) nounwind {
7entry:
8 %tmp1 = and i32 %x, 1
9 %tmp2 = urem i32 %tmp1, 15
10 %tmp3 = and i32 %tmp2, 1 ; <i32> [#uses=1]
11 %tmp4 = icmp eq i32 %tmp3, %tmp2 ; <i1> [#uses=1]
12 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
13
14bb: ; preds = %entry
15 call void @foo()
16 ret void
17
18UnifiedReturnBlock: ; preds = %entry
19 ret void
20}
21
22define void @test3(i32 %x, i32 %n) nounwind {
23entry:
24 %tmp1 = and i32 %x, 1
25 %tmp2 = urem i32 %tmp1, 15
26 %tmp3 = and i32 %tmp2, 1 ; <i32> [#uses=1]
27 %tmp4 = icmp eq i32 %tmp2, %tmp3 ; <i1> [#uses=1]
28 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
29
30bb: ; preds = %entry
31 call void @foo()
32 ret void
33
34UnifiedReturnBlock: ; preds = %entry
35 ret void
36}
37
38define void @test4(i32 %x, i32 %n) nounwind {
39entry:
40 %tmp1 = and i32 %x, 1
41 %tmp2 = urem i32 %tmp1, 15
42 %tmp3 = and i32 %tmp2, 1 ; <i32> [#uses=1]
43 %tmp4 = icmp ne i32 %tmp2, %tmp3 ; <i1> [#uses=1]
44 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
45
46bb: ; preds = %entry
47 call void @foo()
48 ret void
49
50UnifiedReturnBlock: ; preds = %entry
51 ret void
52}
53
54define void @test5(i32 %x, i32 %n) nounwind {
55entry:
56 %tmp1 = and i32 %x, 1
57 %tmp2 = urem i32 %tmp1, 15
58 %tmp3 = and i32 %tmp2, 1 ; <i32> [#uses=1]
59 %tmp4 = icmp ne i32 %tmp2, %tmp3 ; <i1> [#uses=1]
60 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
61
62bb: ; preds = %entry
63 call void @foo()
64 ret void
65
66UnifiedReturnBlock: ; preds = %entry
67 ret void
68}
69
70declare void @foo()