blob: 83d97b5833c46efb947d2cc712c9a597d8f560aa [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
Reid Spencer65f47a32007-04-15 18:40:57 +00005; RUN: llvm-as < %s | llc -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}