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