OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [declspec-8.c] - Diff between revs 298 and 338

Only display areas with differences | Details | Blame | View Log

Rev 298 Rev 338
/* Test declaration specifiers.  Test checks on storage class
/* Test declaration specifiers.  Test checks on storage class
   specifiers and function specifiers in empty declarations.  */
   specifiers and function specifiers in empty declarations.  */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-do compile } */
/* { dg-options "" } */
/* { dg-options "" } */
 
 
/* The constraints on storage class specifiers and function specifiers
/* The constraints on storage class specifiers and function specifiers
   must be met for empty declarations where they are useless.  Thus
   must be met for empty declarations where they are useless.  Thus
   there may be only one storage class specifier (C90 6.5.1, C99
   there may be only one storage class specifier (C90 6.5.1, C99
   6.7.1#2) and "inline" must not be used because the declaration is
   6.7.1#2) and "inline" must not be used because the declaration is
   not that of an identifier for a function (C99 6.7.4#1), and
   not that of an identifier for a function (C99 6.7.4#1), and
   "register" and "auto" must not be used at file scope (C90 6.7, C99
   "register" and "auto" must not be used at file scope (C90 6.7, C99
   6.9#2).  */
   6.9#2).  */
 
 
static static struct s; /* { dg-error "duplicate 'static'" } */
static static struct s; /* { dg-error "duplicate 'static'" } */
/* { dg-warning "useless storage class specifier in empty declaration" "static static" { target *-*-* } 15 } */
/* { dg-warning "useless storage class specifier in empty declaration" "static static" { target *-*-* } 15 } */
 
 
static extern struct t; /* { dg-error "multiple storage classes in declaration specifiers" } */
static extern struct t; /* { dg-error "multiple storage classes in declaration specifiers" } */
/* { dg-warning "useless storage class specifier in empty declaration" "static extern" { target *-*-* } 18 } */
/* { dg-warning "useless storage class specifier in empty declaration" "static extern" { target *-*-* } 18 } */
 
 
inline union u; /* { dg-error "'inline' in empty declaration" } */
inline union u; /* { dg-error "'inline' in empty declaration" } */
 
 
auto struct v; /* { dg-error "'auto' in file-scope empty declaration" } */
auto struct v; /* { dg-error "'auto' in file-scope empty declaration" } */
 
 
register struct w; /* { dg-error "'register' in file-scope empty declaration" } */
register struct w; /* { dg-error "'register' in file-scope empty declaration" } */
 
 
void
void
f (void)
f (void)
{
{
  auto union p; /* { dg-warning "useless storage class specifier in empty declaration" } */
  auto union p; /* { dg-warning "useless storage class specifier in empty declaration" } */
  register struct q; /* { dg-warning "useless storage class specifier in empty declaration" } */
  register struct q; /* { dg-warning "useless storage class specifier in empty declaration" } */
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.