Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | ; Make sure this testcase codegens to the ctlz instruction |
Dan Gohman | da594cf | 2009-09-09 00:09:15 +0000 | [diff] [blame^] | 2 | ; 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 Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 6 | |
Chandler Carruth | a228e39 | 2007-08-04 01:51:18 +0000 | [diff] [blame] | 7 | declare i8 @llvm.ctlz.i8(i8) |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 8 | |
| 9 | define i32 @bar(i8 %x) { |
| 10 | entry: |
Chandler Carruth | a228e39 | 2007-08-04 01:51:18 +0000 | [diff] [blame] | 11 | %tmp.1 = call i8 @llvm.ctlz.i8( i8 %x ) |
| 12 | %tmp.2 = sext i8 %tmp.1 to i32 |
| 13 | ret i32 %tmp.2 |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 14 | } |