alternate testing

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?

Tia.

Reed

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. 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.

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.

I'm not sure that it came before FileCheck - I suspect it may've come
after. It's somewhat more convenient & has certain useful properties
that might be hard to express in FileCheck. (it's also not dissimilar
to a mode that GCC has)

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.

Given how small the test is I'd probably write it as two separate
-verify tests, but a test with two RUN lines (using two different
FileCheck prefixes) would also be fine, so far as I can tell.