Chris Lattner | 99d724f | 2008-02-10 23:08:00 +0000 | [diff] [blame] | 1 | // RUN: clang %s -fsyntax-only -verify -pedantic |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 2 | |
| 3 | extern int a1[]; |
| 4 | |
| 5 | void f0(); |
| 6 | void f1(int [*]); |
| 7 | void f2(int [const *]); |
| 8 | void f3(int [volatile const*]); |
Chris Lattner | d658b56 | 2008-04-05 06:32:51 +0000 | [diff] [blame] | 9 | int f4(*XX)(void); /* expected-error {{cannot return}} expected-warning {{type specifier missing, defaults to 'int'}} */ |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 10 | |
| 11 | char ((((*X)))); |
| 12 | |
| 13 | void (*signal(int, void (*)(int)))(int); |
| 14 | |
| 15 | int a, ***C, * const D, b(int); |
| 16 | |
| 17 | int *A; |
| 18 | |
| 19 | struct str; |
| 20 | |
| 21 | int test2(int *P, int A) { |
| 22 | struct str; |
| 23 | |
| 24 | // Hard case for array decl, not Array[*]. |
| 25 | int Array[*(int*)P+A]; |
| 26 | } |
| 27 | |
Chris Lattner | aaf9ddb | 2008-04-06 06:47:48 +0000 | [diff] [blame] | 28 | typedef int atype; |
| 29 | int test3(x, |
| 30 | atype /* expected-error {{unexpected type name 'atype': expected identifier}} */ |
| 31 | ) int x, atype; {} |
Reid Spencer | 5f016e2 | 2007-07-11 17:01:13 +0000 | [diff] [blame] | 32 | |
Chris Lattner | 3825c2e | 2008-04-06 06:50:56 +0000 | [diff] [blame] | 33 | int test4(x, x) int x; {} /* expected-error {{redefinition of parameter 'x'}} */ |
| 34 | |
Chris Lattner | 1f6f54b | 2008-11-11 06:13:16 +0000 | [diff] [blame] | 35 | |
| 36 | // PR3031 |
| 37 | int (test5), ; // expected-error {{expected identifier or '('}} |
| 38 | |