URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 338 |
/* PR 24255 */
|
/* PR 24255 */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-O" } */
|
/* { dg-options "-O" } */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
|
|
union wait { int w_status; };
|
union wait { int w_status; };
|
|
|
typedef union
|
typedef union
|
{
|
{
|
union wait *uptr;
|
union wait *uptr;
|
int *iptr;
|
int *iptr;
|
} WAIT_STATUS __attribute__ ((__transparent_union__));
|
} WAIT_STATUS __attribute__ ((__transparent_union__));
|
|
|
int status;
|
int status;
|
union wait wstatus;
|
union wait wstatus;
|
|
|
void __attribute__((noinline))
|
void __attribute__((noinline))
|
test1 (WAIT_STATUS s)
|
test1 (WAIT_STATUS s)
|
{
|
{
|
if (s.iptr != &status)
|
if (s.iptr != &status)
|
abort ();
|
abort ();
|
}
|
}
|
|
|
void __attribute__((noinline))
|
void __attribute__((noinline))
|
test2 (WAIT_STATUS s)
|
test2 (WAIT_STATUS s)
|
{
|
{
|
if (s.uptr != &wstatus)
|
if (s.uptr != &wstatus)
|
abort ();
|
abort ();
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
test1 (&status);
|
test1 (&status);
|
test2 (&wstatus);
|
test2 (&wstatus);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.