URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
/* { dg-do run } */
|
/* { dg-do run } */
|
/* { dg-options "-O2 -fomit-frame-pointer" } */
|
/* { dg-options "-O2 -fomit-frame-pointer" } */
|
/* { dg-options "-O2 -fomit-frame-pointer -march=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
|
/* { dg-options "-O2 -fomit-frame-pointer -march=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
extern void exit (int);
|
extern void exit (int);
|
|
|
struct S
|
struct S
|
{
|
{
|
int *a;
|
int *a;
|
unsigned char *b, c;
|
unsigned char *b, c;
|
};
|
};
|
|
|
int u, v, w;
|
int u, v, w;
|
|
|
void
|
void
|
foo (unsigned short x)
|
foo (unsigned short x)
|
{
|
{
|
u += x;
|
u += x;
|
}
|
}
|
|
|
int
|
int
|
bar (struct S **x, int *y)
|
bar (struct S **x, int *y)
|
{
|
{
|
w += *y;
|
w += *y;
|
*y = w + 25;
|
*y = w + 25;
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int
|
int
|
baz (struct S **x)
|
baz (struct S **x)
|
{
|
{
|
struct S *y = *x;
|
struct S *y = *x;
|
unsigned char *a = y->b;
|
unsigned char *a = y->b;
|
|
|
foo (*a);
|
foo (*a);
|
|
|
if (__builtin_expect (y->c != 0 || y->a == &v, 0))
|
if (__builtin_expect (y->c != 0 || y->a == &v, 0))
|
return 1;
|
return 1;
|
|
|
if (__builtin_expect (*a == 1, 0))
|
if (__builtin_expect (*a == 1, 0))
|
{
|
{
|
int a, b = bar (x, &a);
|
int a, b = bar (x, &a);
|
|
|
if (a)
|
if (a)
|
return b;
|
return b;
|
}
|
}
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
int
|
int
|
main (void)
|
main (void)
|
{
|
{
|
struct S a, *b = &a;
|
struct S a, *b = &a;
|
unsigned char c;
|
unsigned char c;
|
|
|
__builtin_memset (b, 0, sizeof (a));
|
__builtin_memset (b, 0, sizeof (a));
|
a.a = &v;
|
a.a = &v;
|
a.b = &c;
|
a.b = &c;
|
if (baz (&b) != 1)
|
if (baz (&b) != 1)
|
abort ();
|
abort ();
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.