1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=i686-- | FileCheck %s
4 ; This tests some cases where BT must not be generated. See also bt.ll.
5 ; Fixes 20040709-[12].c in gcc testsuite.
7 define void @test2(i32 %x, i32 %n) nounwind {
9 ; CHECK: # %bb.0: # %entry
10 ; CHECK-NEXT: xorl %eax, %eax
11 ; CHECK-NEXT: testb %al, %al
12 ; CHECK-NEXT: jne .LBB0_2
13 ; CHECK-NEXT: # %bb.1: # %bb
14 ; CHECK-NEXT: calll foo@PLT
15 ; CHECK-NEXT: .LBB0_2: # %UnifiedReturnBlock
19 %tmp2 = urem i32 %tmp1, 15
20 %tmp3 = and i32 %tmp2, 1 ; <i32> [#uses=1]
21 %tmp4 = icmp eq i32 %tmp3, %tmp2 ; <i1> [#uses=1]
22 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
28 UnifiedReturnBlock: ; preds = %entry
32 define void @test3(i32 %x, i32 %n) nounwind {
34 ; CHECK: # %bb.0: # %entry
35 ; CHECK-NEXT: xorl %eax, %eax
36 ; CHECK-NEXT: testb %al, %al
37 ; CHECK-NEXT: jne .LBB1_2
38 ; CHECK-NEXT: # %bb.1: # %bb
39 ; CHECK-NEXT: calll foo@PLT
40 ; CHECK-NEXT: .LBB1_2: # %UnifiedReturnBlock
44 %tmp2 = urem i32 %tmp1, 15
45 %tmp3 = and i32 %tmp2, 1 ; <i32> [#uses=1]
46 %tmp4 = icmp eq i32 %tmp2, %tmp3 ; <i1> [#uses=1]
47 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
53 UnifiedReturnBlock: ; preds = %entry
57 define void @test4(i32 %x, i32 %n) nounwind {
59 ; CHECK: # %bb.0: # %entry
60 ; CHECK-NEXT: movb $1, %al
61 ; CHECK-NEXT: testb %al, %al
62 ; CHECK-NEXT: jne .LBB2_2
63 ; CHECK-NEXT: # %bb.1: # %bb
64 ; CHECK-NEXT: calll foo@PLT
65 ; CHECK-NEXT: .LBB2_2: # %UnifiedReturnBlock
69 %tmp2 = urem i32 %tmp1, 15
70 %tmp3 = and i32 %tmp2, 1 ; <i32> [#uses=1]
71 %tmp4 = icmp ne i32 %tmp2, %tmp3 ; <i1> [#uses=1]
72 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
78 UnifiedReturnBlock: ; preds = %entry
82 define void @test5(i32 %x, i32 %n) nounwind {
84 ; CHECK: # %bb.0: # %entry
85 ; CHECK-NEXT: movb $1, %al
86 ; CHECK-NEXT: testb %al, %al
87 ; CHECK-NEXT: jne .LBB3_2
88 ; CHECK-NEXT: # %bb.1: # %bb
89 ; CHECK-NEXT: calll foo@PLT
90 ; CHECK-NEXT: .LBB3_2: # %UnifiedReturnBlock
94 %tmp2 = urem i32 %tmp1, 15
95 %tmp3 = and i32 %tmp2, 1 ; <i32> [#uses=1]
96 %tmp4 = icmp ne i32 %tmp2, %tmp3 ; <i1> [#uses=1]
97 br i1 %tmp4, label %bb, label %UnifiedReturnBlock
103 UnifiedReturnBlock: ; preds = %entry