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-3.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* PR 35058: -Werror= works only with some warnings. */
2
/* { dg-do compile } */
3
/* { dg-options "-std=c99 -pedantic -Werror=declaration-after-statement" } */
4
 
5
extern void abort (void);
6
extern void exit (int);
7
 
8
int
9
main (void)
10
{
11
  int i = 0;
12
  if (i != 0)
13
    abort ();
14
  i++;
15
  if (i != 1)
16
    abort ();
17
  int j = i;                            /* { dg-error "" "declaration-after-statement" } */
18
  if (j != 1)
19
    abort ();
20
  struct foo { int i0; } k = { 4 };     /* { dg-error "" "declaration-after-statement" } */
21
  if (k.i0 != 4)
22
    abort ();
23
  exit (0);
24
}

powered by: WebSVN 2.1.0

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