Implement cond ? -1 : 0 with sbb.
[oota-llvm.git] / test / CodeGen / X86 / sext-i1.ll
1 ; RUN: llc < %s -march=x86 | FileCheck %s
2 ; rdar://7573216
3
4 define i32 @t1(i32 %x) nounwind readnone ssp {
5 entry:
6 ; CHECK: t1:
7 ; CHECK: cmpl $1
8 ; CHECK: sbbl
9   %0 = icmp eq i32 %x, 0
10   %iftmp.0.0 = select i1 %0, i32 -1, i32 0
11   ret i32 %iftmp.0.0
12 }
13
14 define i32 @t2(i32 %x) nounwind readnone ssp {
15 entry:
16 ; CHECK: t2:
17 ; CHECK: cmpl $1
18 ; CHECK: sbbl
19   %0 = icmp eq i32 %x, 0
20   %iftmp.0.0 = sext i1 %0 to i32
21   ret i32 %iftmp.0.0
22 }