URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
/* On the i960 any arg bigger than 16 bytes causes all subsequent args
|
/* On the i960 any arg bigger than 16 bytes causes all subsequent args
|
to be passed on the stack. We test this. */
|
to be passed on the stack. We test this. */
|
|
|
#include <stdarg.h>
|
#include <stdarg.h>
|
|
|
typedef struct {
|
typedef struct {
|
char a[32];
|
char a[32];
|
} big;
|
} big;
|
|
|
void
|
void
|
f (big x, char *s, ...)
|
f (big x, char *s, ...)
|
{
|
{
|
va_list ap;
|
va_list ap;
|
|
|
if (x.a[0] != 'a' || x.a[1] != 'b' || x.a[2] != 'c')
|
if (x.a[0] != 'a' || x.a[1] != 'b' || x.a[2] != 'c')
|
abort ();
|
abort ();
|
va_start (ap, s);
|
va_start (ap, s);
|
if (va_arg (ap, int) != 42)
|
if (va_arg (ap, int) != 42)
|
abort ();
|
abort ();
|
if (va_arg (ap, int) != 'x')
|
if (va_arg (ap, int) != 'x')
|
abort ();
|
abort ();
|
if (va_arg (ap, int) != 0)
|
if (va_arg (ap, int) != 0)
|
abort ();
|
abort ();
|
va_end (ap);
|
va_end (ap);
|
}
|
}
|
|
|
main ()
|
main ()
|
{
|
{
|
static big x = { "abc" };
|
static big x = { "abc" };
|
|
|
f (x, "", 42, 'x', 0);
|
f (x, "", 42, 'x', 0);
|
exit (0);
|
exit (0);
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.