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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [Woverride-init-1.c] - Blame information for rev 689

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Test for warnings for overriding designated initializers:
2
   -Woverride-init.  Bug 24010.  */
3
/* Origin: Joseph Myers <joseph@codesourcery.com> */
4
/* { dg-do compile } */
5
/* { dg-options "-Woverride-init" } */
6
 
7
struct s { int a; int b; int c; };
8
union u { char a; long long b; };
9
 
10
struct s s0 = {
11
  .a = 1,
12
  .b = 2,
13
  .a = 3, /* { dg-warning "initialized field overwritten|near init" } */
14
  4, /* { dg-warning "initialized field overwritten|near init" } */
15
  5
16
};
17
 
18
union u u0 = {
19
  .a = 1,
20
  .b = 2, /* { dg-warning "initialized field overwritten|near init" } */
21
  .a = 3 }; /* { dg-warning "initialized field overwritten|near init" } */
22
 
23
int a[5] = {
24
  [0] = 1,
25
  [1] = 2,
26
  [0] = 3, /* { dg-warning "initialized field overwritten|near init" } */
27
  [2] = 4
28
};

powered by: WebSVN 2.1.0

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