aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-14 07:45:36 +0000
committerChris Lattner <sabre@nondot.org>2006-11-14 07:45:36 +0000
commit9961cf1fed0ab71cf4a7cfd8646e474c2c1ef480 (patch)
treec4c9561b291c8e203a4d326e2ef5c9da622870ce
parent9c2328e5a9cc0bc0beb4222e2dc18153670b4748 (diff)
new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31728 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Transforms/InstCombine/shift-simplify.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/shift-simplify.ll b/test/Transforms/InstCombine/shift-simplify.ll
new file mode 100644
index 0000000000..b91637f7c4
--- /dev/null
+++ b/test/Transforms/InstCombine/shift-simplify.ll
@@ -0,0 +1,22 @@
+; RUN: llvm-as < %s | opt -instcombine | llvm-dis | egrep 'shl|lshr|ashr' | wc -l | grep 3
+
+int %test0(int %A, int %B, ubyte %C) {
+ %X = shl int %A, ubyte %C
+ %Y = shl int %B, ubyte %C
+ %Z = and int %X, %Y
+ ret int %Z
+}
+
+int %test1(int %A, int %B, ubyte %C) {
+ %X = lshr int %A, ubyte %C
+ %Y = lshr int %B, ubyte %C
+ %Z = or int %X, %Y
+ ret int %Z
+}
+
+int %test2(int %A, int %B, ubyte %C) {
+ %X = ashr int %A, ubyte %C
+ %Y = ashr int %B, ubyte %C
+ %Z = xor int %X, %Y
+ ret int %Z
+}