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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [ext/] [desig2.C] - Rev 696

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

// Test for C99-style designated array initializer

union U
{
  long l;
  const char *p;
};

__extension__ U u = { .p = "" };

__extension__ int i[4] = { [0] = 1, [1] = 2 };

// Currently, except for unions, the C++ front end only supports
// designators that designate the element that would have been initialized
// anyway.  While that's true, make sure that we get a sorry rather than
// bad code.

struct A
{
  int i;
  int j;
};

__extension__ A a = { .j = 1 }; // { dg-message "non-trivial" }
__extension__ int j[2] = { [1] = 1 }; // { dg-message "non-trivial" }

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.