blob: d31fa9d7932467fc45b478701ec26bac6907d30e [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001; 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
5declare ushort %llvm.bswap.i16(ushort)
6declare uint %llvm.bswap.i32(uint)
7declare ulong %llvm.bswap.i64(ulong)
8
9ushort %W() {
10 %Z = call ushort %llvm.bswap.i16(ushort 1)
11 ret ushort %Z
12}
13
14uint %X() {
15 %Z = call uint %llvm.bswap.i32(uint 1)
16 ret uint %Z
17}
18
19ulong %Y() {
20 %Z = call ulong %llvm.bswap.i64(ulong 1)
21 ret ulong %Z
22}