mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 11:59:56 +00:00
Reapply 74494, this time removing the conflicting definition of operator<<
in APIntTest.cpp. llvm-svn: 74550
This commit is contained in:
parent
aad223dd8a
commit
148d3bb9b4
@ -1426,6 +1426,8 @@ inline raw_ostream &operator<<(raw_ostream &OS, const APInt &I) {
|
||||
return OS;
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &o, const APInt &I);
|
||||
|
||||
namespace APIntOps {
|
||||
|
||||
/// @brief Determine the smaller of two APInts considered to be signed.
|
||||
|
@ -2178,6 +2178,12 @@ void APInt::print(raw_ostream &OS, bool isSigned) const {
|
||||
OS << S.c_str();
|
||||
}
|
||||
|
||||
std::ostream &llvm::operator<<(std::ostream &o, const APInt &I) {
|
||||
raw_os_ostream OS(o);
|
||||
OS << I;
|
||||
return o;
|
||||
}
|
||||
|
||||
// This implements a variety of operations on a representation of
|
||||
// arbitrary precision, two's-complement, bignum integer values.
|
||||
|
||||
|
@ -17,19 +17,6 @@ using namespace llvm;
|
||||
|
||||
namespace {
|
||||
|
||||
// Make the Google Test failure output equivalent to APInt::dump()
|
||||
std::ostream& operator<<(std::ostream &OS, const llvm::APInt& I) {
|
||||
llvm::raw_os_ostream raw_os(OS);
|
||||
|
||||
SmallString<40> S, U;
|
||||
I.toStringUnsigned(U);
|
||||
I.toStringSigned(S);
|
||||
raw_os << "APInt(" << I.getBitWidth()<< "b, "
|
||||
<< U.c_str() << "u " << S.c_str() << "s)";
|
||||
raw_os.flush();
|
||||
return OS;
|
||||
}
|
||||
|
||||
// Test that APInt shift left works when bitwidth > 64 and shiftamt == 0
|
||||
TEST(APIntTest, ShiftLeftByZero) {
|
||||
APInt One = APInt::getNullValue(65) + 1;
|
||||
|
Loading…
Reference in New Issue
Block a user