diff --git a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h --- a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h +++ b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test.h @@ -45,4 +45,10 @@ #define SKIP_NO_DEBUG(T) DISABLED_##T #endif +#if SCUDO_FUCHSIA +// The zxtest library provides a default main function that does the same thing +// for Fuchsia builds. +#define SCUDO_NO_TEST_MAIN +#endif + extern bool UseQuarantine; diff --git a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp --- a/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp +++ b/compiler-rt/lib/scudo/standalone/tests/scudo_unit_test_main.cpp @@ -45,9 +45,7 @@ "dealloc_type_mismatch=" DEALLOC_TYPE_MISMATCH; } -// The zxtest library provides a default main function that does the same thing -// for Fuchsia builds. -#if !SCUDO_FUCHSIA +#if !defined(SCUDO_NO_TEST_MAIN) int main(int argc, char **argv) { EnableMemoryTaggingIfSupported(); testing::InitGoogleTest(&argc, argv);