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-5.c] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
/* Test for non-lvalue arrays: test that the unary '&' operator is not
2
   allowed on them, for both C90 and C99.  */
3
 
4
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
5
/* { dg-do compile } */
6
/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
7
 
8
struct s { char c[1]; };
9
 
10
extern struct s foo (void);
11
struct s a, b, c;
12
int d;
13
 
14
void
15
bar (void)
16
{
17
  &((foo ()).c); /* { dg-bogus "warning" "warning in place of error" } */
18
  &((d ? b : c).c); /* { dg-bogus "warning" "warning in place of error" } */
19
  &((d, b).c); /* { dg-bogus "warning" "warning in place of error" } */
20
  &((a = b).c); /* { dg-bogus "warning" "warning in place of error" } */
21
}
22
/* { dg-error "lvalue" "bad address-of" { target *-*-* } 17 }
23
   { dg-error "lvalue" "bad address-of" { target *-*-* } 18 }
24
   { dg-error "lvalue" "bad address-of" { target *-*-* } 19 }
25
   { dg-error "lvalue" "bad address-of" { target *-*-* } 20 }
26
*/

powered by: WebSVN 2.1.0

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