<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Hi Jessica,</div><div class="gmail_quote"><br></div><div class="gmail_quote">This time I'm replying all....</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Fri, May 4, 2018 at 12:45 PM, Jessica Paquette <span dir="ltr"><<a href="mailto:jpaquette@apple.com" target="_blank">jpaquette@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">I would personally like a feature like that in FileCheck because it would make it a lot easier to write MachineOutliner tests, and would make the tests significantly smaller and easier to understand.<br></blockquote><div><br></div><div><div style="margin:0px;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;padding-bottom:0px;font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;white-space:normal;direction:ltr;background-color:transparent">How do <span style="text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans-serif;font-size:13.33px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;float:none;background-color:transparent">MachineOutliner tests accomplish this now?  Can you point me to an example?</span></div><div style="margin:0px;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;padding-bottom:0px;font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;white-space:normal;direction:ltr;background-color:transparent"><span style="text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans-serif;font-size:13.33px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;float:none;background-color:transparent"><br></span></div><div style="margin:0px;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;padding-bottom:0px;font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;white-space:normal;direction:ltr;background-color:transparent"><span style="text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans-serif;font-size:13.33px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;float:none;background-color:transparent">Thanks.</span></div><span class="gmail-HOEnZb gmail-adL" style="margin:0px;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;padding-bottom:0px;font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;white-space:normal;direction:ltr;background-color:transparent"><font color="#888888" style="margin:0px;padding-bottom:0px;font-size:12.8px;direction:ltr"><div style="margin:0px;padding-bottom:0px;font-size:12.8px;direction:ltr"><span style="text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans-serif;font-size:13.33px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;float:none;background-color:transparent"><br></span></div></font></span><div style="margin:0px;padding-bottom:0px;font-size:12.8px;direction:ltr"><span class="gmail-HOEnZb gmail-adL" style="margin:0px;text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;padding-bottom:0px;font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;white-space:normal;direction:ltr;background-color:transparent"><font color="#888888" style="margin:0px;padding-bottom:0px;font-size:12.8px;direction:ltr"><span style="text-align:left;color:rgb(34,34,34);text-transform:none;text-indent:0px;letter-spacing:normal;font-family:arial,sans-serif;font-size:13.33px;font-style:normal;font-variant:normal;font-weight:400;text-decoration:none;word-spacing:0px;display:inline;white-space:normal;float:none;background-color:transparent">Joel</span></font></span><br></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid">
<br>
- Jessica<br>
<div><div class="gmail-h5"><br>
> On May 4, 2018, at 8:40 AM, Joel E. Denny via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> <br>
> Hi,<br>
> <br>
> Using FileCheck, I have not found a way to make a group of CHECK-DAG directives match multiple occurrences of a string.  For example, I naively thought the following would match successfully:<br>
> <br>
> ```<br>
> $ cat checks.txt <br>
> // CHECK: start<br>
> // CHECK-DAG: foo<br>
> // CHECK-DAG: foo<br>
> // CHECK-DAG: bar<br>
> // CHECK-NEXT: end<br>
> <br>
> $ cat input.txt <br>
> start<br>
> foo<br>
> bar<br>
> foo<br>
> end<br>
> <br>
> $ FileCheck --input-file=input.txt checks.txt<br>
> checks.txt:5:16: error: CHECK-NEXT: is not on the line after the previous match<br>
> // CHECK-NEXT: end<br>
>                ^<br>
> input.txt:5:1: note: 'next' match was here<br>
> end<br>
> ^<br>
> input.txt:3:4: note: previous match ended here<br>
> bar<br>
>    ^<br>
> input.txt:4:1: note: non-matching line after previous match is here<br>
> foo<br>
> ^<br>
> ```<br>
> <br>
> The trouble is that both "CHECK-DAG: foo" directives match the first "foo".<br>
> <br>
> I'd like this ability for testing a parallel program that outputs a series of non-unique strings in non-deterministic order.  Am I trying to push FileCheck beyond its intended domain?  Is there some existing feature for this purpose that I've overlooked?  If not, I see two potential solutions:<br>
> <br>
> 1. In a CHECK-DAG group, don't let the matches for patterns overlap.<br>
> <br>
> 2. Add a new CHECK-DAG-N directive, where N is some integer, to express that a pattern must have N non-overlapping matches.<br>
> <br>
> An advantage of #1 that the intuitive way (at least in my mind) of expressing multiple occurrences of a string, as in the example above, would work.  An advantage of #2 is that existing CHECK-DAG functionality would not change, and so there should be no chance of impacting existing well formed tests.<br>
> <br>
> To understand the issue better, I've prototyped #2.  It still needs test cases and documentation, so it's not ready for a formal patch review.  If people like the idea, I'll polish it up.<br>
> <br>
> Thanks.<br>
> <br>
> Joel<br>
</div></div>> ______________________________<wbr>_________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank" rel="noreferrer">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br>
</blockquote></div><br></div></div>