Index: lib/msan/tests/msan_test.cc =================================================================== --- lib/msan/tests/msan_test.cc +++ lib/msan/tests/msan_test.cc @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -2391,11 +2392,19 @@ // Test that shadow is propagated through pointer-to-integer conversion. void* p = (void*)0xABCD; __msan_poison(((char*)&p) + 1, sizeof(p)); +#if BYTE_ORDER == __LITTLE_ENDIAN EXPECT_NOT_POISONED((((uintptr_t)p) & 0xFF) == 0); +#else + EXPECT_NOT_POISONED((((uintptr_t)p) & 0xFF00000000000000) == 0); +#endif void* q = (void*)0xABCD; __msan_poison(&q, sizeof(q) - 1); +#if BYTE_ORDER == __LITTLE_ENDIAN EXPECT_POISONED((((uintptr_t)q) & 0xFF) == 0); +#else + EXPECT_POISONED((((uintptr_t)q) & 0xFFFFFFFFFFFFFF00) == 0); +#endif } static void vaargsfn2(int guard, ...) {