[clang] [llvm] [clang] Add `-verify-directives` cc1 flag (PR #179835)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 17 06:55:25 PST 2026
================
@@ -3647,6 +3713,153 @@ Examples matching error: "variable has incomplete type 'struct s'"
// expected-error-re {{variable has type 'struct {{(.*)}}'}}
// expected-error-re {{variable has type 'struct{{[[:space:]](.*)}}'}}
+Verifying the Directives
+~~~~~~~~~~~~~~~~~~~~~~~~
+Clang ``-cc1`` also has ``-verify-directives`` mode, which can be enabled
+alongside ``-verify`` to place additional restrictions on directives,
+and strives to improve readability of the expected compiler output
+for reviewers and future readers, but makes it a bit harder to write the test:
+
+- Diagnostic text specified in a directive has to be a full match.
+- Lexical order of directives has to match order in which diagnostics are
----------------
AaronBallman wrote:
```suggestion
- Lexical order of directives has to match the order in which diagnostics are
```
https://github.com/llvm/llvm-project/pull/179835
More information about the cfe-commits
mailing list