Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame^] | 1 | ; bswap should be constant folded when it is passed a constant argument |
| 2 | |
| 3 | ; RUN: llvm-upgrade < %s | llvm-as | opt -constprop | llvm-dis | not grep call |
| 4 | |
| 5 | declare ushort %llvm.bswap.i16(ushort) |
| 6 | declare uint %llvm.bswap.i32(uint) |
| 7 | declare ulong %llvm.bswap.i64(ulong) |
| 8 | |
| 9 | ushort %W() { |
| 10 | %Z = call ushort %llvm.bswap.i16(ushort 1) |
| 11 | ret ushort %Z |
| 12 | } |
| 13 | |
| 14 | uint %X() { |
| 15 | %Z = call uint %llvm.bswap.i32(uint 1) |
| 16 | ret uint %Z |
| 17 | } |
| 18 | |
| 19 | ulong %Y() { |
| 20 | %Z = call ulong %llvm.bswap.i64(ulong 1) |
| 21 | ret ulong %Z |
| 22 | } |