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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [anon-struct-10.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 689 jeremybenn
/* Test for designated initializers for anonymous structures and
2
   unions.  PR 10676.  */
3
/* { dg-do run } */
4
/* { dg-options "" } */
5
 
6
extern void abort (void);
7
extern void exit (int);
8
 
9
struct s
10
{
11
  int a;
12
  struct
13
  {
14
    int b;
15
    int c;
16
  };
17
  union
18
  {
19
    int d;
20
    struct
21
    {
22
      int e;
23
    };
24
  };
25
  struct
26
  {
27
    struct
28
    {
29
      struct
30
      {
31
        int f;
32
      };
33
    };
34
  };
35
};
36
 
37
struct s x =
38
  {
39
    .e = 5,
40
    .b = 4,
41
    .a = 3,
42
    .f = 7,
43
    .c = 9
44
  };
45
 
46
int
47
main (void)
48
{
49
  if (x.a != 3
50
      || x.b != 4
51
      || x.c != 9
52
      || x.d != 5
53
      || x.e != 5
54
      || x.f != 7)
55
    abort ();
56
  exit (0);
57
}

powered by: WebSVN 2.1.0

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