Bug fix. Must also match ResNo when matching an operand with a user.
[oota-llvm.git] / test / CodeGen / X86 / clz.ll
1 ; RUN: llvm-as < %s | llc -march=x86 | grep bsr
2 ; RUN: llvm-as < %s | llc -march=x86 | grep bsf
3
4 define i32 @t1(i32 %x) nounwind  {
5         %tmp = tail call i32 @llvm.ctlz.i32( i32 %x )
6         ret i32 %tmp
7 }
8
9 declare i32 @llvm.ctlz.i32(i32) nounwind readnone 
10
11 define i32 @t2(i32 %x) nounwind  {
12         %tmp = tail call i32 @llvm.cttz.i32( i32 %x )
13         ret i32 %tmp
14 }
15
16 declare i32 @llvm.cttz.i32(i32) nounwind readnone