<div dir="ltr">Could it expose a problem of Log2_64 on BE systems?<div><br></div><div>David</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 24, 2015 at 4:39 PM, Hal Finkel via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Nathan,<br>
<br>
FYI: These tests are failing on my big-Endian PowerPC (P7) system (compiled with GCC 4.8.2). I see no problems with a self-hosted build (and looking over the commit, I can see nothing wrong with it either).<br>
<br>
I don't think it is worth reverting over a PPC64/4.8.2 miscompile, but I'll let you know when I try with a newer GCC version.<br>
<br>
Note: Google Test filter = MathExtras.SaturatingMultiply<br>
[==========] Running 1 test from 1 test case.<br>
[----------] Global test environment set-up.<br>
[----------] 1 test from MathExtras<br>
[ RUN      ] MathExtras.SaturatingMultiply<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 98303<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 98303<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 245759<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 245759<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 516095<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 516095<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 1044479<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 1044479<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 2095103<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 2095103<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 4193279<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 4193279<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 8388095<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 8388095<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 16776959<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 16776959<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 33554303<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 33554303<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 67108799<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 67108799<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 134217695<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 134217695<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 268435439<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 268435439<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 536870903<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 536870903<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 1073741819<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 1073741819<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:288: Failure<br>
Value of: SaturatingMultiply(X, Y)<br>
  Actual: 2147483645<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:289: Failure<br>
Value of: SaturatingMultiply(X, Y, ResultOverflowed)<br>
  Actual: 2147483645<br>
Expected: Max<br>
Which is: 4294967295<br>
/src/llvm/unittests/Support/MathExtrasTest.cpp:290: Failure<br>
Value of: ResultOverflowed<br>
  Actual: false<br>
Expected: true<br>
[  FAILED  ] MathExtras.SaturatingMultiply (8 ms)<br>
[----------] 1 test from MathExtras (8 ms total)<br>
<br>
[----------] Global test environment tear-down<br>
[==========] 1 test from 1 test case ran. (8 ms total)<br>
[  PASSED  ] 0 tests.<br>
[  FAILED  ] 1 test, listed below:<br>
[  FAILED  ] MathExtras.SaturatingMultiply<br>
<br>
 1 FAILED TEST<br>
<br>
********************<br>
Testing Time: 111.43s<br>
********************<br>
Failing Tests (1):<br>
    LLVM-Unit :: Support/Release+Asserts/SupportTests/MathExtras.SaturatingMultiply<br>
<br>
 -Hal<br>
