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

Subversion Repositories openrisc

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

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

Line No. Rev Author Line
1 688 jeremybenn
#include <stdarg.h>
2
 
3
typedef struct{double x,y;}point;
4
point pts[]={{1.0,2.0},{3.0,4.0},{5.0,6.0},{7.0,8.0}};
5
static int va1(int nargs,...)
6
{
7
  va_list args;
8
  int i;
9
  point pi;
10
  va_start(args,nargs);
11
  for(i=0;i<nargs;i++){
12
    pi=va_arg(args,point);
13
    if(pts[i].x!=pi.x||pts[i].y!=pi.y)abort();
14
  }
15
  va_end(args);
16
}
17
 
18
typedef struct{int x,y;}ipoint;
19
ipoint ipts[]={{1,2},{3,4},{5,6},{7,8}};
20
static int va2(int nargs,...)
21
{
22
  va_list args;
23
  int i;
24
  ipoint pi;
25
  va_start(args,nargs);
26
  for(i=0;i<nargs;i++){
27
    pi=va_arg(args,ipoint);
28
    if(ipts[i].x!=pi.x||ipts[i].y!=pi.y)abort();
29
  }
30
  va_end(args);
31
}
32
 
33
main()
34
{
35
va1(4,pts[0],pts[1],pts[2],pts[3]);
36
va2(4,ipts[0],ipts[1],ipts[2],ipts[3]);
37
exit(0);
38
}

powered by: WebSVN 2.1.0

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