There is currently no reliable way in FileCheck to check that a line is completely empty. The expected way of using "CHECK: {{^$}}" does not work because the '^' matches the end of the previous match (this behaviour may be desirable in certain instances). For the same reason, "CHECK-NEXT: {{^$}}" will fail when the previous match was at the end of the line, as the pattern will match there. Using the recommended [[:space:]] to match an explicit new line could also match a space, and thus is not always desired. Literal '\n' matches also do not seem to work.
This change adds a new directive that behaves the same as CHECK-NEXT, except that it only matches against empty lines. As with CHECK-NEXT, it will fail if more than one newline occurs before the next blank line. Example usage:
; test.txt
foo
bar
; CHECK: foo
; CHECK-EMPTY:
; CHECK-NEXT: bar
Hm. Is whitespace allowed on the "blank" line? Even if --match-full-lines is not in effect? If whitespace is always disallowed, then maybe instead of "is blank" this should say something like "has nothing on it, not even whitespace" ?