<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><div><div><div></div><div><div><br></div><div><div><div>On Jun 7, 2013, at 9:44 AM, Stephen Lin <<a href="mailto:swlin@apple.com">swlin@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Understood :) although I personally think this is worth the complexity increase, from experience writing and debugging tests.<div><br></div><div>Anyone want to review this? If no one else thinks this is worthwhile I'm ok leaving it in my own tree for my own testing purposes--I'll just take out the -UNIQ suffix before submitting and run a script to put it back when debugging locally.</div><div><br></div><div>I'm also open to renaming the directive. Maybe CHECK-LABEL?</div><div><br></div><div>-Stephen<br><div><br><div><div>On May 29, 2013, at 1:18 PM, Eli Bendersky <<a href="mailto:eliben@google.com">eliben@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 29, 2013 at 11:07 AM, Reid Kleckner<span class="Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr">If this only affects error messages, could we simply teach FileCheck some heuristics for bounding the region of the intended match, based on common patterns like 'CHECK: define ...', 'CHECK: asdf:', or 'CHECK: }' ?</div><div class="gmail_extra"><br></div></blockquote><div><br></div><div>Oh, let's get over with it and just add a CHECK-THIS-PYTHON-FUNCTION: directive :-) I'm kidding of course, though the recent trend in FileCheck is worrisome - FileCheck may reach self awareness before TableGen!</div><div><br></div><div>Eli</div><div><br></div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, May 29, 2013 at 1:51 PM, Stephen Lin<span class="Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:swlin@post.harvard.edu" target="_blank">swlin@post.harvard.edu</a>></span><span class="Apple-converted-space"> </span>wrote:<br></div></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div><div class="h5">Anyone have any thoughts on this? :)<br><span><font color="#888888">-Stephen<br></font></span><div><br>---------- Forwarded message ----------<br>From: Stephen Lin <<a href="mailto:swlin@post.harvard.edu" target="_blank">swlin@post.harvard.edu</a>><br>Date: Sat, May 18, 2013 at 5:36 PM<br>Subject: [PATCH] Add CHECK-UNIQ directive to FileCheck to allow more<br>accurate error messages and error recovery<br>To:<span class="Apple-converted-space"> </span><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>Cc: Eli Bendersky <<a href="mailto:eliben@google.com" target="_blank">eliben@google.com</a>><br><br><br>Hi,<br><br>This patch adds a new directive, CHECK-UNIQ, which is meant to be used<br>to match unique identifier lines (like labels).<br><br>If present in a match file, FileCheck will use these directives to<br>split the input into blocks that are independently processed, ensuring<br>that a CHECK does not inadvertently match a line in a different block<br>(which can lead to a misleading/useless error message when the error<br>is eventually caught). Also, FileCheck can now recover from errors<br>within blocks by continuing to the next block.<br><br>Please let me know if you have any comments or suggestions.<br><br>Also, if people like this idea, I will also script a mass update of<br>tests to use CHECK-UNIQ in common cases, like assembly labels and IR<br>function definition lines. (I will include a sanity check to make sure<br>each pattern does indeed uniquely match a single line of the input<br>before updating.)<br><br>Stephen<br><br>---------- Forwarded message ----------<br>From: Eli Bendersky <<a href="mailto:eliben@google.com" target="_blank">eliben@google.com</a>><br>Date: Thu, Apr 25, 2013 at 10:37 AM<br>Subject: Re: [LLVMdev] Minor FileCheck proposal: CHECK-UNIQUE for<br>labels to improve error messages<br>To: Stephen Lin <<a href="mailto:swlin@post.harvard.edu" target="_blank">swlin@post.harvard.edu</a>><br>Cc: llvmdev <<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>><br><br><br>On Wed, Apr 24, 2013 at 8:05 PM, Stephen Lin <<a href="mailto:swlin@post.harvard.edu" target="_blank">swlin@post.harvard.edu</a>> wrote:<br>><br>> Hi,<br>><br>> Apologies if this has been proposed before; I couldn't find anything<br>> in basic searching.<br>><br>> I've been writing tests lately and noticed that the error messages are<br>> not very helpful in cases where a check is incorrect but matches<br>> something that occurs in a later block: the checker continues assuming<br>> that the matched line is correct (no matter how much farther ahead it<br>> occurs) and then provides a misleading error message some time later.<br>><br>> The problem is exacerbated if many similar tests are put in one file,<br>> since many checks can end up succeeding with unintended matches before<br>> something ends up failing.<br>><br>> I propose a simple addition to FileCheck syntax to improve error<br>> messages in this case: a CHECK-UNIQUE directive which indicates that a<br>> given check is a unique match that should only occur once (and only<br>> once) in a given file and can only be matched with the given<br>> CHECK-UNIQUE; this would be used for labels or any other unique<br>> identifier lines.<br>><br>> The CHECK-UNIQUE lines can then allow a better error message to be<br>> produced, by basically treating each section between CHECK-UNIQUE<br>> lines separately, so the actual line causing the error can be<br>> pinpointed more accurately.<br>><br>> Anyone else thing this is a good idea? I'm happy to work on this if so.<br><br><br>I like this idea. There are many places in the test cases where this<br>idiom is needed and currently CHECK followed by a CHECK-NOT is used,<br>which is cumbersome.<br><br>Eli<br></div><br></div></div>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br><br></blockquote></div><br></div><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br><br></blockquote></div><br></div></div>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br></blockquote></div><br></div></div>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></div></blockquote></div><br></div></div></div></div></div></body></html>