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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 689 jeremybenn
/* Test obsolete forms of designated initializers.  Test with default
2
   warning options: valid forms are accepted, while ".member" without
3
   "=" should not be (bug 16667).  */
4
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
5
/* { dg-do compile } */
6
/* { dg-options "" } */
7
struct s { int a; };
8
struct s s0 = { .a = 1 };
9
struct s s1 = { a: 1 };
10
 
11
int x0[] = { [0] = 1 };
12
int x1[] = { [0] 1 };
13
 
14
/* Invalid syntax: multiple designators without "=".  */
15
int x2[2][2] = { [0][0] 1 }; /* { dg-error "syntax error|parse error|expected" } */
16
 
17
 
18
/* Invalid syntax: C99-style structure designator without "=".  */
19
struct s s2 = { .a 1 }; /* { dg-error "syntax error|parse error|expected" } */

powered by: WebSVN 2.1.0

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