Add tests for 16-bit byteswaps.

llvm-svn: 29086
This commit is contained in:
Chris Lattner 2006-07-10 20:25:01 +00:00
parent 9aabc1e16f
commit 3f8aee5fdf
1 changed files with 15 additions and 1 deletions

View File

@ -1,4 +1,4 @@
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'call.*llvm.bswap' | wc -l | grep 2
; RUN: llvm-as < %s | opt -instcombine | llvm-dis | grep 'call.*llvm.bswap' | wc -l | grep 4
uint %test1(uint %i) {
%tmp1 = shr uint %i, ubyte 24 ; <uint> [#uses=1]
@ -26,3 +26,17 @@ uint %test2(uint %arg) {
ret uint %tmp14
}
ushort %test3(ushort %s) {
%tmp2 = shr ushort %s, ubyte 8
%tmp4 = shl ushort %s, ubyte 8
%tmp5 = or ushort %tmp2, %tmp4
ret ushort %tmp5
}
ushort %test4(ushort %s) {
%tmp2 = shr ushort %s, ubyte 8
%tmp4 = shl ushort %s, ubyte 8
%tmp5 = or ushort %tmp4, %tmp2
ret ushort %tmp5
}