From e5ff22e605d08b02f11394dfd7e71c0b25f256dd Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 10 Jul 2006 20:25:01 +0000 Subject: [PATCH] Add tests for 16-bit byteswaps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29086 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/InstCombine/bswap.ll | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/Transforms/InstCombine/bswap.ll b/test/Transforms/InstCombine/bswap.ll index 75cfc1daed0..6f434e3f278 100644 --- a/test/Transforms/InstCombine/bswap.ll +++ b/test/Transforms/InstCombine/bswap.ll @@ -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 ; [#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 +} + -- 2.34.1