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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [Wdeclaration-after-statement-1.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* Test for -Wdeclaration-after-statement emitting warnings when no
2
   standard-specifying option is given.  See also c9?-mixdecl-*.  */
3
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
4
/* { dg-do run } */
5
/* { dg-options "-Wdeclaration-after-statement" } */
6
 
7
extern void abort (void);
8
extern void exit (int);
9
 
10
int
11
main (void)
12
{
13
  int i = 0;
14
  if (i != 0)
15
    abort ();
16
  i++;
17
  if (i != 1)
18
    abort ();
19
  int j = i;                            /* { dg-warning "" "declaration after statement" } */
20
  if (j != 1)
21
    abort ();
22
  struct foo { int i0; } k = { 4 };     /* { dg-warning "" "declaration after statement" } */
23
  if (k.i0 != 4)
24
    abort ();
25
  exit (0);
26
}

powered by: WebSVN 2.1.0

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