summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-10-14 00:30:00 +0000
committerChris Lattner <sabre@nondot.org>2010-10-14 00:30:00 +0000
commitb9681ad442c32aec560c4db3a4bc7a59d018f87e (patch)
treebc272a84ee25254ae075ebffaf5b02ada83555f8
parentc7bd5740eb6f9414965282c08af3f36ad57a0726 (diff)
downloadbcm5719-llvm-b9681ad442c32aec560c4db3a4bc7a59d018f87e.tar.gz
bcm5719-llvm-b9681ad442c32aec560c4db3a4bc7a59d018f87e.zip
fix a bug I introduced, no idea how this didn't repro right.
llvm-svn: 116462
-rw-r--r--llvm/lib/Support/APInt.cpp4
-rw-r--r--llvm/test/Transforms/ConstProp/overflow-ops.ll3
2 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 3807314bac4..88f9ac63f7e 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -2067,8 +2067,8 @@ APInt APInt::ssub_ov(const APInt &RHS, bool &Overflow) const {
}
APInt APInt::usub_ov(const APInt &RHS, bool &Overflow) const {
- APInt Res = *this+RHS;
- Overflow = Res.ugt(RHS);
+ APInt Res = *this-RHS;
+ Overflow = Res.ugt(*this);
return Res;
}
diff --git a/llvm/test/Transforms/ConstProp/overflow-ops.ll b/llvm/test/Transforms/ConstProp/overflow-ops.ll
index 50dc20566de..5587e9b6233 100644
--- a/llvm/test/Transforms/ConstProp/overflow-ops.ll
+++ b/llvm/test/Transforms/ConstProp/overflow-ops.ll
@@ -1,5 +1,4 @@
-; RUN: true
-; opt < %s -constprop -S | FileCheck %s
+; RUN: opt < %s -constprop -S | FileCheck %s
%i8i1 = type {i8, i1}
OpenPOWER on IntegriCloud