blob: 410ac3686f12617ec9b8275f6e2041134990be68 [file] [log] [blame]
Chris Lattner7b8134f2008-02-10 23:08:00 +00001// RUN: clang %s -fsyntax-only -verify -pedantic
Chris Lattnerdf89dd42006-08-06 18:22:00 +00002
Chris Lattner7cf04d12007-06-08 18:15:09 +00003extern int a1[];
Chris Lattnerdf89dd42006-08-06 18:22:00 +00004
5void f0();
6void f1(int [*]);
7void f2(int [const *]);
8void f3(int [volatile const*]);
Chris Lattner9d51f2b2008-04-05 06:32:51 +00009int f4(*XX)(void); /* expected-error {{cannot return}} expected-warning {{type specifier missing, defaults to 'int'}} */
Chris Lattnerdf89dd42006-08-06 18:22:00 +000010
11char ((((*X))));
12
13void (*signal(int, void (*)(int)))(int);
14
15int a, ***C, * const D, b(int);
16
17int *A;
18
Chris Lattner7bddb3f2006-08-13 19:59:13 +000019struct str;
20
Chris Lattner3b51ddf2006-08-12 18:40:31 +000021int test2(int *P, int A) {
Chris Lattner7bddb3f2006-08-13 19:59:13 +000022 struct str;
23
24 // Hard case for array decl, not Array[*].
Chris Lattner3b51ddf2006-08-12 18:40:31 +000025 int Array[*(int*)P+A];
26}
Chris Lattner7bddb3f2006-08-13 19:59:13 +000027
Chris Lattner67b450c2008-04-06 06:47:48 +000028typedef int atype;
29int test3(x,
30 atype /* expected-error {{unexpected type name 'atype': expected identifier}} */
31 ) int x, atype; {}
Chris Lattner7bddb3f2006-08-13 19:59:13 +000032