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 |
/* { dg-do run } */
|
/* { dg-do run } */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
|
|
struct X {
|
struct X {
|
int a;
|
int a;
|
struct Y {
|
struct Y {
|
int b[4];
|
int b[4];
|
} b;
|
} b;
|
struct Y c;
|
struct Y c;
|
} m;
|
} m;
|
|
|
struct X n;
|
struct X n;
|
|
|
foo (int i)
|
foo (int i)
|
{
|
{
|
struct Y *p = (i > 10) ? &m.b : &n.c;
|
struct Y *p = (i > 10) ? &m.b : &n.c;
|
p->b[2] = 10;
|
p->b[2] = 10;
|
m.b.b[3] = 6;
|
m.b.b[3] = 6;
|
n.c.b[2] = 3;
|
n.c.b[2] = 3;
|
return p->b[2] + n.c.b[2] + m.b.b[3];
|
return p->b[2] + n.c.b[2] + m.b.b[3];
|
}
|
}
|
|
|
main()
|
main()
|
{
|
{
|
if (foo (3) != 12)
|
if (foo (3) != 12)
|
abort ();
|
abort ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.