aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-08-03 18:27:17 +0000
committerNate Begeman <natebegeman@mac.com>2005-08-03 18:27:17 +0000
commit1b0674c9664b88c24324082cd43280c97ffddeda (patch)
tree62f811b39da4a3a436d5c6e114c6681cec215f4e
parent2bbcca30b74e7e3cdd41932438e891745866a0eb (diff)
Add a couple rlwinm tests for bitfield clears
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22624 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/CodeGen/PowerPC/rlwinm.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/rlwinm.ll b/test/CodeGen/PowerPC/rlwinm.ll
new file mode 100644
index 0000000000..54cf82e1a2
--- /dev/null
+++ b/test/CodeGen/PowerPC/rlwinm.ll
@@ -0,0 +1,17 @@
+; All of these ands and shifts should be folded into rlwimi's
+; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | not grep and &&
+; RUN: llvm-as < rlwinm.ll | llc -march=ppc32 | grep rlwinm | wc -l | grep 2
+
+implementation ; Functions:
+
+int %test1(int %a) {
+entry:
+ %tmp.1 = and int %a, 268431360 ; <int> [#uses=1]
+ ret int %tmp.1
+}
+
+int %test2(int %a) {
+entry:
+ %tmp.1 = and int %a, -268435441 ; <int> [#uses=1]
+ ret int %tmp.1
+}