The FileCheck documentation states of CHECK-LABEL:
It is treated identically to a normal
CHECKdirective except that FileCheck makes an additional assumption that a line matched by the directive cannot also be matched by any other check present in
$ cat > fchecktest.txt
#CHECK: foo baz
flang1 foo bar
flang2 foo baz
$ grep -v -e ‘^#’ fchecktest.txt | bin/FileCheck fchecktest.txt
The behaviour of the above suggests contrary to the documentation - that foo baz can indeed be matched against the label line “flang2”, i.e. check-label does not consume the whole line as the docs seem to imply.
I believe that FileCheck is working as intended and that the docs are just a bit confusing. Is that right?
The use-case is matching flang1 and flang2 invocations by the clang driver in -### output, and the intent is to be able to match something appearing in one without accidentally matching the other.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.