[llvm-commits] PATCH: Add CHECK-FIRST/LAST to FIleCheck

Argyris Kyrtzidis akyrtzi at gmail.com
Fri Oct 9 14:00:45 PDT 2009


On Oct 9, 2009, at 7:53 AM, Chris Lattner wrote:

> On Oct 8, 2009, at 12:20 PM, Argyris Kyrtzidis wrote:
>>>> can't CHECK-NOT be used for this?  If a NOT could be added before  
>>>> the first line, then you could do CHECK-NOT: {{.}} or something  
>>>> like that.
>>>
>>> "CHECK-NOT: {{.}}" is not good because it will reject inputs that  
>>> have characters on the same line as 'foo', e.g.
>>>
>>> "bar foo"
>>>
>>> should be a valid input but the above CHECK-NOT will reject it.
>>>
>>> I couldn't put a CHECK-NOT to work as the -empty-before (and - 
>>> after), any suggestions ?
>>>
>>> -Argiris
>>
>> Ping ? Can the command line options go in ?
>
> Hi Argiris,
>
> I'm sorry, I must have missed your previous email.  Don't ^ and $  
> work in regex's?  What is the use case for this feature?

Say I have this check:

// CHECK: foo

I want it to accept an output that only contains one line with "foo"  
in it, so

"my foo" - accepted

"blah
my foo" - rejected

"my foo
blah" - rejected

I couldn't make it work using CHECK-NOT

> I'd really rather make check lines be explicit in the file instead  
> of being command line arguments to file check.

In addition to the originally proposed CHECK-FIRST/LAST directives,  
how about also:

CHECK-FIRST-LAST (only one line)
CHECK-NEXT-LAST (follows the previous check and is the last one)

?

-Argiris




More information about the llvm-commits mailing list