OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [va-arg-4.c] - Blame information for rev 816

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
/* On the i960 any arg bigger than 16 bytes causes all subsequent args
2
   to be passed on the stack.  We test this.  */
3
 
4
#include <stdarg.h>
5
 
6
typedef struct {
7
  char a[32];
8
} big;
9
 
10
void
11
f (big x, char *s, ...)
12
{
13
  va_list ap;
14
 
15
  if (x.a[0] != 'a' || x.a[1] != 'b' || x.a[2] != 'c')
16
    abort ();
17
  va_start (ap, s);
18
  if (va_arg (ap, int) != 42)
19
    abort ();
20
  if (va_arg (ap, int) != 'x')
21
    abort ();
22
  if (va_arg (ap, int) != 0)
23
    abort ();
24
  va_end (ap);
25
}
26
 
27
main ()
28
{
29
  static big x = { "abc" };
30
 
31
  f (x, "", 42, 'x', 0);
32
  exit (0);
33
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.