2007-04-14 20:13:02 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
|
2007-08-15 13:36:28 +00:00
|
|
|
; RUN: grep ret | count 3
|
2007-04-14 20:13:02 +00:00
|
|
|
; RUN: llvm-upgrade < %s | llvm-as | opt -instcombine | llvm-dis | \
|
|
|
|
; RUN: not grep call.*bswap
|
2006-11-29 05:00:14 +00:00
|
|
|
|
|
|
|
bool %test1(ushort %tmp2) {
|
2007-04-02 00:51:15 +00:00
|
|
|
%tmp10 = call ushort %llvm.bswap.i16( ushort %tmp2 )
|
2006-11-29 05:00:14 +00:00
|
|
|
%tmp = seteq ushort %tmp10, 1
|
|
|
|
ret bool %tmp
|
|
|
|
}
|
|
|
|
|
|
|
|
bool %test2(uint %tmp) {
|
2007-04-02 00:51:15 +00:00
|
|
|
%tmp34 = tail call uint %llvm.bswap.i32( uint %tmp )
|
2006-11-29 05:00:14 +00:00
|
|
|
%tmp = seteq uint %tmp34, 1
|
|
|
|
ret bool %tmp
|
|
|
|
}
|
|
|
|
|
2007-04-02 00:51:15 +00:00
|
|
|
declare uint %llvm.bswap.i32(uint)
|
|
|
|
|
2006-11-29 05:00:14 +00:00
|
|
|
bool %test3(ulong %tmp) {
|
2007-04-02 00:51:15 +00:00
|
|
|
%tmp34 = tail call ulong %llvm.bswap.i64( ulong %tmp )
|
2006-11-29 05:00:14 +00:00
|
|
|
%tmp = seteq ulong %tmp34, 1
|
|
|
|
ret bool %tmp
|
|
|
|
}
|
|
|
|
|
2007-04-02 00:51:15 +00:00
|
|
|
declare ulong %llvm.bswap.i64(ulong)
|
2006-11-29 05:00:14 +00:00
|
|
|
|
2007-04-02 00:51:15 +00:00
|
|
|
declare ushort %llvm.bswap.i16(ushort)
|