OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [c99-array-lval-3.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test for non-lvalue arrays decaying to pointers: in C99 only.
2
   Test various ways of producing non-lvalue arrays.  */
3
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
4
/* { dg-do compile } */
5
/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
6
 
7
struct s { char c[1]; };
8
struct s a, b, c;
9
int d;
10
 
11
void
12
bar (void)
13
{
14
  char *t;
15
  (d ? b : c).c[0];
16
  (d, b).c[0];
17
  (a = b).c[0];
18
  t = (d ? b : c).c;
19
  t = (d, b).c;
20
  t = (a = b).c;
21
  (d ? b : c).c + 1;
22
  (d, b).c + 1;
23
  (a = b).c + 1;
24
}

powered by: WebSVN 2.1.0

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