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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [nested-func-2.c] - Blame information for rev 867

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* PR middle-end/18820 */
2
/* Check that we reject nested functions as initializers
3
   of static variables.  */
4
 
5
/* { dg-do compile } */
6
/* { dg-options "" } */
7
 
8
struct S {
9
  void (*f)(int);
10
};
11
 
12
extern void baz(struct S *);
13
extern void p(int);
14
 
15
void foo(void)
16
{
17
  int u;
18
 
19
  void bar(int val)
20
    {
21
      u = val;
22
    }
23
 
24
  static struct S s = { bar }; /* { dg-error "(is not constant)|(near initialization)" } */
25
 
26
  baz(&s);
27
  p(u);
28
}

powered by: WebSVN 2.1.0

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