blob: aa1588aa39e8f3c51fb778504f788d7c076ad533 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; Make sure this testcase codegens to the ctlz instruction
Dan Gohmanda594cf2009-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
Dan Gohmanf17a25c2007-07-18 16:29:46 +00006
Chandler Carrutha228e392007-08-04 01:51:18 +00007declare i8 @llvm.ctlz.i8(i8)
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008
9define i32 @bar(i8 %x) {
10entry:
Chandler Carrutha228e392007-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
Dan Gohmanf17a25c2007-07-18 16:29:46 +000014}