1 ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -mattr=+soft-float -mips16-hard-float -relocation-model=static -mips16-constant-islands=true < %s | FileCheck %s -check-prefix=lcb
3 ; RUN: llc -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -mattr=+soft-float -mips16-hard-float -relocation-model=static -mips16-constant-islands=true < %s | FileCheck %s -check-prefix=lcbn
5 @i = global i32 0, align 4
6 @j = common global i32 0, align 4
7 @k = common global i32 0, align 4
9 ; Function Attrs: nounwind optsize
10 define i32 @bnez() #0 {
12 %0 = load i32, ptr @i, align 4, !tbaa !1
13 %cmp = icmp eq i32 %0, 0
14 br i1 %cmp, label %if.then, label %if.end
16 if.then: ; preds = %entry
17 tail call void asm sideeffect ".space 10000", ""() #1, !srcloc !5
18 store i32 0, ptr @i, align 4, !tbaa !1
21 if.end: ; preds = %if.then, %entry
26 ; lcb: bnez ${{[0-9]+}}, $BB{{[0-9]+}}_{{[0-9]+}}
27 ; lcbn-NOT: bnez ${{[0-9]+}}, $BB{{[0-9]+}}_{{[0-9]+}} # 16 bit inst
31 ; Function Attrs: nounwind optsize
32 define i32 @beqz() #0 {
34 %0 = load i32, ptr @i, align 4, !tbaa !1
35 %cmp = icmp eq i32 %0, 0
36 br i1 %cmp, label %if.then, label %if.else
38 if.then: ; preds = %entry
39 store i32 10, ptr @j, align 4, !tbaa !1
40 tail call void asm sideeffect ".space 10000", ""() #1, !srcloc !6
43 if.else: ; preds = %entry
44 store i32 55, ptr @j, align 4, !tbaa !1
45 tail call void asm sideeffect ".space 10000", ""() #1, !srcloc !7
48 if.end: ; preds = %if.else, %if.then
54 ; lcb: beqz ${{[0-9]+}}, $BB{{[0-9]+}}_{{[0-9]+}}
55 ; lcbn-NOT: beqz ${{[0-9]+}}, $BB{{[0-9]+}}_{{[0-9]+}} # 16 bit inst
60 ; Function Attrs: nounwind optsize
61 define void @bteqz() #0 {
63 %0 = load i32, ptr @i, align 4, !tbaa !1
64 %1 = load i32, ptr @j, align 4, !tbaa !1
65 %cmp = icmp eq i32 %0, %1
66 br i1 %cmp, label %if.then, label %if.else
68 if.then: ; preds = %entry
69 store i32 1, ptr @k, align 4, !tbaa !1
70 tail call void asm sideeffect ".space 1000", ""() #1, !srcloc !8
73 if.else: ; preds = %entry
74 tail call void asm sideeffect ".space 1000", ""() #1, !srcloc !9
75 store i32 2, ptr @k, align 4, !tbaa !1
78 if.end: ; preds = %if.else, %if.then
84 ; lcb: btnez $BB{{[0-9]+}}_{{[0-9]+}}
85 ; lcbn-NOT: btnez $BB{{[0-9]+}}_{{[0-9]+}} # 16 bit inst
90 ; Function Attrs: nounwind optsize
91 define void @btz() #0 {
93 %0 = load i32, ptr @i, align 4, !tbaa !1
94 %1 = load i32, ptr @j, align 4, !tbaa !1
95 %cmp1 = icmp sgt i32 %0, %1
96 br i1 %cmp1, label %if.then, label %if.end
98 if.then: ; preds = %entry, %if.then
99 tail call void asm sideeffect ".space 60000", ""() #1, !srcloc !10
100 %2 = load i32, ptr @i, align 4, !tbaa !1
101 %3 = load i32, ptr @j, align 4, !tbaa !1
102 %cmp = icmp sgt i32 %2, %3
103 br i1 %cmp, label %if.then, label %if.end
105 if.end: ; preds = %if.then, %entry
111 ; lcb: bteqz $BB{{[0-9]+}}_{{[0-9]+}}
112 ; lcbn-NOT: bteqz $BB{{[0-9]+}}_{{[0-9]+}} # 16 bit inst
113 ; lcb: btnez $BB{{[0-9]+}}_{{[0-9]+}}
114 ; lcbn-NOT: btnez $BB{{[0-9]+}}_{{[0-9]+}} # 16 bit inst
118 attributes #0 = { nounwind optsize "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
119 attributes #1 = { nounwind }
123 !0 = !{!"clang version 3.5 (gitosis@dmz-portal.mips.com:clang.git ed197d08c90d82e1119774e10920e6f7a841c8ec) (gitosis@dmz-portal.mips.com:llvm.git b9235a363fa2dddb26ac01cbaed58efbc9eff392)"}
124 !1 = !{!2, !2, i64 0}
125 !2 = !{!"int", !3, i64 0}
126 !3 = !{!"omnipotent char", !4, i64 0}
127 !4 = !{!"Simple C/C++ TBAA"}