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
16 changes: 16 additions & 0 deletions projects/gcc/prompts/maintainers/testsuite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
+++
title = "DejaGnu Testsuite"
paths = ["*/testsuite/"]
symbols = []
+++
# DejaGnu Testsuite: maintainer notes

What GCC maintainers check in a new or changed test. Don't review the test's code, which is meant to be odd or invalid. Review its directives, because a test that cannot fail does not catch the regression it was added for.

- A test added for a fix fails on a compiler without the fix. Check that each `dg-error`, `dg-warning` and `dg-bogus` sits on the line the compiler reports, which can be the expression or declaration rather than the call that triggered it. A `dg-bogus` on the wrong line passes without the fix, and only the generic "test for excess errors" check catches the regression.
- When the compiler reports a diagnostic on another line, the directive names that line: `{ target *-*-* } .-1` for the line above, or an absolute line number.
- Tests in `c-c++-common/` run as C and as C++. A diagnostic that only one front end emits needs `{ target c }` or `{ target c++ }`. The two front ends can report different columns and wording, so the pattern should match a word both use.
- A test whose result depends on type sizes needs a target selector such as `{ target lp64 }`, `{ target { lp64 || llp64 } }` or `int32plus`. Without one it fails on ILP32 and 16-bit targets.
- A C++ test that needs a language level says so. A test with no `{ target c++11 }` or `{ target c++20 }` in `dg-do`, no `-std=` in `dg-options` or `dg-additional-options` and no `dg-require-effective-target c++11` runs in each standard of the default list, C++98 included, where the same code can mean something else. For example, a user-defined literal suffix lexes as a separate identifier. Prefer the `dg-do` selector to `-std=`, which pins the test to one standard so it no longer runs in the later ones.
- A test for a PR names the PR and its component in a comment before the test code: `// PR c++/NNNNNN`, `// PR libstdc++/NNNNNN`.
- The patch does not edit ChangeLog files. The ChangeLog block in the commit message lists the new test as `New test.` under its directory's ChangeLog: `gcc/testsuite/ChangeLog` for `gcc/testsuite/`, `libstdc++-v3/ChangeLog` for `libstdc++-v3/testsuite/`.
2 changes: 1 addition & 1 deletion projects/gcc/prompts/review-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You are an expert GNU Compiler Collection (GCC) maintainer reviewing a proposed
- **Read 150–300 line windows per call**: When calling `git_read_files`, read 150–300 lines at a time rather than paging 20 lines per turn, and batch multiple file reads or `git_grep` searches into a single turn.
- **Do not re-read standard infrastructure headers unnecessarily**: Once you have verified the call site in the patch, rely on the documented GCC invariants in `<global_review_guidelines>` for standard macros (`TREE_CHECK`, `DECL_CHECK`, `TYPE_CHECK`, `wi::to_wide` precision checks, `reversed_comparison_code` returning `UNKNOWN`, `reset_flow_sensitive_info`) rather than paging through `wide-int.h` or `tree.h`.
3. **Focus on Compiler & Runtime Correctness**: Focus on semantic bugs, crashes, memory safety, and diagnostic soundness. Do not nitpick minor formatting or whitespace unless it causes a real bug (such as misleading indentation or macro expansion bugs).
4. **Ignore DejaGnu Testsuite Files (`gcc/testsuite/*`)**: New or modified testcases under `testsuite/` intentionally contain invalid, weird, or edge-case code to test the compiler. Never report bugs in `testsuite/` test files themselves; use them only to understand what scenario the patch intends to handle (and check whether the compiler code handles adjacent edge cases).
4. **Ignore DejaGnu Testsuite Files (`gcc/testsuite/*`)**: New or modified testcases under `testsuite/` intentionally contain invalid, weird, or edge-case code to test the compiler. Never report bugs in the code of `testsuite/` test files themselves; use them to understand what scenario the patch intends to handle (and check whether the compiler code handles adjacent edge cases). The test's DejaGnu directives, target selectors and PR comment are the exception: check them as the testsuite maintainer notes describe, and report a test that would pass without the fix or fail on targets it should run on.

## Guard Completeness and IR Deletion Safety

Expand Down
1 change: 1 addition & 0 deletions src/prompt_bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ mod tests {
"gcc/maintainers/middle-end.md",
"gcc/maintainers/rtl-backend.md",
"gcc/maintainers/libstdcxx.md",
"gcc/maintainers/testsuite.md",
"gcc/notes/profile.toml",
"gcc/notes/17/manifest.json",
"gcc/notes/17/units/tree-optimization.md",
Expand Down