Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / declspec-8.c
blobea60126fe4408616a4e30e616bfda5ab6e049a8a
1 /* Test declaration specifiers. Test checks on storage class
2 specifiers and function specifiers in empty declarations. */
3 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
4 /* { dg-do compile } */
5 /* { dg-options "" } */
7 /* The constraints on storage class specifiers and function specifiers
8 must be met for empty declarations where they are useless. Thus
9 there may be only one storage class specifier (C90 6.5.1, C99
10 6.7.1#2) and "inline" must not be used because the declaration is
11 not that of an identifier for a function (C99 6.7.4#1), and
12 "register" and "auto" must not be used at file scope (C90 6.7, C99
13 6.9#2). */
15 static static struct s; /* { dg-error "error: duplicate 'static'" } */
16 /* { dg-warning "warning: useless storage class specifier in empty declaration" "static static" { target *-*-* } 15 } */
18 static extern struct t; /* { dg-error "error: multiple storage classes in declaration specifiers" } */
19 /* { dg-warning "warning: useless storage class specifier in empty declaration" "static extern" { target *-*-* } 18 } */
21 inline union u; /* { dg-error "error: 'inline' in empty declaration" } */
23 auto struct v; /* { dg-error "error: 'auto' in file-scope empty declaration" } */
25 register struct w; /* { dg-error "error: 'register' in file-scope empty declaration" } */
27 void
28 f (void)
30 auto union p; /* { dg-warning "warning: useless storage class specifier in empty declaration" } */
31 register struct q; /* { dg-warning "warning: useless storage class specifier in empty declaration" } */