From 8bd9897730f5f2c238876ac407054c346dd46a21 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Tue, 13 Jan 2015 14:30:07 +0000 Subject: [PATCH] Silence warnings about unknown pragmas for compilers that are not Clang. NFC. llvm-svn: 225788 --- llvm/unittests/ADT/APIntTest.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/unittests/ADT/APIntTest.cpp b/llvm/unittests/ADT/APIntTest.cpp index 9f063ccf8879..a6578869022e 100644 --- a/llvm/unittests/ADT/APIntTest.cpp +++ b/llvm/unittests/ADT/APIntTest.cpp @@ -678,9 +678,11 @@ TEST(APIntTest, nearestLogBase2) { EXPECT_EQ(A9.nearestLogBase2(), UINT32_MAX); } +#if defined(__clang__) // Disable the warning that triggers on exactly what is being tested. #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wself-move" +#endif TEST(APIntTest, SelfMoveAssignment) { APInt X(32, 0xdeadbeef); X = std::move(X); @@ -697,6 +699,7 @@ TEST(APIntTest, SelfMoveAssignment) { EXPECT_EQ(0xdeadbeefdeadbeefULL, Raw[0]); EXPECT_EQ(0xdeadbeefdeadbeefULL, Raw[1]); } +#if defined(__clang__) #pragma clang diagnostic pop - +#endif }