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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [strct-varg-1.c] - Blame information for rev 301

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

Line No. Rev Author Line
1 297 jeremybenn
#include <stdarg.h>
2
 
3
struct s { int x, y; };
4
 
5
f (int attr, ...)
6
{
7
  struct s va_values;
8
  va_list va;
9
  int i;
10
 
11
  va_start (va, attr);
12
 
13
  if (attr != 2)
14
    abort ();
15
 
16
  va_values = va_arg (va, struct s);
17
  if (va_values.x != 0xaaaa || va_values.y != 0x5555)
18
    abort ();
19
 
20
  attr = va_arg (va, int);
21
  if (attr != 3)
22
    abort ();
23
 
24
  va_values = va_arg (va, struct s);
25
  if (va_values.x != 0xffff || va_values.y != 0x1111)
26
    abort ();
27
 
28
  va_end (va);
29
}
30
 
31
main ()
32
{
33
  struct s a, b;
34
 
35
  a.x = 0xaaaa;
36
  a.y = 0x5555;
37
  b.x = 0xffff;
38
  b.y = 0x1111;
39
 
40
  f (2, a, 3, b);
41
  exit (0);
42
}

powered by: WebSVN 2.1.0

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