1; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=armv7-apple-ios | FileCheck %s --check-prefix=ARM 2; RUN: llc < %s -O0 -fast-isel-abort -relocation-model=dynamic-no-pic -mtriple=thumbv7-apple-ios | FileCheck %s --check-prefix=THUMB 3 4define void @t1a(float %a) uwtable ssp { 5entry: 6; ARM: t1a 7; THUMB: t1a 8 %cmp = fcmp oeq float %a, 0.000000e+00 9; ARM: vcmpe.f32 s{{[0-9]+}}, #0 10; THUMB: vcmpe.f32 s{{[0-9]+}}, #0 11 br i1 %cmp, label %if.then, label %if.end 12 13if.then: ; preds = %entry 14 tail call void @foo() 15 br label %if.end 16 17if.end: ; preds = %if.then, %entry 18 ret void 19} 20 21declare void @foo() 22 23; Shouldn't be able to encode -0.0 imm. 24define void @t1b(float %a) uwtable ssp { 25entry: 26; ARM: t1b 27; THUMB: t1b 28 %cmp = fcmp oeq float %a, -0.000000e+00 29; ARM: vldr 30; ARM: vcmpe.f32 s{{[0-9]+}}, s{{[0-9]+}} 31; THUMB: vldr 32; THUMB: vcmpe.f32 s{{[0-9]+}}, s{{[0-9]+}} 33 br i1 %cmp, label %if.then, label %if.end 34 35if.then: ; preds = %entry 36 tail call void @foo() 37 br label %if.end 38 39if.end: ; preds = %if.then, %entry 40 ret void 41} 42 43define void @t2a(double %a) uwtable ssp { 44entry: 45; ARM: t2a 46; THUMB: t2a 47 %cmp = fcmp oeq double %a, 0.000000e+00 48; ARM: vcmpe.f64 d{{[0-9]+}}, #0 49; THUMB: vcmpe.f64 d{{[0-9]+}}, #0 50 br i1 %cmp, label %if.then, label %if.end 51 52if.then: ; preds = %entry 53 tail call void @foo() 54 br label %if.end 55 56if.end: ; preds = %if.then, %entry 57 ret void 58} 59 60; Shouldn't be able to encode -0.0 imm. 61define void @t2b(double %a) uwtable ssp { 62entry: 63; ARM: t2b 64; THUMB: t2b 65 %cmp = fcmp oeq double %a, -0.000000e+00 66; ARM: vldr 67; ARM: vcmpe.f64 d{{[0-9]+}}, d{{[0-9]+}} 68; THUMB: vldr 69; THUMB: vcmpe.f64 d{{[0-9]+}}, d{{[0-9]+}} 70 br i1 %cmp, label %if.then, label %if.end 71 72if.then: ; preds = %entry 73 tail call void @foo() 74 br label %if.end 75 76if.end: ; preds = %if.then, %entry 77 ret void 78} 79 80define void @t4(i8 signext %a) uwtable ssp { 81entry: 82; ARM: t4 83; THUMB: t4 84 %cmp = icmp eq i8 %a, -1 85; ARM: cmn r{{[0-9]}}, #1 86; THUMB: cmn.w r{{[0-9]}}, #1 87 br i1 %cmp, label %if.then, label %if.end 88 89if.then: ; preds = %entry 90 tail call void @foo() 91 br label %if.end 92 93if.end: ; preds = %if.then, %entry 94 ret void 95} 96 97define void @t5(i8 zeroext %a) uwtable ssp { 98entry: 99; ARM: t5 100; THUMB: t5 101 %cmp = icmp eq i8 %a, 1 102; ARM: cmp r{{[0-9]}}, #1 103; THUMB: cmp r{{[0-9]}}, #1 104 br i1 %cmp, label %if.then, label %if.end 105 106if.then: ; preds = %entry 107 tail call void @foo() 108 br label %if.end 109 110if.end: ; preds = %if.then, %entry 111 ret void 112} 113 114define void @t6(i16 signext %a) uwtable ssp { 115entry: 116; ARM: t6 117; THUMB: t6 118 %cmp = icmp eq i16 %a, -1 119; ARM: cmn r{{[0-9]}}, #1 120; THUMB: cmn.w r{{[0-9]}}, #1 121 br i1 %cmp, label %if.then, label %if.end 122 123if.then: ; preds = %entry 124 tail call void @foo() 125 br label %if.end 126 127if.end: ; preds = %if.then, %entry 128 ret void 129} 130 131define void @t7(i16 zeroext %a) uwtable ssp { 132entry: 133; ARM: t7 134; THUMB: t7 135 %cmp = icmp eq i16 %a, 1 136; ARM: cmp r{{[0-9]}}, #1 137; THUMB: cmp r{{[0-9]}}, #1 138 br i1 %cmp, label %if.then, label %if.end 139 140if.then: ; preds = %entry 141 tail call void @foo() 142 br label %if.end 143 144if.end: ; preds = %if.then, %entry 145 ret void 146} 147 148define void @t8(i32 %a) uwtable ssp { 149entry: 150; ARM: t8 151; THUMB: t8 152 %cmp = icmp eq i32 %a, -1 153; ARM: cmn r{{[0-9]}}, #1 154; THUMB: cmn.w r{{[0-9]}}, #1 155 br i1 %cmp, label %if.then, label %if.end 156 157if.then: ; preds = %entry 158 tail call void @foo() 159 br label %if.end 160 161if.end: ; preds = %if.then, %entry 162 ret void 163} 164 165define void @t9(i32 %a) uwtable ssp { 166entry: 167; ARM: t9 168; THUMB: t9 169 %cmp = icmp eq i32 %a, 1 170; ARM: cmp r{{[0-9]}}, #1 171; THUMB: cmp r{{[0-9]}}, #1 172 br i1 %cmp, label %if.then, label %if.end 173 174if.then: ; preds = %entry 175 tail call void @foo() 176 br label %if.end 177 178if.end: ; preds = %if.then, %entry 179 ret void 180} 181 182define void @t10(i32 %a) uwtable ssp { 183entry: 184; ARM: t10 185; THUMB: t10 186 %cmp = icmp eq i32 %a, 384 187; ARM: cmp r{{[0-9]}}, #384 188; THUMB: cmp.w r{{[0-9]}}, #384 189 br i1 %cmp, label %if.then, label %if.end 190 191if.then: ; preds = %entry 192 tail call void @foo() 193 br label %if.end 194 195if.end: ; preds = %if.then, %entry 196 ret void 197} 198 199define void @t11(i32 %a) uwtable ssp { 200entry: 201; ARM: t11 202; THUMB: t11 203 %cmp = icmp eq i32 %a, 4096 204; ARM: cmp r{{[0-9]}}, #4096 205; THUMB: cmp.w r{{[0-9]}}, #4096 206 br i1 %cmp, label %if.then, label %if.end 207 208if.then: ; preds = %entry 209 tail call void @foo() 210 br label %if.end 211 212if.end: ; preds = %if.then, %entry 213 ret void 214} 215 216define void @t12(i8 %a) uwtable ssp { 217entry: 218; ARM: t12 219; THUMB: t12 220 %cmp = icmp ugt i8 %a, -113 221; ARM: cmp r{{[0-9]}}, #143 222; THUMB: cmp r{{[0-9]}}, #143 223 br i1 %cmp, label %if.then, label %if.end 224 225if.then: ; preds = %entry 226 tail call void @foo() 227 br label %if.end 228 229if.end: ; preds = %if.then, %entry 230 ret void 231} 232 233; rdar://11038907 234; When comparing LONG_MIN/INT_MIN use a cmp instruction. 235define void @t13() nounwind ssp { 236entry: 237; ARM: t13 238; THUMB: t13 239 %cmp = icmp slt i32 -123, -2147483648 240; ARM: cmp r{{[0-9]}}, #-2147483648 241; THUMB: cmp.w r{{[0-9]}}, #-2147483648 242 br i1 %cmp, label %if.then, label %if.end 243 244if.then: ; preds = %entry 245 ret void 246 247if.end: ; preds = %entry 248 ret void 249} 250 251