Fix bogus overflow checks by replacing them with actual
overflow checks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71284 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/ScalarEvolution/div-overflow.ll b/test/Analysis/ScalarEvolution/div-overflow.ll
new file mode 100644
index 0000000..cb64b85
--- /dev/null
+++ b/test/Analysis/ScalarEvolution/div-overflow.ll
@@ -0,0 +1,10 @@
+; RUN: llvm-as < %s | opt -scalar-evolution -analyze -disable-output \
+; RUN: | grep {\\--> ((-128 \\* %a) /u -128)}
+
+; Don't let ScalarEvolution fold this div away.
+
+define i8 @foo(i8 %a) {
+ %t0 = shl i8 %a, 7
+ %t1 = lshr i8 %t0, 7
+ ret i8 %t1
+}