llvm-project/llvm/test/FileCheck
Joel E. Denny a1fd188223 [FileCheck] Support comment directives
Sometimes you want to disable a FileCheck directive without removing
it entirely, or you want to write comments that mention a directive by
name.  The `COM:` directive makes it easy to do this.  For example,
you might have:

```
; X32: pinsrd_1:
; X32:    pinsrd $1, 4(%esp), %xmm0

; COM: FIXME: X64 isn't working correctly yet for this part of codegen, but
; COM: X64 will have something similar to X32:
; COM:
; COM:   X64: pinsrd_1:
; COM:   X64:    pinsrd $1, %edi, %xmm0
```

Without this patch, you need to use some combination of rewording and
directive syntax mangling to prevent FileCheck from recognizing the
commented occurrences of `X32:` and `X64:` above as directives.
Moreover, FileCheck diagnostics have been proposed that might complain
about the occurrences of `X64` that don't have the trailing `:`
because they look like directive typos:

  <http://lists.llvm.org/pipermail/llvm-dev/2020-April/140610.html>

I think dodging all these problems can prove tedious for test authors,
and directive syntax mangling already makes the purpose of existing
test code unclear.  `COM:` can avoid all these problems.

This patch also updates the small set of existing tests that define
`COM` as a check prefix:

- clang/test/CodeGen/default-address-space.c
- clang/test/CodeGenOpenCL/addr-space-struct-arg.cl
- clang/test/Driver/hip-device-libs.hip
- llvm/test/Assembler/drop-debug-info-nonzero-alloca.ll

I think lit should support `COM:` as well.  Perhaps `clang -verify`
should too.

Reviewed By: jhenderson, thopre

Differential Revision: https://reviews.llvm.org/D79276
2020-05-13 11:29:48 -04:00
..
comment [FileCheck] Support comment directives 2020-05-13 11:29:48 -04:00
check-a-b-has-b.txt
check-b-a-has-b.txt
check-count.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
check-dag-multi-prefix-2.txt
check-dag-multi-prefix.txt
check-dag-not-dag.txt
check-dag-overlap-torture.txt
check-dag-overlap.txt
check-dag-substring-prefix.txt
check-dag-xfails.txt
check-dag.txt
check-empty-tag.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
check-empty.txt Improve error message of FileCheck when stdin is empty 2020-02-04 11:14:55 +00:00
check-empty2.txt
check-ignore-case.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
check-label-dag-capture.txt
check-label-dag.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
check-label.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
check-multi-prefix-label.txt
check-multiple-prefixes-mixed.txt
check-multiple-prefixes-nomatch-2.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
check-multiple-prefixes-nomatch.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
check-multiple-prefixes-substr.txt
check-not-diaginfo.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
check-prefixes.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
check-substring-multi-prefix-2.txt
check-substring-multi-prefix.txt
dos-style-eol.txt
dump-input-annotations.txt [FileCheck] Fix --dump-input annotation sort per input line 2020-04-16 15:39:35 -04:00
dump-input-enable.txt [FileCheck] Given multiple -dump-input, prefer most verbose 2019-12-03 14:21:13 -05:00
empty-regex-match-at-start.txt
envvar-opts.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
first-character-match.txt [FileCheck] Support comment directives 2020-05-13 11:29:48 -04:00
implicit-check-not.txt [FileCheck] - Fix the false positive when -implicit-check-not is used with an unknown -check-prefix. 2020-04-16 15:00:50 +03:00
line-count-2.txt
line-count.txt FileCheck [9/12]: Add support for matching formats 2020-01-24 14:15:28 +00:00
lit.local.cfg [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
match-full-lines.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
multiple-missing-prefixes.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
next-no-match.txt
no-check-file.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
no-multi-suffixes.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
numeric-defines-diagnostics.txt [FileCheck] Add missing %ProtectFileCheckOutput to FileCheck tests 2020-03-31 17:29:11 -04:00
numeric-defines.txt FileCheck [9/12]: Add support for matching formats 2020-01-24 14:15:28 +00:00
numeric-expression.txt [FileCheck] Better diagnostic for format conflict 2020-04-15 13:46:45 +01:00
opt-color.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
regex-brackets.txt
regex-no-match.txt
same.txt
separate-multi-prefix.txt
simple-var-capture.txt
string-defines-diagnostics.txt FileCheck [9/12]: Add support for matching formats 2020-01-24 14:15:28 +00:00
string-defines.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
two-checks-for-same-match.txt
validate-check-prefix.txt [FileCheck] Support comment directives 2020-05-13 11:29:48 -04:00
var-ref-same-line.txt
var-scope.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00
verbose.txt [FileCheck] Make FILECHECK_OPTS useful for its test suite 2019-11-21 18:01:12 -05:00