llvm.org GIT mirror llvm / 38a253d
Reapply 74494, this time removing the conflicting definition of operator<< in APIntTest.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74550 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 10 years ago
3 changed file(s) with 8 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
14251425 return OS;
14261426 }
14271427
1428 std::ostream &operator<<(std::ostream &o, const APInt &I);
1429
14281430 namespace APIntOps {
14291431
14301432 /// @brief Determine the smaller of two APInts considered to be signed.
21772177 OS << S.c_str();
21782178 }
21792179
2180 std::ostream &llvm::operator<<(std::ostream &o, const APInt &I) {
2181 raw_os_ostream OS(o);
2182 OS << I;
2183 return o;
2184 }
2185
21802186 // This implements a variety of operations on a representation of
21812187 // arbitrary precision, two's-complement, bignum integer values.
21822188
1515 using namespace llvm;
1616
1717 namespace {
18
19 // Make the Google Test failure output equivalent to APInt::dump()
20 std::ostream& operator<<(std::ostream &OS, const llvm::APInt& I) {
21 llvm::raw_os_ostream raw_os(OS);
22
23 SmallString<40> S, U;
24 I.toStringUnsigned(U);
25 I.toStringSigned(S);
26 raw_os << "APInt(" << I.getBitWidth()<< "b, "
27 << U.c_str() << "u " << S.c_str() << "s)";
28 raw_os.flush();
29 return OS;
30 }
3118
3219 // Test that APInt shift left works when bitwidth > 64 and shiftamt == 0
3320 TEST(APIntTest, ShiftLeftByZero) {