diff options
author | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
commit | f27e5a09a0d815b8a4814152954ff87dadfdefc0 (patch) | |
tree | ce7d964cbb5e39695b71481698f10cb099c23d4a /test/Parser/recovery.c | |
download | FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.zip FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.tar.gz |
Import Clang, at r72732.
Diffstat (limited to 'test/Parser/recovery.c')
-rw-r--r-- | test/Parser/recovery.c | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/test/Parser/recovery.c b/test/Parser/recovery.c new file mode 100644 index 0000000..89eac56 --- /dev/null +++ b/test/Parser/recovery.c @@ -0,0 +1,75 @@ +// RUN: clang-cc -fsyntax-only -verify -pedantic -fblocks %s + +// PR2241 +float test2241[2] = { + 1e, // expected-error {{exponent}} + 1ee0 // expected-error {{exponent}} +}; + + +// Testcase derived from PR2692 +static char *f (char * (*g) (char **, int), char **p, ...) { + char *s; + va_list v; // expected-error {{identifier}} + s = g (p, __builtin_va_arg(v, int)); // expected-error {{identifier}} +} + + +// PR3172 +} // expected-error {{expected external declaration}} + + +// rdar://6094870 +int test(int a) { + struct { int i; } x; + + if (x.hello) // expected-error {{no member named 'hello'}} + test(0); + else + ; + + if (x.hello == 0) // expected-error {{no member named 'hello'}} + test(0); + else + ; + + if ((x.hello == 0)) // expected-error {{no member named 'hello'}} + test(0); + else + ; + + if (x.i == 0)) // expected-error {{expected expression}} + test(0); + else + ; +} + + + +char (((( /* expected-note {{to match this '('}} */ + *X x ] )))); /* expected-error {{expected ')'}} */ + +; // expected-warning {{ISO C does not allow an extra ';' outside of a function}} + + + + +struct S { void *X, *Y; }; + +struct S A = { +&BADIDENT, 0 /* expected-error {{use of undeclared identifier}} */ +}; + +// rdar://6248081 +int test6248081() { + [10] // expected-error {{expected expression}} +} + +struct forward; // expected-note{{forward declaration of 'struct forward'}} +void x(struct forward* x) {switch(x->a) {}} // expected-error {{incomplete definition of type}} + +// PR3410 +void foo() { + int X; + X = 4 // expected-error{{expected ';' after expression}} +} |