URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
#include <stdarg.h>
|
#include <stdarg.h>
|
|
|
struct tiny
|
struct tiny
|
{
|
{
|
short c;
|
short c;
|
};
|
};
|
|
|
f (int n, ...)
|
f (int n, ...)
|
{
|
{
|
struct tiny x;
|
struct tiny x;
|
int i;
|
int i;
|
|
|
va_list ap;
|
va_list ap;
|
va_start (ap,n);
|
va_start (ap,n);
|
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
{
|
{
|
x = va_arg (ap,struct tiny);
|
x = va_arg (ap,struct tiny);
|
if (x.c != i + 10)
|
if (x.c != i + 10)
|
abort();
|
abort();
|
}
|
}
|
{
|
{
|
long x = va_arg (ap, long);
|
long x = va_arg (ap, long);
|
if (x != 123)
|
if (x != 123)
|
abort();
|
abort();
|
}
|
}
|
va_end (ap);
|
va_end (ap);
|
}
|
}
|
|
|
main ()
|
main ()
|
{
|
{
|
struct tiny x[3];
|
struct tiny x[3];
|
x[0].c = 10;
|
x[0].c = 10;
|
x[1].c = 11;
|
x[1].c = 11;
|
x[2].c = 12;
|
x[2].c = 12;
|
f (3, x[0], x[1], x[2], (long) 123);
|
f (3, x[0], x[1], x[2], (long) 123);
|
exit(0);
|
exit(0);
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.