summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2011-05-23 21:07:39 +0000
committerDan Gohman <gohman@apple.com>2011-05-23 21:07:39 +0000
commit1b58d4536a561f28bf935dcb29b483c52a6bf4c6 (patch)
tree80e36c471ebb01345cc1c381f1c526c8f9af5546 /test/CodeGen/X86
parent95ae09afdedcb8de3d20307c7ee924079d12c68a (diff)
downloadllvm-1b58d4536a561f28bf935dcb29b483c52a6bf4c6.tar.gz
llvm-1b58d4536a561f28bf935dcb29b483c52a6bf4c6.tar.bz2
llvm-1b58d4536a561f28bf935dcb29b483c52a6bf4c6.tar.xz
When checking for signed multiplication overflow, watch out for INT_MIN and -1.
This fixes PR9845. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131919 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86')
-rw-r--r--test/CodeGen/X86/lsr-overflow.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/X86/lsr-overflow.ll b/test/CodeGen/X86/lsr-overflow.ll
index 5bc4f7e96a..09c1c07ef3 100644
--- a/test/CodeGen/X86/lsr-overflow.ll
+++ b/test/CodeGen/X86/lsr-overflow.ll
@@ -25,3 +25,21 @@ __ABContainsLabel.exit:
%cmp = icmp eq i64 %indvar, 9223372036854775807
ret i1 %cmp
}
+
+define void @func_37() noreturn nounwind readonly {
+entry:
+ br label %for.body
+
+for.body: ; preds = %for.inc8, %entry
+ %indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.inc8 ]
+ %sub.i = add i64 undef, %indvar
+ %cmp.i = icmp eq i64 %sub.i, -9223372036854775808
+ br i1 undef, label %for.inc8, label %for.cond4
+
+for.cond4: ; preds = %for.cond4, %for.body
+ br label %for.cond4
+
+for.inc8: ; preds = %for.body
+ %indvar.next = add i64 %indvar, 1
+ br label %for.body
+}