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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [reg-vol-struct-1.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test cases of structures with volatile fields declared register:
2
   should be allowed unless register name given but explicitly taking
3
   the address forbidden.  */
4
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
5
 
6
/* { dg-do compile } */
7
 
8
struct S { volatile int field; };
9
 
10
void
11
f (void)
12
{
13
  register struct S a;
14
  register struct S b[2];
15
  register struct S c __asm__("nosuchreg"); /* { dg-error "object with volatile field" "explicit reg name" } */
16
  &a; /* { dg-warning "address of register" "explicit address" } */
17
  b; /* { dg-warning "address of register" "implicit address" } */
18
}

powered by: WebSVN 2.1.0

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