diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-10-14 00:30:00 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-10-14 00:30:00 +0000 |
| commit | b9681ad442c32aec560c4db3a4bc7a59d018f87e (patch) | |
| tree | bc272a84ee25254ae075ebffaf5b02ada83555f8 | |
| parent | c7bd5740eb6f9414965282c08af3f36ad57a0726 (diff) | |
| download | bcm5719-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.cpp | 4 | ||||
| -rw-r--r-- | llvm/test/Transforms/ConstProp/overflow-ops.ll | 3 |
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} |

