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] - Blame information for rev 717

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

Line No. Rev Author Line
1 693 jeremybenn
// Test for C99-style designated array initializer
2
 
3
union U
4
{
5
  long l;
6
  const char *p;
7
};
8
 
9
__extension__ U u = { .p = "" };
10
 
11
__extension__ int i[4] = { [0] = 1, [1] = 2 };
12
 
13
// Currently, except for unions, the C++ front end only supports
14
// designators that designate the element that would have been initialized
15
// anyway.  While that's true, make sure that we get a sorry rather than
16
// bad code.
17
 
18
struct A
19
{
20
  int i;
21
  int j;
22
};
23
 
24
__extension__ A a = { .j = 1 }; // { dg-message "non-trivial" }
25
__extension__ int j[2] = { [1] = 1 }; // { dg-message "non-trivial" }

powered by: WebSVN 2.1.0

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