diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index 77b2c7580e3b..989a82d7b5a2 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -1590,6 +1590,15 @@ fn make_run(run: RunConfig<'_>) { let compiler = run.builder.compiler(run.builder.top_stage, run.build_triple()); let target = run.target; + // GCC cannot run coverage tests. + if let Some(codegen_backend) = run.builder.config.cmd.test_codegen_backend() { + if codegen_backend.is_gcc() { + return; + } + } else if run.builder.config.default_codegen_backend(compiler.host).is_gcc() { + return; + } + // List of (coverage) test modes that the coverage test suite will be // run in. It's OK for this to contain duplicates, because the call to // `Builder::ensure` below will take care of deduplication.