<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Right now, the tests try to accomplish the following<div class=""><br class=""></div><div class="">1. Define a sequence of instructions (e.g a,b,c)</div><div class="">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 class="">3. Check for k calls to an outlined function</div><div class="">4. Check that the outlined sequence still exists in the program</div><div class=""><div><br class=""></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 class=""></div><div>test/CodeGen/machine-outliner.mir is a pretty good example of a test that would benefit from this sort of thing.</div><div><br class=""></div><div>- Jessica</div><div><br class=""><blockquote type="cite" class=""><div class="">On May 4, 2018, at 10:05 AM, Joel E. Denny <<a href="mailto:jdenny.ornl@gmail.com" class="">jdenny.ornl@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote">Hi Jessica,</div><div class="gmail_quote"><br class=""></div><div class="gmail_quote">This time I'm replying all....</div><div class="gmail_quote"><br class=""></div><div class="gmail_quote">On Fri, May 4, 2018 at 12:45 PM, Jessica Paquette <span dir="ltr" class=""><<a href="mailto:jpaquette@apple.com" target="_blank" class="">jpaquette@apple.com</a>></span> wrote:<br class=""><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 class=""></blockquote><div class=""><br class=""></div><div class=""><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" class="">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" class="">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" class=""><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" class=""><br class=""></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" class=""><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" class="">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" class=""><div style="margin:0px;padding-bottom:0px;font-size:12.8px;direction:ltr" class=""><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" class=""><br class=""></span></div></font></span><div style="margin:0px;padding-bottom:0px;font-size:12.8px;direction:ltr" class=""><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" class=""><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" class="">Joel</span></font></span><br class=""></div></div><div class=""> </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 class="">
- Jessica<br class="">
<div class=""><div class="gmail-h5"><br class="">
> On May 4, 2018, at 8:40 AM, Joel E. Denny via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:<br class="">
> <br class="">
> Hi,<br class="">
> <br class="">
> 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 class="">
> <br class="">
> ```<br class="">
> $ cat checks.txt <br class="">
> // CHECK: start<br class="">
> // CHECK-DAG: foo<br class="">
> // CHECK-DAG: foo<br class="">
> // CHECK-DAG: bar<br class="">
> // CHECK-NEXT: end<br class="">
> <br class="">
> $ cat input.txt <br class="">
> start<br class="">
> foo<br class="">
> bar<br class="">
> foo<br class="">
> end<br class="">
> <br class="">
> $ FileCheck --input-file=input.txt checks.txt<br class="">
> checks.txt:5:16: error: CHECK-NEXT: is not on the line after the previous match<br class="">
> // CHECK-NEXT: end<br class="">
>                ^<br class="">
> input.txt:5:1: note: 'next' match was here<br class="">
> end<br class="">
> ^<br class="">
> input.txt:3:4: note: previous match ended here<br class="">
> bar<br class="">
>    ^<br class="">
> input.txt:4:1: note: non-matching line after previous match is here<br class="">
> foo<br class="">
> ^<br class="">
> ```<br class="">
> <br class="">
> The trouble is that both "CHECK-DAG: foo" directives match the first "foo".<br class="">
> <br class="">
> 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 class="">
> <br class="">
> 1. In a CHECK-DAG group, don't let the matches for patterns overlap.<br class="">
> <br class="">
> 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 class="">
> <br class="">
> 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 class="">
> <br class="">
> 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 class="">
> <br class="">
> Thanks.<br class="">
> <br class="">
> Joel<br class="">
</div></div>> ______________________________<wbr class="">_________________<br class="">
> LLVM Developers mailing list<br class="">
> <a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank" rel="noreferrer" class="">http://lists.llvm.org/cgi-bin/<wbr class="">mailman/listinfo/llvm-dev</a><br class="">
<br class="">
</blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></div></body></html>