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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [gcc.dg/] [c99-array-lval-7.c] - Blame information for rev 338

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* Test for non-lvalue arrays: test that C90 does not allow them in
2
   conditional expressions, while in C99 they decay and are
3
   allowed.  */
4
 
5
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
6
/* { dg-do compile } */
7
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
8
 
9
struct s { char c[1]; };
10
struct s a, b, c;
11
int d;
12
int e;
13
 
14
void
15
bar (void)
16
{
17
  /* In C90, the non-lvalue arrays do not decay to pointers, and
18
     6.3.15 does not permit conditional expressions between arrays.
19
     In C99, they decay to pointers.  */
20
  (e ? (d ? b : c).c : (e ? b : c).c);
21
}

powered by: WebSVN 2.1.0

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