[PATCH] Add ALL to FileCheck

Dmitri Gribenko gribozavr at gmail.com
Tue Aug 13 22:16:22 PDT 2013


On Tue, Aug 13, 2013 at 9:29 AM, Renato Golin <renato.golin at linaro.org> wrote:
> On 13 August 2013 17:11, Stephen Lin <swlin at post.harvard.edu> wrote:
>>
>> Exactly, my suggestion is for multiple prefixes only, and not ALL or
>> any other prefix that is turned on in all cases. Only "CHECK" is
>> grandfathered is as an implicit prefix, and it is only used in the
>> case that no other prefix is provided.
>
>
> Ok, that makes sense. I think I prefer this way, too.
>
> Matt, do you have any views on this? Anyone else?

+1.  Saving the command output and then doing multiple passes over the
output is a common pattern in LLVM and Clang tests.  If FileCheck
supported multiple check-prefixes we could simplify a lot of tests.

A note on implementation: it makes sense to define FileCheck
-check-prefix=A -check-prefix=B to work exactly the same as two
FileCheck invocations (*not* as a single one with a concatenation of
all check lines).  This will allow us to easily write global negative
patterns:

RUN: %llvm-foo %S | FileCheck -check-prefix=GOOD1 -check-prefix=GOOD2
-check-prefix=BAD

// GOOD1: ...
// GOOD2: ...
// Ensure that we don't have this anywhere in the output:
// BAD-NOT: call baz

Dmitri

-- 
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/



More information about the llvm-commits mailing list