[PATCH] D58784: [FileCheck]Remove assertions that prevent matching an empty string at file start before CHECK-NEXT/SAME

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 01:19:12 PST 2019


thopre added a comment.

In D58784#1419973 <https://reviews.llvm.org/D58784#1419973>, @probinson wrote:

> This all lets me keep thinking that a CHECK-SAME as the first directive would naturally look for a match on the first line of input (i.e., the "same" line as the implicit initial label), and an initial CHECK-NEXT would (by virtue of how it is defined relative to the model, not because it's inherently useful) match on the second line of input.


It might be consistent with the model but I think we should use a new directive altogether to clear any possible confusion. I think many are likely to only have an approximate understanding of the FileCheck model and would be surprised of using CHECK-SAME or CHECK-NEXT for the first line either way. @jdenny My suggestion of CHECK-FIRST and CHECK-EMPTY was misplaced since I am not sure what is the use case here so I'll wait clarification on that before I reply you on how such directives should behave wrt. other directives. @jhenderson Is your goal with the testcase you wrote this patch for to match a line at an absolute line number (eg line 1 in this case) or to match a line at a given line offset from the beginning of the input or region of input? My clumsily suggested CHECK-EMPTY-L1 would be for the latter case and CHECK-FIRST for the former case (and should be CHECK-EMPTY-FIRST for consistency, not sure how to generalize to any relative line number).


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58784/new/

https://reviews.llvm.org/D58784





More information about the llvm-commits mailing list