Add `CHECK-SAME`, which requires that the pattern matches on the *same*
line as the previous `CHECK`/`CHECK-NEXT` -- in other words, no newline
is allowed in the skipped region. This is similar to `CHECK-NEXT`,
which requires exactly 1 newline in the skipped region.
My motivation is to simplify checking the long lines of LLVM assembly
for the new debug info hierarchy. This allows CHECK sequences like the
following:
CHECK: ![[REF]] = !SomeMDNode(
CHECK-SAME: file: ![[FILE:[0-9]+]]
CHECK-SAME: otherField: 93{{[,)]}}
which is equivalent to:
CHECK: ![[REF]] = !SomeMDNode({{.*}}file: ![[FILE:[0-9]+]]{{.*}}otherField: 93{{[,)]}}
While this example just has two fields, many nodes in debug info have
more than that. `CHECK-SAME` will keep the logic easy to follow.
Morever, it enables interleaving `CHECK-NOT`s without allowing newlines.
Consider the following:
CHECK: ![[REF]] = !SomeMDNode(
CHECK-SAME: file: ![[FILE:[0-9]+]]
CHECK-NOT: unexpectedField:
CHECK-SAME: otherField: 93{{[,)]}}
CHECK-NOT: otherUnexpectedField:
CHECK-SAME: )
which doesn't seem to have an equivalent `CHECK` line.
llvm-svn: 230612
|
||
|---|---|---|
| .. | ||
| check-a-b-has-b.txt | ||
| check-b-a-has-b.txt | ||
| check-dag-multi-prefix-2.txt | ||
| check-dag-multi-prefix.txt | ||
| check-dag-substring-prefix.txt | ||
| check-dag-xfails.txt | ||
| check-dag.txt | ||
| check-empty.txt | ||
| check-label-dag-capture.txt | ||
| check-label-dag.txt | ||
| check-label.txt | ||
| check-multi-prefix-label.txt | ||
| check-multiple-prefixes-mixed.txt | ||
| check-multiple-prefixes-nomatch-2.txt | ||
| check-multiple-prefixes-nomatch.txt | ||
| check-multiple-prefixes-substr.txt | ||
| check-not-diaginfo.txt | ||
| check-prefixes.txt | ||
| check-substring-multi-prefix-2.txt | ||
| check-substring-multi-prefix.txt | ||
| dos-style-eol.txt | ||
| first-character-match.txt | ||
| implicit-check-not.txt | ||
| line-count-2.txt | ||
| line-count.txt | ||
| multiple-missing-prefixes.txt | ||
| next-no-match.txt | ||
| regex-brackets.txt | ||
| regex-no-match.txt | ||
| same.txt | ||
| separate-multi-prefix.txt | ||
| simple-var-capture.txt | ||
| two-checks-for-same-match.txt | ||
| validate-check-prefix.txt | ||
| var-ref-same-line.txt | ||