summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/CodeGen/PowerPC/and_add.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/and_add.ll b/test/CodeGen/PowerPC/and_add.ll
new file mode 100644
index 00000000000..c2293c25f32
--- /dev/null
+++ b/test/CodeGen/PowerPC/and_add.ll
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=ppc32 | grep slwi &&
+; RUN: llvm-as < %s | llc -march=ppc32 | not grep addi &&
+; RUN: llvm-as < %s | llc -march=ppc32 | not grep rlwinm
+
+int %test(int %A) {
+ %B = mul int %A, 8 ;; shift
+ %C = add int %B, 7 ;; dead, no demanded bits.
+ %D = and int %C, -8 ;; dead once add is gone.
+ ret int %D
+}
+