Reid Spencer | c6e3d5e | 2005-05-14 16:44:43 +0000 | [diff] [blame^] | 1 | ; Test that the ToAsciiOptimizer works correctly |
| 2 | ; RUN: llvm-as < %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*%ffs' |
| 3 | |
| 4 | declare int %ffs(int) |
| 5 | declare int %ffsl(int) |
| 6 | declare int %ffsll(long) |
| 7 | |
| 8 | implementation ; Functions: |
| 9 | |
| 10 | int %main () { |
| 11 | %val1 = call int %ffs(int 1) |
| 12 | %val2 = call int %ffs(int 2048) |
| 13 | %val3 = call int %ffsl(int 65536) |
| 14 | %val4 = call int %ffsll(long 1024) |
| 15 | %val5 = call int %ffsll(long 17179869184) |
| 16 | %val6 = call int %ffsll(long 1152921504606846976) |
| 17 | %rslt1 = add int %val1, %val2 |
| 18 | %rslt2 = add int %val3, %val4 |
| 19 | %rslt3 = add int %val5, %val6 |
| 20 | %rslt4 = add int %rslt1, %rslt2 |
| 21 | %rslt5 = add int %rslt4, %rslt3 |
| 22 | ret int %rslt5 |
| 23 | } |