<div class="HOEnZb"><div class="h5"><br>
----- Original Message -----<br>
> From: "Nathan Slingerland via llvm-commits" <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>><br>
> To: <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> Sent: Monday, November 23, 2015 3:54:23 PM<br>
> Subject: [llvm] r253921 - [Support] Add optional argument to SaturatingAdd() and SaturatingMultiply() to indicate<br>
> that overflow occurred<br>
><br>
> Author: slingn<br>
> Date: Mon Nov 23 15:54:22 2015<br>
> New Revision: 253921<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=253921&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=253921&view=rev</a><br>
> Log:<br>
> [Support] Add optional argument to SaturatingAdd() and<br>
> SaturatingMultiply() to indicate that overflow occurred<br>
><br>
> Summary: Adds the ability for callers to detect when saturation<br>
> occurred on the result of saturating addition/multiplication.<br>
><br>
> Reviewers: davidxl, silvas, rsmith<br>
><br>
> Subscribers: llvm-commits<br>
><br>
> Differential Revision: <a href="http://reviews.llvm.org/D14931" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14931</a><br>
><br>
> Modified:<br>
>     llvm/trunk/include/llvm/Support/MathExtras.h<br>
>     llvm/trunk/unittests/Support/MathExtrasTest.cpp<br>
><br>
> Modified: llvm/trunk/include/llvm/Support/MathExtras.h<br>
> URL:<br>
> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MathExtras.h?rev=253921&r1=253920&r2=253921&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/MathExtras.h?rev=253921&r1=253920&r2=253921&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/Support/MathExtras.h (original)<br>
> +++ llvm/trunk/include/llvm/Support/MathExtras.h Mon Nov 23 15:54:22<br>
> 2015<br>
> @@ -655,46 +655,79 @@ inline int64_t SignExtend64(uint64_t X,<br>
><br>
>  /// \brief Add two unsigned integers, X and Y, of type T.<br>
>  /// Clamp the result to the maximum representable value of T on<br>
>  overflow.<br>
> +/// ResultOverflowed indicates if the result is larger than the<br>
> maximum<br>
> +/// representable value of type T.<br>
>  template <typename T><br>
>  typename std::enable_if<std::is_unsigned<T>::value, T>::type<br>
> -SaturatingAdd(T X, T Y) {<br>
> +SaturatingAdd(T X, T Y, bool &ResultOverflowed) {<br>
>    // Hacker's Delight, p. 29<br>
>    T Z = X + Y;<br>
> -  if (Z < X || Z < Y)<br>
> +  ResultOverflowed = (Z < X || Z < Y);<br>
> +  if (ResultOverflowed)<br>
>      return std::numeric_limits<T>::max();<br>
>    else<br>
>      return Z;<br>
>  }<br>
><br>
> +/// \brief Add two unsigned integers, X and Y, of type T.<br>
> +/// Clamp the result to the maximum representable value of T on<br>
> overflow.<br>
> +template <typename T><br>
> +typename std::enable_if<std::is_unsigned<T>::value, T>::type<br>
> +SaturatingAdd(T X, T Y) {<br>
> +  bool ResultOverflowed;<br>
> +  return SaturatingAdd(X, Y, ResultOverflowed);<br>
> +}<br>
> +<br>
>  /// \brief Multiply two unsigned integers, X and Y, of type T.<br>
>  /// Clamp the result to the maximum representable value of T on<br>
>  overflow.<br>
> +/// ResultOverflowed indicates if the result is larger than the<br>
> maximum<br>
> +/// representable value of type T.<br>
>  template <typename T><br>
>  typename std::enable_if<std::is_unsigned<T>::value, T>::type<br>
> -SaturatingMultiply(T X, T Y) {<br>
> +SaturatingMultiply(T X, T Y, bool &ResultOverflowed) {<br>
>    // Hacker's Delight, p. 30 has a different algorithm, but we don't<br>
>    use that<br>
>    // because it fails for uint16_t (where multiplication can have<br>
>    undefined<br>
>    // behavior due to promotion to int), and requires a division in<br>
>    addition<br>
>    // to the multiplication.<br>
><br>
> +  ResultOverflowed = false;<br>
> +<br>
>    // Log2(Z) would be either Log2Z or Log2Z + 1.<br>
>    // Special case: if X or Y is 0, Log2_64 gives -1, and Log2Z<br>
>    // will necessarily be less than Log2Max as desired.<br>
>    int Log2Z = Log2_64(X) + Log2_64(Y);<br>
>    const T Max = std::numeric_limits<T>::max();<br>
>    int Log2Max = Log2_64(Max);<br>
> -  if (Log2Z < Log2Max)<br>
> +  if (Log2Z < Log2Max) {<br>
>      return X * Y;<br>
> -  if (Log2Z > Log2Max)<br>
> +  }<br>
> +  if (Log2Z > Log2Max) {<br>
> +    ResultOverflowed = true;<br>
>      return Max;<br>
> +  }<br>
><br>
>    // We're going to use the top bit, and maybe overflow one<br>
>    // bit past it. Multiply all but the bottom bit then add<br>
>    // that on at the end.<br>
>    T Z = (X >> 1) * Y;<br>
> -  if (Z & ~(Max >> 1))<br>
> +  if (Z & ~(Max >> 1)) {<br>
> +    ResultOverflowed = true;<br>
>      return Max;<br>
> +  }<br>
>    Z <<= 1;<br>
> -  return (X & 1) ? SaturatingAdd(Z, Y) : Z;<br>
> +  if (X & 1)<br>
> +    return SaturatingAdd(Z, Y, ResultOverflowed);<br>
> +<br>
> +  return Z;<br>
> +}<br>
> +<br>
> +/// \brief Multiply two unsigned integers, X and Y, of type T.<br>
> +/// Clamp the result to the maximum representable value of T on<br>
> overflow.<br>
> +template <typename T><br>
> +typename std::enable_if<std::is_unsigned<T>::value, T>::type<br>
> +SaturatingMultiply(T X, T Y) {<br>
> +  bool ResultOverflowed;<br>
> +  return SaturatingMultiply(X, Y, ResultOverflowed);<br>
>  }<br>
><br>
>  extern const float huge_valf;<br>
><br>
> Modified: llvm/trunk/unittests/Support/MathExtrasTest.cpp<br>
> URL:<br>
> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/MathExtrasTest.cpp?rev=253921&r1=253920&r2=253921&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/MathExtrasTest.cpp?rev=253921&r1=253920&r2=253921&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/unittests/Support/MathExtrasTest.cpp (original)<br>
> +++ llvm/trunk/unittests/Support/MathExtrasTest.cpp Mon Nov 23<br>
> 15:54:22 2015<br>
> @@ -194,10 +194,27 @@ template<typename T><br>
>  void SaturatingAddTestHelper()<br>
>  {<br>
>    const T Max = std::numeric_limits<T>::max();<br>
> +  bool ResultOverflowed;<br>
> +<br>
>    EXPECT_EQ(T(3), SaturatingAdd(T(1), T(2)));<br>
> +  EXPECT_EQ(T(3), SaturatingAdd(T(1), T(2), ResultOverflowed));<br>
> +  EXPECT_FALSE(ResultOverflowed);<br>
> +<br>
>    EXPECT_EQ(Max, SaturatingAdd(Max, T(1)));<br>
> +  EXPECT_EQ(Max, SaturatingAdd(Max, T(1), ResultOverflowed));<br>
> +  EXPECT_TRUE(ResultOverflowed);<br>
> +<br>
> +  EXPECT_EQ(Max, SaturatingAdd(T(1), T(Max - 1)));<br>
> +  EXPECT_EQ(Max, SaturatingAdd(T(1), T(Max - 1), ResultOverflowed));<br>
> +  EXPECT_FALSE(ResultOverflowed);<br>
> +<br>
>    EXPECT_EQ(Max, SaturatingAdd(T(1), Max));<br>
> +  EXPECT_EQ(Max, SaturatingAdd(T(1), Max, ResultOverflowed));<br>
> +  EXPECT_TRUE(ResultOverflowed);<br>
> +<br>
>    EXPECT_EQ(Max, SaturatingAdd(Max, Max));<br>
> +  EXPECT_EQ(Max, SaturatingAdd(Max, Max, ResultOverflowed));<br>
> +  EXPECT_TRUE(ResultOverflowed);<br>
>  }<br>
><br>
>  TEST(MathExtras, SaturatingAdd) {<br>
> @@ -211,22 +228,50 @@ template<typename T><br>
>  void SaturatingMultiplyTestHelper()<br>
>  {<br>
>    const T Max = std::numeric_limits<T>::max();<br>
> +  bool ResultOverflowed;<br>
><br>
>    // Test basic multiplication.<br>
>    EXPECT_EQ(T(6), SaturatingMultiply(T(2), T(3)));<br>
> +  EXPECT_EQ(T(6), SaturatingMultiply(T(2), T(3), ResultOverflowed));<br>
> +  EXPECT_FALSE(ResultOverflowed);<br>
> +<br>
>    EXPECT_EQ(T(6), SaturatingMultiply(T(3), T(2)));<br>
> +  EXPECT_EQ(T(6), SaturatingMultiply(T(3), T(2), ResultOverflowed));<br>
> +  EXPECT_FALSE(ResultOverflowed);<br>
><br>
>    // Test multiplication by zero.<br>
>    EXPECT_EQ(T(0), SaturatingMultiply(T(0), T(0)));<br>
> +  EXPECT_EQ(T(0), SaturatingMultiply(T(0), T(0), ResultOverflowed));<br>
> +  EXPECT_FALSE(ResultOverflowed);<br>
> +<br>
>    EXPECT_EQ(T(0), SaturatingMultiply(T(1), T(0)));<br>
> +  EXPECT_EQ(T(0), SaturatingMultiply(T(1), T(0), ResultOverflowed));<br>
> +  EXPECT_FALSE(ResultOverflowed);<br>
> +<br>
>    EXPECT_EQ(T(0), SaturatingMultiply(T(0), T(1)));<br>
> +  EXPECT_EQ(T(0), SaturatingMultiply(T(0), T(1), ResultOverflowed));<br>
> +  EXPECT_FALSE(ResultOverflowed);<br>
> +<br>
>    EXPECT_EQ(T(0), SaturatingMultiply(Max, T(0)));<br>
> +  EXPECT_EQ(T(0), SaturatingMultiply(Max, T(0), ResultOverflowed));<br>
> +  EXPECT_FALSE(ResultOverflowed);<br>
> +<br>
>    EXPECT_EQ(T(0), SaturatingMultiply(T(0), Max));<br>
> +  EXPECT_EQ(T(0), SaturatingMultiply(T(0), Max, ResultOverflowed));<br>
> +  EXPECT_FALSE(ResultOverflowed);<br>
><br>
>    // Test multiplication by maximum value.<br>
>    EXPECT_EQ(Max, SaturatingMultiply(Max, T(2)));<br>
> -  EXPECT_EQ(Max, SaturatingMultiply(T(2),Max));<br>
> +  EXPECT_EQ(Max, SaturatingMultiply(Max, T(2), ResultOverflowed));<br>
> +  EXPECT_TRUE(ResultOverflowed);<br>
> +<br>
> +  EXPECT_EQ(Max, SaturatingMultiply(T(2), Max));<br>
> +  EXPECT_EQ(Max, SaturatingMultiply(T(2), Max, ResultOverflowed));<br>
> +  EXPECT_TRUE(ResultOverflowed);<br>
> +<br>
>    EXPECT_EQ(Max, SaturatingMultiply(Max, Max));<br>
> +  EXPECT_EQ(Max, SaturatingMultiply(Max, Max, ResultOverflowed));<br>
> +  EXPECT_TRUE(ResultOverflowed);<br>
><br>
>    // Test interesting boundary conditions for algorithm -<br>
>    // ((1 << A) - 1) * ((1 << B) + K) for K in [-1, 0, 1]<br>
> @@ -241,8 +286,12 @@ void SaturatingMultiplyTestHelper()<br>
><br>
>        if(OverflowExpected) {<br>
>          EXPECT_EQ(Max, SaturatingMultiply(X, Y));<br>
> +        EXPECT_EQ(Max, SaturatingMultiply(X, Y, ResultOverflowed));<br>
> +        EXPECT_TRUE(ResultOverflowed);<br>
>        } else {<br>
>          EXPECT_EQ(X * Y, SaturatingMultiply(X, Y));<br>
> +        EXPECT_EQ(X * Y, SaturatingMultiply(X, Y,<br>
> ResultOverflowed));<br>
> +        EXPECT_FALSE(ResultOverflowed);<br>
>        }<br>
>      }<br>
>    }<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
><br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div>