[PATCH] D29122: [FileCheck] Add ability to match newline characters

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 03:12:53 PST 2017


dsanders added a comment.

> Currently there is no way using FileCheck to match an explicit newline character. Using,
>  for example, the pattern "{{\n}}" matches an 'n' character, not '\n' (nor for that matter the
>  string "\n"). The current suggested method of using [[:space:]] matches all forms of
>  whitespace, so may not be always suitable.

Does this kind of pattern work on Windows? That OS uses CRLF (\r\n) for line endings and will probably fail to match patterns that explicitly check for \n.

Does something like this achieve the effect you need?:

  // CHECK: foo{{$}}
  // CHECK-NEXT: {{^}}bar


https://reviews.llvm.org/D29122





More information about the llvm-commits mailing list