[libcxx] [test] Generalize the conditions for testing bitcasts between long double, double and int128

MSVC targets also have a 64 bit long double, as do MinGW targets on ARM.
This hasn't been noticed in CI because the MSVC configurations there run
with _LIBCPP_HAS_NO_INT128 defined.

This avoids assuming that either __int128_t or double is equal in size to
long double. i386 MinGW targets have sizeof(long double) == 10, which
doesn't match any of the tested types.

Differential Revision: https://reviews.llvm.org/D111671

GitOrigin-RevId: a03e17d4d9419811da16bc2e893fd0cf9b8aa2a7
diff --git a/test/std/numerics/bit/bit.cast/bit_cast.pass.cpp b/test/std/numerics/bit/bit.cast/bit_cast.pass.cpp
index 06a8154..c212ad0 100644
--- a/test/std/numerics/bit/bit.cast/bit_cast.pass.cpp
+++ b/test/std/numerics/bit/bit.cast/bit_cast.pass.cpp
@@ -227,16 +227,10 @@
         test_roundtrip_through_nested_T<false>(i);
         test_roundtrip_through_buffer<false>(i);
 
-        // On arm64 on Apple platforms, long double is just double, so we don't
-        // test against int128, but instead against double itself. Otherwise,
-        // we test against int128 if we have those types available.
-#if defined(__aarch64__) && defined(__APPLE__)
-#   define LONG_DOUBLE_IS_DOUBLE
-#endif
-
-#if defined(LONG_DOUBLE_IS_DOUBLE)
+#if __SIZEOF_LONG_DOUBLE__ == __SIZEOF_DOUBLE__
         test_roundtrip_through<double, false>(i);
-#elif !defined(_LIBCPP_HAS_NO_INT128)
+#endif
+#if defined(__SIZEOF_INT128__) && __SIZEOF_LONG_DOUBLE__ == __SIZEOF_INT128__
         test_roundtrip_through<__int128_t, false>(i);
         test_roundtrip_through<__uint128_t, false>(i);
 #endif