[cfe-dev] alternate testing

reed kotler rkotler at mips.com
Fri Jan 11 19:05:38 PST 2013


On 01/11/2013 06:53 PM, David Blaikie wrote:
> On Fri, Jan 11, 2013 at 6:46 PM, reed kotler <rkotler at mips.com> wrote:
>> In some clang tests, they seem to use something other than filecheck
>>
>> for example in Sema/address_spaces.c
>>
>> // RUN: %clang_cc1 %s -fsyntax-only -verify
>>
>> #define _AS1 __attribute__((address_space(1)))
>> #define _AS2 __attribute__((address_space(2)))
>> #define _AS3 __attribute__((address_space(3)))
>>
>> void bar(_AS2 int a); // expected-error {{parameter may not be qualified
>> with an address space}}
>>
>> void foo(_AS3 float *a,
>>           _AS1 float b) // expected-error {{parameter may not be qualified
>> with an address space}}
>>
>>
>> Where is this documented?
> http://clang.llvm.org/doxygen/classclang_1_1VerifyDiagnosticConsumer.html#details
>
> (though, honestly, I've never read the documentation for it - picked
> it up most by reading/examples/experience. It's fairly simple)
Nice. The doc had what I was looking for.

expected-no-diagnostics


Seems like filecheck though is much more powerful. This must be an 
earlier method for generating tests.

But in my case I would need to write two different tests if I didn't use 
filecheck.

I'm just trying to test that
__attribute__(mips16)

continues to generate a warning if the architecture is not mips and 
generates no diagnostic if it is mips.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130111/4075ea99/attachment.html>


More information about the cfe-dev mailing list