dexonsmith added inline comments.

================
Comment at: clang/test/Modules/implicit-modules-use-lock.m:21
+
+// CHECK-NO-LOCKS-NOT: remark:
+// CHECK-LOCKS: remark: locking '{{.*}}.pcm' to build module 'X' 
[-Rmodule-lock]
----------------
jansvoboda11 wrote:
> Where is the empty remark coming from? Is it useful to us in any way?
This is a `CHECK-NOT: <match>` line (with a custom `-check-prefix`). It 
confirms that `<match>` does not occur at least until the next positive check 
matches. The `FileCheck` invocation that uses `CHECK-NO-LOCKS` has no other 
check lines, so this really means: "`remark:` does not match on any line". Note 
I also needed to add `-allow-empty` since with no diagnostics at all, 
`FileCheck`'s stdin will be empty.

FYI, if you want to read more:
- `-check-prefix` is documented at 
https://www.llvm.org/docs/CommandGuide/FileCheck.html#the-filecheck-check-prefix-option
- `CHECK-NOT` is documented at 
https://www.llvm.org/docs/CommandGuide/FileCheck.html#the-check-not-directive

Often in clang tests it's easier to use `-cc1 -verify` for diagnostics instead 
of manual `FileCheck`s (`expected-no-diagnostics` comment being the equivalent 
of `-allow-empty`). In the modules testcases, there's often a complicated setup 
that we want to run a lot of `RUN:` lines against where each one expects 
different diagnostics. Maybe we should add prefix support to `-verify` (or 
maybe it's there and no one told me...).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95583

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D95583: Fr... Duncan P. N. Exon Smith via Phabricator via cfe-commits
    • [PATCH] D9558... Jan Svoboda via Phabricator via cfe-commits
    • [PATCH] D9558... Duncan P. N. Exon Smith via Phabricator via cfe-commits
    • [PATCH] D9558... Jan Svoboda via Phabricator via cfe-commits

Reply via email to