2018-06-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / declspec-7.c
blob10623e4ea77ed316a0111b4dfec8bae8a881775e
1 /* Test declaration specifiers. Test checks on storage class
2 specifiers that can be made at parse time rather than for each
3 declarator. Note that __thread is tested in
4 gcc.dg/tls/diag-*.c. */
5 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
6 /* { dg-do compile } */
7 /* { dg-options "-fgnu89-inline" } */
9 /* Duplicate specifiers. */
11 inline inline void f0 (void),
12 f1 (void);
14 static static int a, /* { dg-error "duplicate 'static'" } */
17 extern extern int c, /* { dg-error "duplicate 'extern'" } */
20 typedef typedef int e, /* { dg-error "duplicate 'typedef'" } */
23 void
24 h (void)
26 auto auto int p, /* { dg-error "duplicate 'auto'" } */
29 register register int r, /* { dg-error "duplicate 'register'" } */
33 /* Multiple specifiers. */
35 static extern int x, /* { dg-error "multiple storage classes in declaration specifiers" } */
38 extern typedef long z, /* { dg-error "multiple storage classes in declaration specifiers" } */