diff --git a/test/test_realpath_nonext.c b/test/test_realpath_nonext.c
index 0305a65102b095b15947c65d1f971bb70e46e061..c571cbc6eee2a000760c67fbc7de92175ed2c1dd 100644
--- a/test/test_realpath_nonext.c
+++ b/test/test_realpath_nonext.c
@@ -2,6 +2,39 @@
  * Version of test_realpath with Darwin extensions disabled.
  */
 
+/*
+ * NOTE: This version of realpath() is completely broken on 10.15.
+ * This is not the fault of legacy-support, since we don't currently modify
+ * the OS realpath() behavior on 10.6+.  Unless and until we provide a fix
+ * for that OS bug, we need to carve out an exemption in this test for 10.15,
+ * to avoid an undeserved test failure.
+ *
+ * For simplicity, the OS version test is based on the build-target version
+ * rather than checking the actual version at runtime.  This means that
+ * running this test on a different OS version than the one it was built
+ * for may not have the desired result.
+ */
+
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) \
+    && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500 \
+    && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <  110000
+
+#include <libgen.h>
+#include <stdio.h>
+
+int
+main(int argc, char *argv[])
+{
+  (void) argc;
+  printf("%s is being skipped on 10.15 due to OS brokenness.\n",
+         basename(argv[0]));
+  return 0;
+}
+
+#else /* Not 10.15 */
+
 #define _POSIX_C_SOURCE 200112L
 
 #include "test_realpath.c"
+
+#endif /* Not 10.15 */
diff --git a/test/test_realpath_nonposix.c b/test/test_realpath_nonposix.c
index 9870aac45770eda7344a3c86dc232b95d11ab6f1..c1769034613d503ccf9c46a82bb9655d9ba13c8f 100644
--- a/test/test_realpath_nonposix.c
+++ b/test/test_realpath_nonposix.c
@@ -1,13 +1,10 @@
 /*
  * Version of test_realpath with non-POSIX semantics (32-bit only).
+ *
+ * Attempting a 64-bit build with _NONSTD_SOURCE results in an error.
  */
 
-#if !defined(__LP64__) || !__LP64__
-
-#define _NONSTD_SOURCE
-#include "test_realpath.c"
-
-#else
+#if defined(__LP64__) && __LP64__
 
 #include <libgen.h>
 #include <stdio.h>
@@ -20,4 +17,9 @@ main(int argc, char *argv[])
   return 0;
 }
 
-#endif
+#else /* 32-bit */
+
+#define _NONSTD_SOURCE
+#include "test_realpath.c"
+
+#endif /* 32-bit */