Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions bootstrap/tests/common/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
use std::process::Command;
use std::sync::OnceLock;

static CC_ARGS: OnceLock<Vec<&'static str>> = OnceLock::new();

/// Returns the appropriate compiler arguments for the current `cc`.
pub fn get_cc_args() -> &'static [&'static str> {
CC_ARGS.get_or_init(|| {
// Probe the compiler for -ferror-limit=0 (clang) or -fmax-errors=0 (gcc)
if Command::new("cc")
.arg("-ferror-limit=0")
.arg("-c")
.arg("-x")
.arg("c")
.arg("-")
.output()
.map(|o| o.status.success())
.unwrap_or(false)
{
vec!["-std=c11", "-ferror-limit=0", "-fsyntax-only", "-x", "c"]
} else if Command::new("cc")
.arg("-fmax-errors=0")
.arg("-c")
.arg("-x")
.arg("c")
.arg("-")
.output()
.map(|o| o.status.success())
.unwrap_or(false)
{
vec!["-std=c11", "-fmax-errors=0", "-fsyntax-only", "-x", "c"]
} else {
vec!["-std=c11", "-fsyntax-only", "-x", "c"]
}
})
.as_slice()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# NOW -- The C-backend tests hand cc a clang-only flag: 23 red on gcc, and the ones that stay green check nothing (published 2026-09-26)

## A bee's work on #4832, published from `queen-4832` (Closes #4832)

- The branch changes 1 file(s): `bootstrap/tests/common/mod.rs`.
- `git diff --stat origin/master...queen-4832` reads: 1 file changed, 37 insertions(+)
- This entry is written by the publisher, not by the bee. A pull request must
add exactly one `docs/now/` entry and a bee has no way to know that: its brief
names a boundary file and acceptance criteria, and `docs/now/` is neither.
- What this entry does NOT establish: that the work is correct. The gates on the
pull request judge that, and they are the same gates every other change meets.
Loading