[compiler-rt] 83539d7 - Fix msan/tests/msan_test.cpp due to -Wbitwise-instead-of-logical

Amy Kwan via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 4 10:58:27 PDT 2021


Author: Amy Kwan
Date: 2021-10-04T12:58:12-05:00
New Revision: 83539d73f9870c7c44575da6a16788aa55c5c25a

URL: https://github.com/llvm/llvm-project/commit/83539d73f9870c7c44575da6a16788aa55c5c25a
DIFF: https://github.com/llvm/llvm-project/commit/83539d73f9870c7c44575da6a16788aa55c5c25a.diff

LOG: Fix msan/tests/msan_test.cpp due to -Wbitwise-instead-of-logical

The LE Power sanitizer bot fails when testing standalone compiler-rt due to
an MSAN test warning introduced by -Wbitwise-instead-of-logical. As this option
along with -Werror is enabled on the bot, the test failure occurs.
This patch updates msan_test.cpp to fix the warning introduced by the
-Wbitwise-instead-of-logical.

Added: 
    

Modified: 
    compiler-rt/lib/msan/tests/msan_test.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/msan/tests/msan_test.cpp b/compiler-rt/lib/msan/tests/msan_test.cpp
index 039da3cafe66c..81794361213f5 100644
--- a/compiler-rt/lib/msan/tests/msan_test.cpp
+++ b/compiler-rt/lib/msan/tests/msan_test.cpp
@@ -413,7 +413,7 @@ TEST(MemorySanitizer, AndOr) {
   EXPECT_POISONED(*p | 0x0000ffff);
   EXPECT_POISONED(*p | 0xffff0000);
 
-  EXPECT_POISONED(*GetPoisoned<bool>() & *GetPoisoned<bool>());
+  EXPECT_POISONED((int)*GetPoisoned<bool>() & (int)*GetPoisoned<bool>());
 }
 
 template<class T>


        


More information about the llvm-commits mailing list