blob: fba60227f83019bc31395cb8b1c3d0ed556403af [file] [log] [blame]
Andrew Lenharthe8aebf72005-05-04 15:56:34 +00001; Make sure this testcase codegens to the ctlz instruction
Reid Spencer65f47a32007-04-15 18:40:57 +00002; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev67 | grep -i ctlz
3; RUN: llvm-as < %s | llc -march=alpha -mattr=+CIX | grep -i ctlz
4; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev6 | not grep -i ctlz
5; RUN: llvm-as < %s | llc -march=alpha -mcpu=ev56 | not grep -i ctlz
6; RUN: llvm-as < %s | llc -march=alpha -mattr=-CIX | not grep -i ctlz
Andrew Lenharthd3942b42005-05-04 15:51:07 +00007
Chandler Carruth69940402007-08-04 01:51:18 +00008declare i8 @llvm.ctlz.i8(i8)
Andrew Lenharthd3942b42005-05-04 15:51:07 +00009
Reid Spencer65f47a32007-04-15 18:40:57 +000010define i32 @bar(i8 %x) {
Andrew Lenharthd3942b42005-05-04 15:51:07 +000011entry:
Chandler Carruth69940402007-08-04 01:51:18 +000012 %tmp.1 = call i8 @llvm.ctlz.i8( i8 %x )
13 %tmp.2 = sext i8 %tmp.1 to i32
14 ret i32 %tmp.2
Andrew Lenharthd3942b42005-05-04 15:51:07 +000015}