From 0997792823500119ac91c8873cfd44dc29024c83 Mon Sep 17 00:00:00 2001 From: Nicholas Wilson Date: Wed, 28 Aug 2024 17:08:58 +0800 Subject: [PATCH] [d_do_test.d] use `-defaultlib= ` for C files --- compiler/test/tools/d_do_test.d | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/test/tools/d_do_test.d b/compiler/test/tools/d_do_test.d index 81a0345262da..86e1eb013740 100755 --- a/compiler/test/tools/d_do_test.d +++ b/compiler/test/tools/d_do_test.d @@ -689,6 +689,10 @@ bool gatherTestParameters(ref TestArgs testArgs, string input_dir, string input_ if (testArgs.mode == TestMode.FAIL_COMPILE) testArgs.requiredArgs = "-verrors=0 " ~ testArgs.requiredArgs; + // *.c tests: don't link druntime/Phobos + if (input_file.extension() == ".c") + testArgs.requiredArgs = "-defaultlib= " ~ testArgs.requiredArgs; + { string argSetsStr; findTestParameter(envData, file, "ARG_SETS", argSetsStr, ";");