diff --git a/libcxx/test/std/numerics/bit/bit.cast/bit_cast.pass.cpp b/libcxx/test/std/numerics/bit/bit.cast/bit_cast.pass.cpp --- a/libcxx/test/std/numerics/bit/bit.cast/bit_cast.pass.cpp +++ b/libcxx/test/std/numerics/bit/bit.cast/bit_cast.pass.cpp @@ -21,6 +21,8 @@ #include #include +#include "test_macros.h" + // std::bit_cast does not preserve padding bits, so if T has padding bits, // the results might not memcmp cleanly. template @@ -230,7 +232,8 @@ #if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__ test_roundtrip_through(i); #endif -#if defined(__SIZEOF_INT128__) && __SIZEOF_LONG_DOUBLE__ == __SIZEOF_INT128__ +#if defined(__SIZEOF_INT128__) && __SIZEOF_LONG_DOUBLE__ == __SIZEOF_INT128__ && \ + !TEST_HAS_FEATURE(memory_sanitizer) // Some bits are just padding. test_roundtrip_through<__int128_t, false>(i); test_roundtrip_through<__uint128_t, false>(i); #endif