1 ; RUN: llc -march=mipsel -mattr=mips16 -relocation-model=pic < %s | FileCheck %s -check-prefix=16
3 @t = global i32 10, align 4
4 @f = global i32 199, align 4
5 @a = global i32 1, align 4
6 @b = global i32 10, align 4
7 @c = global i32 1, align 4
8 @z1 = common global i32 0, align 4
9 @z2 = common global i32 0, align 4
10 @z3 = common global i32 0, align 4
11 @z4 = common global i32 0, align 4
13 define void @calc_seleq() nounwind {
15 %0 = load i32, i32* @a, align 4
16 %1 = load i32, i32* @b, align 4
17 %cmp = icmp eq i32 %0, %1
18 br i1 %cmp, label %cond.true, label %cond.false
20 cond.true: ; preds = %entry
21 %2 = load i32, i32* @f, align 4
24 cond.false: ; preds = %entry
25 %3 = load i32, i32* @t, align 4
28 cond.end: ; preds = %cond.false, %cond.true
29 %cond = phi i32 [ %2, %cond.true ], [ %3, %cond.false ]
30 store i32 %cond, i32* @z1, align 4
31 %4 = load i32, i32* @b, align 4
32 %5 = load i32, i32* @a, align 4
33 %cmp1 = icmp eq i32 %4, %5
34 br i1 %cmp1, label %cond.true2, label %cond.false3
36 cond.true2: ; preds = %cond.end
37 %6 = load i32, i32* @f, align 4
40 cond.false3: ; preds = %cond.end
41 %7 = load i32, i32* @t, align 4
44 cond.end4: ; preds = %cond.false3, %cond.true2
45 %cond5 = phi i32 [ %6, %cond.true2 ], [ %7, %cond.false3 ]
46 store i32 %cond5, i32* @z2, align 4
47 %8 = load i32, i32* @c, align 4
48 %9 = load i32, i32* @a, align 4
49 %cmp6 = icmp eq i32 %8, %9
50 br i1 %cmp6, label %cond.true7, label %cond.false8
52 cond.true7: ; preds = %cond.end4
53 %10 = load i32, i32* @t, align 4
56 cond.false8: ; preds = %cond.end4
57 %11 = load i32, i32* @f, align 4
60 cond.end9: ; preds = %cond.false8, %cond.true7
61 %cond10 = phi i32 [ %10, %cond.true7 ], [ %11, %cond.false8 ]
62 store i32 %cond10, i32* @z3, align 4
63 %12 = load i32, i32* @a, align 4
64 %13 = load i32, i32* @c, align 4
65 %cmp11 = icmp eq i32 %12, %13
66 br i1 %cmp11, label %cond.true12, label %cond.false13
68 cond.true12: ; preds = %cond.end9
69 %14 = load i32, i32* @t, align 4
72 cond.false13: ; preds = %cond.end9
73 %15 = load i32, i32* @f, align 4
76 cond.end14: ; preds = %cond.false13, %cond.true12
77 %cond15 = phi i32 [ %14, %cond.true12 ], [ %15, %cond.false13 ]
78 store i32 %cond15, i32* @z4, align 4
82 attributes #0 = { nounwind "target-cpu"="mips32" "target-features"="+o32,+mips32" }
84 ; 16: cmp ${{[0-9]+}}, ${{[0-9]+}}
85 ; 16: btnez $BB{{[0-9]+}}_{{[0-9]}}
87 ; 16: cmp ${{[0-9]+}}, ${{[0-9]+}}
88 ; 16: btnez $BB{{[0-9]+}}_{{[0-9]}}
90 ; 16: cmp ${{[0-9]+}}, ${{[0-9]+}}
91 ; 16: btnez $BB{{[0-9]+}}_{{[0-9]}}
93 ; 16: cmp ${{[0-9]+}}, ${{[0-9]+}}
94 ; 16: btnez $BB{{[0-9]+}}_{{[0-9]}}