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