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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [lto/] [20090706-1_0.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
#include <stdarg.h>
2
 
3
extern void abort (void);
4
 
5
void foo (int size, ...)
6
{
7
  struct
8
    {
9
      struct
10
        {
11
          char x[size];
12
        } e;
13
      unsigned r;
14
    } d;
15
  va_list ap;
16
  char c;
17
  int i;
18
 
19
  va_start (ap, size);
20
  d = va_arg (ap, typeof (d));
21
  c = d.e.x[3];
22
  if (c != '3')
23
    abort ();
24
  if (d.r != 2602)
25
    abort ();
26
  va_end (ap);
27
}
28
 
29
int main (void)
30
{
31
  int z = 5, i;
32
  struct { struct { char a[z]; } y; unsigned r; } x;
33
 
34
  x.y.a[0] = '0';
35
  x.y.a[1] = '1';
36
  x.y.a[2] = '2';
37
  x.y.a[3] = '3';
38
  x.y.a[4] = '4';
39
  x.r = 2602;
40
  foo (z, x);
41
  return 0;
42
}

powered by: WebSVN 2.1.0

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