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 } */
|
/* { dg-options "-O2" } */
|
/* { dg-options "-O2" } */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
|
|
struct S
|
struct S
|
{
|
{
|
int w, x, y, z;
|
int w, x, y, z;
|
};
|
};
|
|
|
struct T
|
struct T
|
{
|
{
|
int r;
|
int r;
|
struct S s;
|
struct S s;
|
};
|
};
|
|
|
struct S bar (struct S x, struct S *y)
|
struct S bar (struct S x, struct S *y)
|
{
|
{
|
y->w = 4;
|
y->w = 4;
|
return *y;
|
return *y;
|
}
|
}
|
|
|
void
|
void
|
foo (int a, struct T b)
|
foo (int a, struct T b)
|
{
|
{
|
struct S x;
|
struct S x;
|
struct S *c = &x;
|
struct S *c = &x;
|
if (a)
|
if (a)
|
c = &b.s;
|
c = &b.s;
|
b.s.w = 3;
|
b.s.w = 3;
|
/* This call should be marked as clobbering 'x' and 'b'. */
|
/* This call should be marked as clobbering 'x' and 'b'. */
|
*c = bar (*c, c);
|
*c = bar (*c, c);
|
if (b.s.w == 3)
|
if (b.s.w == 3)
|
abort ();
|
abort ();
|
}
|
}
|
|
|
float Y;
|
float Y;
|
|
|
struct S bar1 (struct S x, struct S y)
|
struct S bar1 (struct S x, struct S y)
|
{
|
{
|
Y = 4;
|
Y = 4;
|
return x;
|
return x;
|
}
|
}
|
|
|
void
|
void
|
foo1 (int a, struct T b)
|
foo1 (int a, struct T b)
|
{
|
{
|
struct S x;
|
struct S x;
|
struct S *c = &x;
|
struct S *c = &x;
|
float z, *k = &z;
|
float z, *k = &z;
|
if (a)
|
if (a)
|
c = &b.s;
|
c = &b.s;
|
b.s.w = 3;
|
b.s.w = 3;
|
/* This call should NOT be marked as clobbering 'x' and 'b'. */
|
/* This call should NOT be marked as clobbering 'x' and 'b'. */
|
x = bar1 (*c, *c);
|
x = bar1 (*c, *c);
|
if (b.s.w != 3)
|
if (b.s.w != 3)
|
link_error ();
|
link_error ();
|
}
|
}
|
|
|
int main ()
|
int main ()
|
{
|
{
|
struct T b;
|
struct T b;
|
foo (3, b);
|
foo (3, b);
|
foo1 (3, b);
|
foo1 (3, b);
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.