Skip to content

projects: gcc: check that a new test can fail without the fix - #983

Merged
rgushchin merged 1 commit into
sashiko-dev:mainfrom
someonewithpc:gcc-testsuite-notes
Dec 3, 2026
Merged

rgushchin merged 1 commit into
sashiko-dev:mainfrom
someonewithpc:gcc-testsuite-notes

Conversation

@someonewithpc

Copy link
Copy Markdown
Contributor

review-core.md tells the reviewer to ignore files under gcc/testsuite/. That is right for a test's code, which is meant to be odd or invalid, but it also skips the DejaGnu directives, and a test whose directives cannot fail does not protect the fix

For example, a test for PR c++/127708 put its dg-bogus on the call line, while the compiler reports the warning at the cast in the requires clause. The test passes without the fix, and only the generic "test for excess errors" check notices. With the current prompts, a review of that test found no issues. With this change it reported the misplaced directive and named the line it belongs on

This adds maintainers/testsuite.md for every DejaGnu testsuite, gcc/testsuite/ and each runtime library's testsuite/: directive placement and line offsets, c-c++-common targets, type-size selectors, language levels in dg-do, the PR comment and the ChangeLog block in the commit message. review-core.md still says to ignore the test's code, and now asks to check its directives, target selectors and PR comment against those notes

That one test is the only case I have checked so far, so the severity it gets (Low in that review) may need tuning once it sees more series

Testing:

  • make check-pr passes sign-off, fmt and clippy. cargo test has 9 failures in reviewer and agy_cli that fail on main too
  • sashiko review --project sashiko --agent with Opus: no open findings

@sashiko-bot

sashiko-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown

Sashiko review

Commit 1/1 — c498e657 projects: gcc: check that a new test can fail without the fix

  • [MEDIUM] projects/gcc/prompts/maintainers/testsuite.md: the C++ language
    level bullet states unconditionally that omitting { target c++11 } or
    { target c++20 } from dg-do causes a C++ test to also run as C++98.
    Together with projects/gcc/prompts/review-core.md directing the reviewer to
    enforce these notes, this triggers false positives on valid GCC C++ tests
    that restrict the dialect via -std= in dg-options or dg-additional-options
    (which disables the default multi-standard sweep) or via
    dg-require-effective-target c++XX. Qualify the rule so the C++98 warning
    applies only when the test has none of those dialect constraints, and state
    any preference for dg-do target selectors over -std= separately.

Full review and stage logs on sashiko.sashiko.dev

review-core tells the reviewer to ignore testsuite files. That suits a
test's code, which is meant to be odd, but the reviewer then skips the
DejaGnu directives too, and a directive on the wrong line or a missing
target selector lets a test pass without the fix or fail on targets it
should run on

Add maintainer notes for the testsuite/ directories of gcc and the
runtime libraries: directive placement, c-c++-common targets, type-size
selectors, language levels, the PR comment and the ChangeLog block.
review-core still ignores a test's code, and now checks those parts of
the test

Signed-off-by: Hugo Sales <hugo@hsal.es>
@someonewithpc

Copy link
Copy Markdown
Contributor Author

Fixed in 055fb3d: the C++98 sentence now applies only to a test with none of { target c++NN }, -std= or dg-require-effective-target c++NN, and the preference for the dg-do selector over -std= is its own sentence. The local review also caught that "first comment" would flag tests whose dg directives or copyright header come first, so the PR line now goes in "a comment before the test code"

@sashiko-bot

sashiko-bot Bot commented Dec 3, 2026

Copy link
Copy Markdown

Sashiko review — v2

✓ No issues found across 1 commit.

Full review log on sashiko.sashiko.dev

@rgushchin
rgushchin merged commit 3e151ba into sashiko-dev:main Dec 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants