summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll b/llvm/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll
new file mode 100644
index 00000000000..7799423f04f
--- /dev/null
+++ b/llvm/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll
@@ -0,0 +1,9 @@
+; RUN: opt < %s -instcombine -S | grep lshr
+; Verify this is not turned into -1.
+
+define i32 @test(i8 %amt) {
+ %shift.upgrd.1 = zext i8 %amt to i32 ; <i32> [#uses=1]
+ %B = lshr i32 -1, %shift.upgrd.1 ; <i32> [#uses=1]
+ ret i32 %B
+}
+
OpenPOWER on IntegriCloud