Fix an unreachable code warning on some platforms

#1558

PiperOrigin-RevId: 577874842
Change-Id: I1d56f3f4b445f6c4a9df2fe06fec542cb00e0e92
diff --git a/absl/strings/internal/str_format/convert_test.cc b/absl/strings/internal/str_format/convert_test.cc
index 0d53465..d14ecb2 100644
--- a/absl/strings/internal/str_format/convert_test.cc
+++ b/absl/strings/internal/str_format/convert_test.cc
@@ -1245,9 +1245,16 @@
 // Sanity check to make sure that we are testing what we think we're testing on
 // e.g. the x86_64+glibc platform.
 TEST_F(FormatConvertTest, GlibcHasCorrectTraits) {
-#if !defined(__GLIBC__) || !defined(__x86_64__)
-  return;
+#if defined(__GLIBC__) && defined(__x86_64__)
+  constexpr bool kIsSupportedGlibc = true;
+#else
+  constexpr bool kIsSupportedGlibc = false;
 #endif
+
+  if (!kIsSupportedGlibc) {
+    GTEST_SKIP() << "Test does not support this platform";
+  }
+
   const NativePrintfTraits &native_traits = VerifyNativeImplementation();
   // If one of the following tests break then it is either because the above PP
   // macro guards failed to exclude a new platform (likely) or because something