URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
extern void abort(void);
|
extern void abort(void);
|
|
|
struct foo {
|
struct foo {
|
int rank;
|
int rank;
|
char *name;
|
char *name;
|
};
|
};
|
|
|
struct mem {
|
struct mem {
|
struct foo *x[4];
|
struct foo *x[4];
|
};
|
};
|
|
|
void __attribute__((noinline)) bar(struct foo **f)
|
void __attribute__((noinline)) bar(struct foo **f)
|
{
|
{
|
*f = __builtin_malloc(sizeof(struct foo));
|
*f = __builtin_malloc(sizeof(struct foo));
|
}
|
}
|
struct foo * foo(int rank)
|
struct foo * foo(int rank)
|
{
|
{
|
void *x = __builtin_malloc(sizeof(struct mem));
|
void *x = __builtin_malloc(sizeof(struct mem));
|
struct mem *as = x;
|
struct mem *as = x;
|
struct foo **upper = &as->x[rank * 8 - 1];
|
struct foo **upper = &as->x[rank * 8 - 1];
|
*upper = 0;
|
*upper = 0;
|
bar(upper);
|
bar(upper);
|
return *upper;
|
return *upper;
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
if (foo(0) == 0)
|
if (foo(0) == 0)
|
abort ();
|
abort ();
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.