OSDN Git Service

[FileCheck]Remove assertions that prevent matching an empty string at file start...
authorJames Henderson <jh7370@my.bristol.ac.uk>
Tue, 12 Mar 2019 15:37:34 +0000 (15:37 +0000)
committerJames Henderson <jh7370@my.bristol.ac.uk>
Tue, 12 Mar 2019 15:37:34 +0000 (15:37 +0000)
commit1e6e80480b14314d5cd0c595f5698103570855b6
tree182fb1a71526c1d476e7ec78d10bd448c73b35a2
parent99eb9152f9443fbc4353d7a6029c82f3ee082c84
[FileCheck]Remove assertions that prevent matching an empty string at file start before CHECK-NEXT/SAME

This patch removes two assertions that were preventing writing of a test
that checked an empty line followed by some text. For example:

CHECK: {{^$}}
CHECK-NEXT: foo()

The assertion was because the current location the CHECK-NEXT was
scanning from was the start of the buffer. A similar issue occurred with
CHECK-SAME. These assertions don't protect against anything, as there is
already an error check that checks that CHECK-NEXT/EMPTY/SAME don't
appear first in the checks, and the following code works fine if the
pointer is at the start of the input.

Reviewed by: probinson, thopre, jdenny
Differential Revision: https://reviews.llvm.org/D58784

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355928 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/FileCheck.cpp
test/FileCheck/empty-regex-match-at-start.txt [new file with mode: 0644]