From: Chris Lattner Date: Thu, 14 Oct 2010 00:30:00 +0000 (+0000) Subject: fix a bug I introduced, no idea how this didn't repro right. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=a5bbde8efd9710e5daecee69ff48722e637a35b7;p=oota-llvm.git fix a bug I introduced, no idea how this didn't repro right. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116462 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp index 3807314bac4..88f9ac63f7e 100644 --- a/lib/Support/APInt.cpp +++ b/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/test/Transforms/ConstProp/overflow-ops.ll b/test/Transforms/ConstProp/overflow-ops.ll index 50dc20566de..5587e9b6233 100644 --- a/test/Transforms/ConstProp/overflow-ops.ll +++ b/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}