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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [20011021-1.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test for various initializer warnings being suppressed by use of
2
   designated initializers.  */
3
 
4
/* { dg-do compile } */
5
/* { dg-options "-std=c99 -W -Wall -Wtraditional" } */
6
 
7
 
8
struct t
9
{
10
  int a;
11
  int b;
12
  int c;
13
};
14
 
15
union u
16
{
17
  int n;
18
  float i;
19
};
20
 
21
struct multilevel
22
{
23
   int x;
24
   struct t t;
25
   union u u;
26
   union u v;
27
   char *f;
28
};
29
 
30
struct t T0 = { 1 };            /* { dg-warning "(missing|near) init" } */
31
struct t T1 = { .a = 1 };       /* { dg-bogus "(missing|near) init" } */
32
 
33
union u U0 = { 1 };             /* { dg-warning "initialization of union" } */
34
union u U1 = { .i = 1 };        /* { dg-bogus "initialization of union" } */
35
 
36
struct multilevel M =
37
{
38
  12,
39
  { .b = 3 },                   /* { dg-bogus "(missing|near) init" } */
40
  { 4 },                        /* { dg-warning "initialization of union" } */
41
  { .n = 9 },                   /* { dg-bogus "initialization of union" } */
42
  /* "string here" */
43
};                              /* { dg-warning "(missing|near) init" } */

powered by: WebSVN 2.1.0

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