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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [931004-6.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
#include <stdarg.h>
2
 
3
struct tiny
4
{
5
  short c;
6
  short d;
7
};
8
 
9
f (int n, ...)
10
{
11
  struct tiny x;
12
  int i;
13
 
14
  va_list ap;
15
  va_start (ap,n);
16
  for (i = 0; i < n; i++)
17
    {
18
      x = va_arg (ap,struct tiny);
19
      if (x.c != i + 10)
20
        abort();
21
      if (x.d != i + 20)
22
        abort();
23
    }
24
  {
25
    long x = va_arg (ap, long);
26
    if (x != 123)
27
      abort();
28
  }
29
  va_end (ap);
30
}
31
 
32
main ()
33
{
34
  struct tiny x[3];
35
  x[0].c = 10;
36
  x[1].c = 11;
37
  x[2].c = 12;
38
  x[0].d = 20;
39
  x[1].d = 21;
40
  x[2].d = 22;
41
  f (3, x[0], x[1], x[2], (long) 123);
42
  exit(0);
43
}
44
 

powered by: WebSVN 2.1.0

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