summaryrefslogtreecommitdiff
path: root/test/CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll')
-rw-r--r--test/CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll b/test/CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll
new file mode 100644
index 0000000000000..54f24c612660e
--- /dev/null
+++ b/test/CodeGen/PowerPC/2005-10-08-ArithmeticRotate.ll
@@ -0,0 +1,11 @@
+; This was erroneously being turned into an rlwinm instruction.
+; The sign bit does matter in this case.
+
+; RUN: llvm-as < %s | llc -march=ppc32 | grep srawi
+
+define i32 @test(i32 %X) {
+ %Y = and i32 %X, -2 ; <i32> [#uses=1]
+ %Z = ashr i32 %Y, 11 ; <i32> [#uses=1]
+ ret i32 %Z
+}
+