1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00
Vitaly Buka 2020-08-20 04:12:49 -07:00
parent e7c1ab412e
commit 8be4d9ede0
2 changed files with 6 additions and 5 deletions

View File

@ -765,8 +765,8 @@ public:
/// Move assignment operator.
APInt &operator=(APInt &&that) {
#ifdef _MSC_VER
// The MSVC std::shuffle implementation still does self-assignment.
#ifdef EXPENSIVE_CHECKS
// Some std::shuffle implementations still do self-assignment.
if (this == &that)
return *this;
#endif

View File

@ -1783,8 +1783,9 @@ TEST(APIntTest, isShiftedMask) {
}
}
// Test that self-move works, but only when we're using MSVC.
#if defined(_MSC_VER)
// Test that self-move works with EXPENSIVE_CHECKS. It calls std::shuffle which
// does self-move on some platforms.
#ifdef EXPENSIVE_CHECKS
#if defined(__clang__)
// Disable the pragma warning from versions of Clang without -Wself-move
#pragma clang diagnostic push
@ -1813,7 +1814,7 @@ TEST(APIntTest, SelfMoveAssignment) {
#pragma clang diagnostic pop
#pragma clang diagnostic pop
#endif
#endif // _MSC_VER
#endif // EXPENSIVE_CHECKS
TEST(APIntTest, byteSwap) {
EXPECT_EQ(0x00000000, APInt(16, 0x0000).byteSwap());