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] - Rev 754

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

/* Test for designated initializers for anonymous structures and
   unions.  PR 10676.  */
/* { dg-do run } */
/* { dg-options "" } */
 
extern void abort (void);
extern void exit (int);
 
struct s
{
  int a;
  struct
  {
    int b;
    int c;
  };
  union
  {
    int d;
    struct
    {
      int e;
    };
  };
  struct
  {
    struct
    {
      struct
      {
	int f;
      };
    };
  };
};
 
struct s x =
  {
    .e = 5,
    .b = 4,
    .a = 3,
    .f = 7,
    .c = 9
  };
 
int
main (void)
{
  if (x.a != 3
      || x.b != 4
      || x.c != 9
      || x.d != 5
      || x.e != 5
      || x.f != 7)
    abort ();
  exit (0);
}
 

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

powered by: WebSVN 2.1.0

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