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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [struct-by-value-21_y.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
#include <stdarg.h>
2
 
3
#include "compat-common.h"
4
 
5
#ifdef SKIP_VA
6
const int test_va = 0;
7
#else
8
const int test_va = 1;
9
#endif
10
 
11
#include "mixed-struct-defs.h"
12
#include "mixed-struct-init.h"
13
 
14
#define T(TYPE)                                                 \
15
extern void check##TYPE (TYPE x, int i);                        \
16
extern TYPE g1s##TYPE, g2s##TYPE, g3s##TYPE, g4s##TYPE;         \
17
extern TYPE g5s##TYPE, g6s##TYPE, g7s##TYPE, g8s##TYPE;         \
18
extern TYPE g9s##TYPE, g10s##TYPE, g11s##TYPE, g12s##TYPE;      \
19
extern TYPE g13s##TYPE, g14s##TYPE, g15s##TYPE, g16s##TYPE;     \
20
                                                                \
21
void                                                            \
22
checkg##TYPE (void)                                             \
23
{                                                               \
24
  check##TYPE (  g1s##TYPE,  1);                                \
25
  check##TYPE (  g2s##TYPE,  2);                                \
26
  check##TYPE (  g3s##TYPE,  3);                                \
27
  check##TYPE (  g4s##TYPE,  4);                                \
28
  check##TYPE (  g5s##TYPE,  5);                                \
29
  check##TYPE (  g6s##TYPE,  6);                                \
30
  check##TYPE (  g7s##TYPE,  7);                                \
31
  check##TYPE (  g8s##TYPE,  8);                                \
32
  check##TYPE (  g9s##TYPE,  9);                                \
33
  check##TYPE ( g10s##TYPE, 10);                                \
34
  check##TYPE ( g11s##TYPE, 11);                                \
35
  check##TYPE ( g12s##TYPE, 12);                                \
36
  check##TYPE ( g13s##TYPE, 13);                                \
37
  check##TYPE ( g14s##TYPE, 14);                                \
38
  check##TYPE ( g15s##TYPE, 15);                                \
39
  check##TYPE ( g16s##TYPE, 16);                                \
40
}                                                               \
41
                                                                \
42
void                                                            \
43
test##TYPE (TYPE s1, TYPE s2, TYPE s3, TYPE s4,                 \
44
            TYPE s5, TYPE s6, TYPE s7, TYPE s8,                 \
45
            TYPE s9, TYPE s10, TYPE s11, TYPE s12,              \
46
            TYPE s13, TYPE s14, TYPE s15, TYPE s16)             \
47
{                                                               \
48
  check##TYPE (s1, 1);                                          \
49
  check##TYPE (s2, 2);                                          \
50
  check##TYPE (s3, 3);                                          \
51
  check##TYPE (s4, 4);                                          \
52
  check##TYPE (s5, 5);                                          \
53
  check##TYPE (s6, 6);                                          \
54
  check##TYPE (s7, 7);                                          \
55
  check##TYPE (s8, 8);                                          \
56
  check##TYPE (s9, 9);                                          \
57
  check##TYPE (s10, 10);                                        \
58
  check##TYPE (s11, 11);                                        \
59
  check##TYPE (s12, 12);                                        \
60
  check##TYPE (s13, 13);                                        \
61
  check##TYPE (s14, 14);                                        \
62
  check##TYPE (s15, 15);                                        \
63
  check##TYPE (s16, 16);                                        \
64
}                                                               \
65
                                                                \
66
void                                                            \
67
testva##TYPE (int n, ...)                                       \
68
{                                                               \
69
  int i;                                                        \
70
  va_list ap;                                                   \
71
  if (test_va)                                                  \
72
    {                                                           \
73
      va_start (ap, n);                                         \
74
      for (i = 0; i < n; i++)                                    \
75
        {                                                       \
76
          TYPE t = va_arg (ap, TYPE);                           \
77
          check##TYPE (t, i+1);                                 \
78
        }                                                       \
79
      va_end (ap);                                              \
80
    }                                                           \
81
}
82
 
83
T(Sfi)
84
T(Sfii)
85
T(Sfifi)
86
T(Sfiifii)

powered by: WebSVN 2.1.0

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