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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [va-arg-15.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
void vafunction (char *dummy, ...)
4
{
5
  double darg;
6
  int iarg;
7
  int flag = 0;
8
  int i;
9
  va_list ap;
10
 
11
  va_start(ap, dummy);
12
  for (i = 1; i <= 18; i++, flag++)
13
    {
14
      if (flag & 1)
15
        {
16
          darg = va_arg (ap, double);
17
          if (darg != (double)i)
18
            abort();
19
        }
20
      else
21
        {
22
          iarg = va_arg (ap, int);
23
          if (iarg != i)
24
            abort();
25
        }
26
    }
27
    va_end(ap);
28
}
29
 
30
int main (void)
31
{
32
  vafunction( "",
33
        1, 2.,
34
        3, 4.,
35
        5, 6.,
36
        7, 8.,
37
        9, 10.,
38
        11, 12.,
39
        13, 14.,
40
        15, 16.,
41
        17, 18. );
42
  exit(0);
43
  return 0;
44
}

powered by: WebSVN 2.1.0

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