[PATCH] D95583: Frontend: Add -f{, no-}implicit-modules-uses-lock and -Rmodule-lock

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 29 08:15:25 PST 2021


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



More information about the cfe-commits mailing list