[llvm] r289474 - [APFloatTest] Use std::make_tuple to make GCC 4.8 happy
Tim Shen via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 12 14:16:09 PST 2016
Author: timshen
Date: Mon Dec 12 16:16:08 2016
New Revision: 289474
URL: http://llvm.org/viewvc/llvm-project?rev=289474&view=rev
Log:
[APFloatTest] Use std::make_tuple to make GCC 4.8 happy
Differential Revision: https://reviews.llvm.org/D26817
Modified:
llvm/trunk/unittests/ADT/APFloatTest.cpp
Modified: llvm/trunk/unittests/ADT/APFloatTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/APFloatTest.cpp?rev=289474&r1=289473&r2=289474&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/APFloatTest.cpp (original)
+++ llvm/trunk/unittests/ADT/APFloatTest.cpp Mon Dec 12 16:16:08 2016
@@ -15,6 +15,7 @@
#include <cmath>
#include <ostream>
#include <string>
+#include <tuple>
using namespace llvm;
@@ -3176,24 +3177,26 @@ TEST(APFloatTest, PPCDoubleDoubleAddSpec
APFloat::fltCategory, APFloat::roundingMode>;
DataType Data[] = {
// (1 + 0) + (-1 + 0) = fcZero
- {0x3ff0000000000000ull, 0, 0xbff0000000000000ull, 0, APFloat::fcZero,
- APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x3ff0000000000000ull, 0, 0xbff0000000000000ull, 0,
+ APFloat::fcZero, APFloat::rmNearestTiesToEven),
// LDBL_MAX + (1.1 >> (1023 - 106) + 0)) = fcInfinity
- {0x7fefffffffffffffull, 0x7c8ffffffffffffeull, 0x7948000000000000ull,
- 0ull, APFloat::fcInfinity, APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x7fefffffffffffffull, 0x7c8ffffffffffffeull,
+ 0x7948000000000000ull, 0ull, APFloat::fcInfinity,
+ APFloat::rmNearestTiesToEven),
// TODO: change the 4th 0x75effffffffffffe to 0x75efffffffffffff when
// PPCDoubleDoubleImpl is gone.
// LDBL_MAX + (1.011111... >> (1023 - 106) + (1.1111111...0 >> (1023 -
// 160))) = fcNormal
- {0x7fefffffffffffffull, 0x7c8ffffffffffffeull, 0x7947ffffffffffffull,
- 0x75effffffffffffeull, APFloat::fcNormal, APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x7fefffffffffffffull, 0x7c8ffffffffffffeull,
+ 0x7947ffffffffffffull, 0x75effffffffffffeull,
+ APFloat::fcNormal, APFloat::rmNearestTiesToEven),
// LDBL_MAX + (1.1 >> (1023 - 106) + 0)) = fcInfinity
- {0x7fefffffffffffffull, 0x7c8ffffffffffffeull, 0x7fefffffffffffffull,
- 0x7c8ffffffffffffeull, APFloat::fcInfinity,
- APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x7fefffffffffffffull, 0x7c8ffffffffffffeull,
+ 0x7fefffffffffffffull, 0x7c8ffffffffffffeull,
+ APFloat::fcInfinity, APFloat::rmNearestTiesToEven),
// NaN + (1 + 0) = fcNaN
- {0x7ff8000000000000ull, 0, 0x3ff0000000000000ull, 0, APFloat::fcNaN,
- APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x7ff8000000000000ull, 0, 0x3ff0000000000000ull, 0,
+ APFloat::fcNaN, APFloat::rmNearestTiesToEven),
};
for (auto Tp : Data) {
@@ -3215,35 +3218,35 @@ TEST(APFloatTest, PPCDoubleDoubleAdd) {
uint64_t, APFloat::roundingMode>;
DataType Data[] = {
// (1 + 0) + (1e-105 + 0) = (1 + 1e-105)
- {0x3ff0000000000000ull, 0, 0x3960000000000000ull, 0,
- 0x3ff0000000000000ull, 0x3960000000000000ull,
- APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x3ff0000000000000ull, 0, 0x3960000000000000ull, 0,
+ 0x3ff0000000000000ull, 0x3960000000000000ull,
+ APFloat::rmNearestTiesToEven),
// (1 + 0) + (1e-106 + 0) = (1 + 1e-106)
- {0x3ff0000000000000ull, 0, 0x3950000000000000ull, 0,
- 0x3ff0000000000000ull, 0x3950000000000000ull,
- APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x3ff0000000000000ull, 0, 0x3950000000000000ull, 0,
+ 0x3ff0000000000000ull, 0x3950000000000000ull,
+ APFloat::rmNearestTiesToEven),
// (1 + 1e-106) + (1e-106 + 0) = (1 + 1e-105)
- {0x3ff0000000000000ull, 0x3950000000000000ull, 0x3950000000000000ull, 0,
- 0x3ff0000000000000ull, 0x3960000000000000ull,
- APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x3ff0000000000000ull, 0x3950000000000000ull,
+ 0x3950000000000000ull, 0, 0x3ff0000000000000ull,
+ 0x3960000000000000ull, APFloat::rmNearestTiesToEven),
// (1 + 0) + (epsilon + 0) = (1 + epsilon)
- {0x3ff0000000000000ull, 0, 0x0000000000000001ull, 0,
- 0x3ff0000000000000ull, 0x0000000000000001ull,
- APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x3ff0000000000000ull, 0, 0x0000000000000001ull, 0,
+ 0x3ff0000000000000ull, 0x0000000000000001ull,
+ APFloat::rmNearestTiesToEven),
// TODO: change 0xf950000000000000 to 0xf940000000000000, when
// PPCDoubleDoubleImpl is gone.
// (DBL_MAX - 1 << (1023 - 105)) + (1 << (1023 - 53) + 0) = DBL_MAX +
// 1.11111... << (1023 - 52)
- {0x7fefffffffffffffull, 0xf950000000000000ull, 0x7c90000000000000ull, 0,
- 0x7fefffffffffffffull, 0x7c8ffffffffffffeull,
- APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x7fefffffffffffffull, 0xf950000000000000ull,
+ 0x7c90000000000000ull, 0, 0x7fefffffffffffffull,
+ 0x7c8ffffffffffffeull, APFloat::rmNearestTiesToEven),
// TODO: change 0xf950000000000000 to 0xf940000000000000, when
// PPCDoubleDoubleImpl is gone.
// (1 << (1023 - 53) + 0) + (DBL_MAX - 1 << (1023 - 105)) = DBL_MAX +
// 1.11111... << (1023 - 52)
- {0x7c90000000000000ull, 0, 0x7fefffffffffffffull, 0xf950000000000000ull,
- 0x7fefffffffffffffull, 0x7c8ffffffffffffeull,
- APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x7c90000000000000ull, 0, 0x7fefffffffffffffull,
+ 0xf950000000000000ull, 0x7fefffffffffffffull,
+ 0x7c8ffffffffffffeull, APFloat::rmNearestTiesToEven),
};
for (auto Tp : Data) {
@@ -3266,13 +3269,13 @@ TEST(APFloatTest, PPCDoubleDoubleSubtrac
uint64_t, APFloat::roundingMode>;
DataType Data[] = {
// (1 + 0) - (-1e-105 + 0) = (1 + 1e-105)
- {0x3ff0000000000000ull, 0, 0xb960000000000000ull, 0,
- 0x3ff0000000000000ull, 0x3960000000000000ull,
- APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x3ff0000000000000ull, 0, 0xb960000000000000ull, 0,
+ 0x3ff0000000000000ull, 0x3960000000000000ull,
+ APFloat::rmNearestTiesToEven),
// (1 + 0) - (-1e-106 + 0) = (1 + 1e-106)
- {0x3ff0000000000000ull, 0, 0xb950000000000000ull, 0,
- 0x3ff0000000000000ull, 0x3950000000000000ull,
- APFloat::rmNearestTiesToEven},
+ std::make_tuple(0x3ff0000000000000ull, 0, 0xb950000000000000ull, 0,
+ 0x3ff0000000000000ull, 0x3950000000000000ull,
+ APFloat::rmNearestTiesToEven),
};
for (auto Tp : Data) {
More information about the llvm-commits
mailing list