aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll')
-rw-r--r--test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll b/test/Transforms/InstCombine/2006-11-10-ashr-miscompile.ll
new file mode 100644
index 0000000..7799423
--- /dev/null
+++ b/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
+}
+