<div dir="ltr">how about -allow-unused-prefixes=needs_review</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 9, 2020 at 3:54 PM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</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">I don't feel too strongly about the "=true" bit for legitimate cases -<br>
I'd prefer not to have it, but it's not the end of the world.<br>
I do feel more strongly that if you're going to automatically add it<br>
to cases that might not've intended to use that feature, it be pretty<br>
clear - I don't think "script_allowed" quite captures/highlights/makes<br>
it clear to the casual reader (why might not've seen this discussion<br>
or seen the flag before) that this was added automatically and there's<br>
a good chance the use of this feature is probably more likely than not<br>
unintentional/in need of cleanup.<br>
<br>
On Mon, Nov 9, 2020 at 3:48 PM Mircea Trofin <<a href="mailto:mtrofin@google.com" target="_blank">mtrofin@google.com</a>> wrote:<br>
><br>
> My preference would be to go with the tri-value option - I think the downside of folks needing to write a value after "-allow-unused-prefixes" is not that terrible; if folks feel that using true/false/auto is weird, how about "allowed/disallowed/script_allowed" or something like that. I'd argue that the value here is getting to the place where the default is right (so we stop the bleeding), and where the scripted cleanup can be easily audited subsequently.<br>
><br>
> On Mon, Nov 9, 2020 at 2:22 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
>><br>
>> On Mon, Nov 9, 2020 at 2:06 PM Mircea Trofin <<a href="mailto:mtrofin@google.com" target="_blank">mtrofin@google.com</a>> wrote:<br>
>> ><br>
>> ><br>
>> ><br>
>> > On Mon, Nov 9, 2020 at 1:54 PM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
>> >><br>
>> >> On Mon, Nov 9, 2020 at 10:18 AM Mircea Trofin via llvm-dev<br>
>> >> <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> >> ><br>
>> >> > There's a wrinkle in this: some tests (clang ones, for instance) have output checks depending on the line position of the input. For example, they check debug info. Adding // FIXME: comments shift that.<br>
>> >><br>
>> >> Got a sense of roughly how many are like this? (have you found a lot,<br>
>> >> or so far just a few?) FileCheck has mechanism for referencing the<br>
>> >> current (& relative) line numbers which can help make tests like this<br>
>> >> more flexible - if it's only a few I'd be in favor of improving the<br>
>> >> tests to use that sort of thing.<br>
>> ><br>
>> ><br>
>> > Tens. I'd be happy to mark them in the spreadsheet, if anyone wants to fix them that way.<br>
>><br>
>> Yeah, sound worth some annotation on the spreadsheet.<br>
>><br>
>> >> > If the goal is easy identification of auto-inserted -allow-unused-prefixes directives, how about:<br>
>> >> > - we make the flag an enum: true, false, and auto_inserted<br>
>> >> > - we use -allow-unused-prefixes=auto_inserted for the scripts<br>
>> >> ><br>
>> >> > This allows easy identification, and should be easier to script without requiring more significant test by test surgery.<br>
>> >> ><br>
>> >> > WDYT?<br>
>> >><br>
>> >> Not hugely in favor, but plausible - I'd probably use a long/fairly<br>
>> >> explanatory name, but don't have great ideas for what that'd be.<br>
>> >> "-allow-unused-prefixes=allowed_by_cleanup_please_check_if_usage_is_intentional"<br>
>> >> or something.<br>
>> ><br>
>> ><br>
>> > Right, or a separate flag dedicated to this.<br>
>><br>
>> *nod* Yeah, if adding this name would mean everyone else has to write<br>
>> "=true" instead of just the bare "-allow-unused-prefixes", another<br>
>> flag would be good. (otherwise maybe another flag would help make it<br>
>> more readable so it doesn't end up with confusing semantics due to the<br>
>> '=', etc).<br>
>><br>
>> ><br>
>> >><br>
>> >><br>
>> >> ><br>
>> >> > On Fri, Nov 6, 2020 at 7:13 AM Mircea Trofin <<a href="mailto:mtrofin@google.com" target="_blank">mtrofin@google.com</a>> wrote:<br>
>> >> >><br>
>> >> >> Oh! Perfect - thanks!<br>
>> >> >><br>
>> >> >> (plus, if it becomes unsupported, there's another nudge to fix :) )<br>
>> >> >><br>
>> >> >> On Fri, Nov 6, 2020 at 7:05 AM James Henderson <<a href="mailto:jh7370.2008@my.bristol.ac.uk" target="_blank">jh7370.2008@my.bristol.ac.uk</a>> wrote:<br>
>> >> >>><br>
>> >> >>> I recently discovered that multi-line RUN statements can actually be interrupted with non-RUN lines, without changing the behaviour. In other words, you can do something like:<br>
>> >> >>><br>
>> >> >>> # RUN: some command --option1 \<br>
>> >> >>> ## Comment<br>
>> >> >>> # CHECK: check something<br>
>> >> >>> # RUN: --option2<br>
>> >> >>><br>
>> >> >>> And you'd end up with "some command --option1 --option2" being run. It's rather surprising behaviour, and not one I'd generally recommend exercising, but maybe in this context it would be okay?<br>
>> >> >>><br>
>> >> >>> On Fri, 6 Nov 2020 at 15:00, Mircea Trofin <<a href="mailto:mtrofin@google.com" target="_blank">mtrofin@google.com</a>> wrote:<br>
>> >> >>>><br>
>> >> >>>><br>
>> >> >>>><br>
>> >> >>>> On Fri, Nov 6, 2020 at 2:22 AM James Henderson <<a href="mailto:jh7370.2008@my.bristol.ac.uk" target="_blank">jh7370.2008@my.bristol.ac.uk</a>> wrote:<br>
>> >> >>>>><br>
>> >> >>>>> I think it would make more sense to add it at each individual call site. This ensures that all cases are fixed, rather than just one in a file. It also ensures that in the (hopefully unlikely) event that there are both intentional and unintentional use-cases within a file, each one gets checked.<br>
>> >> >>>>><br>
>> >> >>>> That would be better indeed, but may be trickier to automate - the challenge, in my mind, comes from multi-line RUN statements, but maybe I'm missing something / maybe there aren't that many. If folks have suggestions, please don't hesitate to throw them my way!<br>
>> >> >>>><br>
>> >> >>>> Thanks!<br>
>> >> >>>><br>
>> >> >>>>><br>
>> >> >>>>> On Thu, 5 Nov 2020 at 20:29, Mircea Trofin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> >> >>>>>><br>
>> >> >>>>>> Thanks!<br>
>> >> >>>>>><br>
>> >> >>>>>> On Thu, Nov 5, 2020 at 11:50 AM Fāng-ruì Sòng <<a href="mailto:maskray@google.com" target="_blank">maskray@google.com</a>> wrote:<br>
>> >> >>>>>>><br>
>> >> >>>>>>> On Thu, Nov 5, 2020 at 11:36 AM David Blaikie via llvm-dev<br>
>> >> >>>>>>> <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> >> >>>>>>> ><br>
>> >> >>>>>>> ><br>
>> >> >>>>>>> ><br>
>> >> >>>>>>> > On Thu, Nov 5, 2020 at 10:46 AM Mircea Trofin <<a href="mailto:mtrofin@google.com" target="_blank">mtrofin@google.com</a>> wrote:<br>
>> >> >>>>>>> >><br>
>> >> >>>>>>> >><br>
>> >> >>>>>>> >><br>
>> >> >>>>>>> >> On Thu, Nov 5, 2020 at 10:40 AM David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
>> >> >>>>>>> >>><br>
>> >> >>>>>>> >>><br>
>> >> >>>>>>> >>><br>
>> >> >>>>>>> >>> On Thu, Nov 5, 2020 at 7:30 AM Mircea Trofin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
>> >> >>>>>>> >>>><br>
>> >> >>>>>>> >>>> There are currently 1350 owner-less failures in the spreadsheet. These seem to be the larger areas there.<br>
>> >> >>>>>>> >>>><br>
>> >> >>>>>>> >>>> If you see an area you have ownership or expertise in, please sign up for fixing the tests by Monday, Nov. 9.<br>
>> >> >>>>>>> >>>><br>
>> >> >>>>>>> >>>> Otherwise, I will "blanket-add" --allow-unused-prefixes=true to the remaining failing tests.<br>
>> >> >>>>>>> >>><br>
>> >> >>>>>>> >>><br>
>> >> >>>>>>> >>> If/when you do that, probably worth adding a comment at each site to clarify that this was added automatically, not vetted/intentionally added by a human. Something like "// FIXME: Verify that unused prefixes are used intentionally" or the like.<br>
>> >> >>>>>>> >><br>
>> >> >>>>>>> >> Ack. or, we can grep for -allow-unused-prefixes=true, wdyt?<br>
>> >> >>>>>>> ><br>
>> >> >>>>>>> ><br>
>> >> >>>>>>> > Not sure I understand <a href="https://teams.googleplex.com/u/when" target="_blank">who/when</a> they would grep for that?<br>
>> >> >>>>>><br>
>> >> >>>>>><br>
>> >> >>>>>> AAh! Nevermind me :) forgot that there are reasonable cases using it. Yes, it makes sense to add a FIXME, perhaps at the start of each file<br>
>> >> >>>>>><br>
>> >> >>>>>>><br>
>> >> >>>>>>> ><br>
>> >> >>>>>>> > I was suggesting adding an explicit "this use of --allow-unused-prefixes=true hasn't been confirmed as intentional" so that the backwards compatibility cases can be distinguished from the intentional cases when someone is reading the test case, rather than puzzling over why this flag was added (which looks intentional) though the unused prefix may not make sense in that particular test. It'll make it easier in the future when someone does look at the test for them to not feel like they're being implicitly told "this use of unused prefixes is intentional" (by the presence of an explicit flag requesting such support) while staring at the test and not being able to see why someone would've done that intentionally.<br>
>> >> >>>>>>><br>
>> >> >>>>>>> Directly CCing some folks who can fix or find people to fix some<br>
>> >> >>>>>>> directories (*/AMDGPU, */X86, */OpenMP, */AArch64) on<br>
>> >> >>>>>>> <a href="https://docs.google.com/spreadsheets/d/1o6q3XH1n3DDyyccnYZ_kVfhFbTDzC_S09e973_cwYuw/edit#gid=0" rel="noreferrer" target="_blank">https://docs.google.com/spreadsheets/d/1o6q3XH1n3DDyyccnYZ_kVfhFbTDzC_S09e973_cwYuw/edit#gid=0</a><br>
>> >> >>>>>>> After these big directories are cleaned up, the remaining tests should<br>
>> >> >>>>>>> be manageable in amount.<br>
>> >> >>>>>>><br>
>> >> >>>>>>> How to reproduce:<br>
>> >> >>>>>>><br>
>> >> >>>>>>> sed -i '/allow-unused-prefixes/s/true/false/' llvm/utils/FileCheck/FileCheck.cpp<br>
>> >> >>>>>>> git update-index --assume-unchanged llvm/utils/FileCheck/FileCheck.cpp<br>
>> >> >>>>>>> ninja check-llvm # or check-clang ...<br>
>> >> >>>>>>><br>
>> >> >>>>>>><br>
>> >> >>>>>>><br>
>> >> >>>>>>><br>
>> >> >>>>>>> >>><br>
>> >> >>>>>>> >>><br>
>> >> >>>>>>> >>>><br>
>> >> >>>>>>> >>>><br>
>> >> >>>>>>> >>>><br>
>> >> >>>>>>> >>>> On Fri, Oct 30, 2020 at 12:48 PM Mircea Trofin <<a href="mailto:mtrofin@google.com" target="_blank">mtrofin@google.com</a>> wrote:<br>
>> >> >>>>>>> >>>>><br>
>> >> >>>>>>> >>>>> An update: as of 871d658c9ceb, the flag is now available, if folks need to use it.<br>
>> >> >>>>>>> >>>>><br>
>> >> >>>>>>> >>>>> On Thu, Oct 29, 2020 at 10:28 AM Mircea Trofin <<a href="mailto:mtrofin@google.com" target="_blank">mtrofin@google.com</a>> wrote:<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> Hello all,<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> TL;DR; if you used FileCheck --check-prefixes and you missed (misspelled, for instance) one of the prefixes in your test, FileCheck silently ignores that and the test passes.<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> 1579 tests have this property.<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> The details<br>
>> >> >>>>>>> >>>>>> =========<br>
>> >> >>>>>>> >>>>>> Please refer to <a href="https://reviews.llvm.org/D90281" rel="noreferrer" target="_blank">https://reviews.llvm.org/D90281</a> and the discussion there for more details (make sure you open "older changes" for full context)<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> The problem is covered by the TL;DR;.<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> The proposal is to add an explicit flag to FileCheck, --allow-unused-prefixes, to indicate whether the current behavior is intended (for instance, jdoerfert contributed a scenario where that is the case).<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> We want the default behavior to be 'strict', i.e. --allow-unused-prefixes=false. Doing that right now would lead to 1500 test failures.<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> To get there (thanks, maskray, for suggestion), we propose we:<br>
>> >> >>>>>>> >>>>>> * land D90281 where the flag is introduced, but is flipped to match today's behavior<br>
>> >> >>>>>>> >>>>>> * employ a 'busy beavers' approach, where test maintainers patch their tests:<br>
>> >> >>>>>>> >>>>>> - either leveraging the flag, to explicitly indicate that unused prefixes is intended (i.e. add --allow-unused-patches=true); or<br>
>> >> >>>>>>> >>>>>> - fix the test (e.g. maybe there was a misspelling issue/omission/etc).<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> A spreadsheet with the failing tests is available here [1].<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> The request to the community members is to please sign up for their respective area in the spreadsheet, and then mark it completed when that's the case (yes/no in the respective column).<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> When all the tests are fixed, we will then flip --allow-unused-prefixes to false by default.<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> Meanwhile, please consider leveraging the flag explicitly when you author new tests that use --check-prefixes. That can be then cleaned up easily after we switch to the 'strict' behavior.<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> Thanks!<br>
>> >> >>>>>>> >>>>>><br>
>> >> >>>>>>> >>>>>> [1] <a href="https://docs.google.com/spreadsheets/d/1o6q3XH1n3DDyyccnYZ_kVfhFbTDzC_S09e973_cwYuw/edit?usp=sharing" rel="noreferrer" target="_blank">https://docs.google.com/spreadsheets/d/1o6q3XH1n3DDyyccnYZ_kVfhFbTDzC_S09e973_cwYuw/edit?usp=sharing</a><br>
>> >> >>>>>>> >>>><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>
>> >> >>>>>>> ><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>
>> >> >>>>>>><br>
>> >> >>>>>>><br>
>> >> >>>>>>><br>
>> >> >>>>>>> --<br>
>> >> >>>>>>> 宋方睿<br>
>> >> >>>>>><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>
>> >> ><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>