[PATCH] D151320: [clang] Add `// expected-maybe-no-diagnostics` comment to VerifyDiagnosticConsumer

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 24 09:11:49 PDT 2023


aaron.ballman added a comment.

> This patch introduces a `// expected-maybe-not-diagnostic` that silence

typo in the summary, it introduces `// expected-maybe-no-diagnostics`

To save other reviewers some clicking around, the reason why this is being proposed is because we want to use the `split-file` utility to separate monolithic DR tests into individual test cases to keep them hermetic. We could require each individual test within the greater file to specify `// expected-no-diagnostics`, but that adds quite a bit of noise to the test file due to how often those comments need to repeat. The idea behind this patch is that we can use one `// expected-maybe-no-diagnostics` marking in a header file that is force included on the RUN lines for the file. This way, each split off file says "if you get no diagnostics, that's fine". In the case where the file legitimately has no diagnostics, we pass that test. But in the case where the file does expect diagnostics, we avoid the "expected no diagnostics, but got diagnostics" failure mode. This allows us to continue to group DRs by number instead of by whether they expect diagnostics or not.



================
Comment at: clang/include/clang/Frontend/VerifyDiagnosticConsumer.h:255
+    HasOtherExpectedDirectives,
+    HasExpectedMaybeNoDiagnostics
   };
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151320/new/

https://reviews.llvm.org/D151320



More information about the cfe-commits mailing list