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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [c90-array-lval-1.c] - Blame information for rev 816

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
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
3
/* { dg-do compile } */
4
/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
5
 
6
struct s { char c[1]; };
7
 
8
extern struct s foo (void);
9
 
10
void
11
bar (void)
12
{
13
  char *t;
14
  (foo ()).c[0]; /* { dg-bogus "warning" "warning in place of error" } */
15
  t = (foo ()).c; /* { dg-bogus "warning" "warning in place of error" } */
16
  (foo ()).c + 1; /* { dg-bogus "warning" "warning in place of error" } */
17
}
18
/* { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 14 }
19
   { dg-error "non-lvalue|incompatible" "array not decaying to lvalue" { target *-*-* } 15 }
20
   { dg-error "non-lvalue|invalid" "array not decaying to lvalue" { target *-*-* } 16 }
21
*/

powered by: WebSVN 2.1.0

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