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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [strct-stdarg-1.c] - Blame information for rev 774

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

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

powered by: WebSVN 2.1.0

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