<div dir="ltr"><div>Hi David,</div><div><br></div><div>This use case has come up several times.  I've not heard of any existing solution.</div><div><br></div><div>I've been thinking we should have CHECK-DAG-NEXT blocks.  Likewise, for unordered text on a single line, we'd have CHECK-DAG-SAME blocks.  In both these cases, we'd have the question of how to handle the first match.  Would it be bound by the NEXT or SAME rule relative to the match preceding the block?</div><div><br></div><div>If anyone wants to implement something like this, please cc me on the discussion/review.  I'd like to make use of such a feature, and I have ideas on how to address some of the subtleties, such as the question above.<br></div><div><br></div><div>Thanks.</div><div><br></div><div>Joel<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 27, 2019 at 5:21 AM David Stenberg via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
If a test has output of the following form:<br>
<br>
  START<br>
  VALUE X1<br>
  VALUE X2<br>
  [...]<br>
  VALUE X_N<br>
  END<br>
<br>
where the order of X_1..X_N is not deterministic, is it possible to<br>
write FileCheck checks that verify that the "VALUE" lines occur in any<br>
order, with only one occurrence per line, and no other "VALUE" lines in<br>
between?<br>
<br>
One idea that was suggested to me was to write checks of the following<br>
form:<br>
<br>
  CHECK: START<br>
  CHECK-NOT: VALUE<br>
  CHECK-DAG: VALUE X1<br>
  CHECK-DAG: VALUE X2<br>
  [...]<br>
  CHECK-DAG: VALUE X_N<br>
  CHECK-NOT: VALUE<br>
  CHECK: END<br>
<br>
However, that for example matches on:<br>
<br>
  START<br>
  VALUE X1<br>
  VALUE X1<br>
  VALUE Foo<br>
  VALUE X3<br>
  VALUE X1<br>
  VALUE X2<br>
  END<br>
<br>
I have looked through the FileCheck documentation, but haven't found<br>
anything that describes a similar case.<br>
<br>
Are these sorts of checks achievable with FileCheck?<br>
<br>
Best regards,<br>
David<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>