<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, May 7, 2018 at 1:23 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Right now, the tests try to accomplish the following<div><br></div><div>1. Define a sequence of instructions (e.g a,b,c)</div><div>2. Insert that sequence into k places with an unique instruction between them to make sure the outliner will yank them out *without overlaps*</div><div>3. Check for k calls to an outlined function</div><div>4. Check that the outlined sequence still exists in the program</div><div><div><br></div><div>This can result in some pretty long tests which would be a lot easier to define if we could say something like “this function must contain k instances of an outlined call, and not contain this sequence of instructions”.</div><div><br></div><div>test/CodeGen/machine-outliner.<wbr>mir is a pretty good example of a test that would benefit from this sort of thing.</div></div></div></blockquote><div><br></div><div>I'm not sure if what I'm proposing will do what you need.  CHECK-DAG is for cases where a set of expected strings is unordered.  I'm trying to extend it to handle cases where those strings aren't unique either.  In your example, I see the non-unique property but not the unordered property.  Did I miss it?<br><br></div><div>Moreover, it seems your example could be handled now by two FileCheck calls with different prefixes, say OUT and INS.  The first would use a sequence of k "OUT:" directives to ensure that there are k outlined calls.  The second would use "INS-NOT:" directives to ensure other instructions don't occur.  The calls could also have a common prefix, say CHECK, to use for the function labels.  Does that do what you want?<br></div><div><br></div><div>Thanks<br></div><div><br></div><div>Joel<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><span class="HOEnZb"><font color="#888888"><div><br></div><div>- Jessica</div></font></span><div><div class="h5"><div><br><blockquote type="cite"><div>On May 4, 2018, at 10:05 AM, Joel E. Denny <<a href="mailto:jdenny.ornl@gmail.com" target="_blank">jdenny.ornl@gmail.com</a>> wrote:</div><br class="m_5123193221602284900Apple-interchange-newline"><div><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="m_5123193221602284900gmail-HOEnZb m_5123193221602284900gmail-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 style="margin:0px;padding-bottom:0px;font-size:12.8px;direction:ltr" color="#888888"><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="m_5123193221602284900gmail-HOEnZb m_5123193221602284900gmail-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 style="margin:0px;padding-bottom:0px;font-size:12.8px;direction:ltr" color="#888888"><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="m_5123193221602284900gmail-h5"><br>
> On May 4, 2018, at 8:40 AM, Joel E. Denny via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">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" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br>
</blockquote></div><br></div></div>
</div></blockquote></div><br></div></div></div></div></blockquote></div><br></div></div>