blob: 8dad43fa73413a878f8f99e5b1f96a1e17321d65 [file] [log] [blame]
Reid Spencer91948d42007-04-14 20:13:02 +00001; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
Dan Gohmanf9dd1702007-08-15 13:36:28 +00002; RUN: grep ret | count 3
Reid Spencer91948d42007-04-14 20:13:02 +00003; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
4; RUN: not grep call.*bswap
Chris Lattnere7f83dc2006-11-29 05:00:14 +00005
6bool %test1(ushort %tmp2) {
Reid Spencera5f996b2007-04-02 00:51:15 +00007 %tmp10 = call ushort %llvm.bswap.i16( ushort %tmp2 )
Chris Lattnere7f83dc2006-11-29 05:00:14 +00008 %tmp = seteq ushort %tmp10, 1
9 ret bool %tmp
10}
11
12bool %test2(uint %tmp) {
Reid Spencera5f996b2007-04-02 00:51:15 +000013 %tmp34 = tail call uint %llvm.bswap.i32( uint %tmp )
Chris Lattnere7f83dc2006-11-29 05:00:14 +000014 %tmp = seteq uint %tmp34, 1
15 ret bool %tmp
16}
17
Reid Spencera5f996b2007-04-02 00:51:15 +000018declare uint %llvm.bswap.i32(uint)
19
Chris Lattnere7f83dc2006-11-29 05:00:14 +000020bool %test3(ulong %tmp) {
Reid Spencera5f996b2007-04-02 00:51:15 +000021 %tmp34 = tail call ulong %llvm.bswap.i64( ulong %tmp )
Chris Lattnere7f83dc2006-11-29 05:00:14 +000022 %tmp = seteq ulong %tmp34, 1
23 ret bool %tmp
24}
25
Reid Spencera5f996b2007-04-02 00:51:15 +000026declare ulong %llvm.bswap.i64(ulong)
Chris Lattnere7f83dc2006-11-29 05:00:14 +000027
Reid Spencera5f996b2007-04-02 00:51:15 +000028declare ushort %llvm.bswap.i16(ushort)