URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 384 |
/* Test cases of structures with volatile fields declared register:
|
/* Test cases of structures with volatile fields declared register:
|
should be allowed unless register name given but explicitly taking
|
should be allowed unless register name given but explicitly taking
|
the address forbidden. */
|
the address forbidden. */
|
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
|
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
|
|
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
|
|
struct S { volatile int field; };
|
struct S { volatile int field; };
|
|
|
void
|
void
|
f (void)
|
f (void)
|
{
|
{
|
register struct S a;
|
register struct S a;
|
register struct S b[2];
|
register struct S b[2];
|
register struct S c __asm__("nosuchreg"); /* { dg-error "object with volatile field" "explicit reg name" } */
|
register struct S c __asm__("nosuchreg"); /* { dg-error "object with volatile field" "explicit reg name" } */
|
&a; /* { dg-error "address of register" "explicit address" } */
|
&a; /* { dg-error "address of register" "explicit address" } */
|
b; /* { dg-error "address of register" "implicit address" } */
|
b; /* { dg-error "address of register" "implicit address" } */
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.