OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gcc.dg/] [compat/] [struct-return-2_y.c] - Blame information for rev 384

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
#include <stdarg.h>
2
 
3
#include "compat-common.h"
4
 
5
#define T(N, NAME, TYPE)                                        \
6
struct S##NAME##N { TYPE i[N]; };                               \
7
                                                                \
8
extern struct S##NAME##N g1s##NAME##N, g2s##NAME##N;            \
9
extern struct S##NAME##N g3s##NAME##N, g4s##NAME##N;            \
10
extern struct S##NAME##N g5s##NAME##N, g6s##NAME##N;            \
11
extern struct S##NAME##N g7s##NAME##N, g8s##NAME##N;            \
12
extern struct S##NAME##N g9s##NAME##N, g10s##NAME##N;           \
13
extern struct S##NAME##N g11s##NAME##N, g12s##NAME##N;          \
14
extern struct S##NAME##N g13s##NAME##N, g14s##NAME##N;          \
15
extern struct S##NAME##N g15s##NAME##N, g16s##NAME##N;          \
16
                                                                \
17
extern void check##NAME##N (struct S##NAME##N *p, int i);       \
18
                                                                \
19
void                                                            \
20
init##NAME##N (struct S##NAME##N *p, int i)                     \
21
{                                                               \
22
  int j;                                                        \
23
  for (j = 0; j < N; j++)                                        \
24
    p->i[j] = i + j;                                            \
25
}                                                               \
26
                                                                \
27
void                                                            \
28
checkg##NAME##N (void)                                          \
29
{                                                               \
30
  check##NAME##N ( &g1s##NAME##N,  1*16);                       \
31
  check##NAME##N ( &g2s##NAME##N,  2*16);                       \
32
  check##NAME##N ( &g3s##NAME##N,  3*16);                       \
33
  check##NAME##N ( &g4s##NAME##N,  4*16);                       \
34
  check##NAME##N ( &g5s##NAME##N,  5*16);                       \
35
  check##NAME##N ( &g6s##NAME##N,  6*16);                       \
36
  check##NAME##N ( &g7s##NAME##N,  7*16);                       \
37
  check##NAME##N ( &g8s##NAME##N,  8*16);                       \
38
  check##NAME##N ( &g9s##NAME##N,  9*16);                       \
39
  check##NAME##N (&g10s##NAME##N, 10*16);                       \
40
  check##NAME##N (&g11s##NAME##N, 11*16);                       \
41
  check##NAME##N (&g12s##NAME##N, 12*16);                       \
42
  check##NAME##N (&g13s##NAME##N, 13*16);                       \
43
  check##NAME##N (&g14s##NAME##N, 14*16);                       \
44
  check##NAME##N (&g15s##NAME##N, 15*16);                       \
45
  check##NAME##N (&g16s##NAME##N, 16*16);                       \
46
}                                                               \
47
                                                                \
48
struct S##NAME##N                                               \
49
test0##NAME##N (void)                                           \
50
{                                                               \
51
  return g1s##NAME##N;                                          \
52
}                                                               \
53
                                                                \
54
struct S##NAME##N                                               \
55
test1##NAME##N (struct S##NAME##N x01)                          \
56
{                                                               \
57
  return x01;                                                   \
58
}                                                               \
59
                                                                \
60
struct S##NAME##N                                               \
61
testva##NAME##N (int n, ...)                                    \
62
{                                                               \
63
  int i;                                                        \
64
  struct S##NAME##N rslt;                                       \
65
  va_list ap;                                                   \
66
  va_start (ap, n);                                             \
67
  for (i = 0; i < n; i++)                                        \
68
    rslt = va_arg (ap, struct S##NAME##N);                      \
69
  va_end (ap);                                                  \
70
  return rslt;                                                  \
71
}
72
 
73
#ifndef SKIP_ZERO_ARRAY
74
T(0, uc, unsigned char)
75
#endif
76
T(1, uc, unsigned char)
77
T(2, uc, unsigned char)
78
T(3, uc, unsigned char)
79
T(4, uc, unsigned char)
80
T(5, uc, unsigned char)
81
T(6, uc, unsigned char)
82
T(7, uc, unsigned char)
83
T(8, uc, unsigned char)
84
T(9, uc, unsigned char)
85
T(10, uc, unsigned char)
86
T(11, uc, unsigned char)
87
T(12, uc, unsigned char)
88
T(13, uc, unsigned char)
89
T(14, uc, unsigned char)
90
T(15, uc, unsigned char)
91
#ifndef SKIP_ZERO_ARRAY
92
T(0, us, unsigned short)
93
#endif
94
T(1, us, unsigned short)
95
T(2, us, unsigned short)
96
T(3, us, unsigned short)
97
T(4, us, unsigned short)
98
T(5, us, unsigned short)
99
T(6, us, unsigned short)
100
T(7, us, unsigned short)
101
T(8, us, unsigned short)
102
T(9, us, unsigned short)
103
T(10, us, unsigned short)
104
T(11, us, unsigned short)
105
T(12, us, unsigned short)
106
T(13, us, unsigned short)
107
T(14, us, unsigned short)
108
T(15, us, unsigned short)
109
#ifndef SKIP_ZERO_ARRAY
110
T(0, ui, unsigned int)
111
#endif
112
T(1, ui, unsigned int)
113
T(2, ui, unsigned int)
114
T(3, ui, unsigned int)
115
T(4, ui, unsigned int)
116
T(5, ui, unsigned int)
117
T(6, ui, unsigned int)
118
T(7, ui, unsigned int)
119
T(8, ui, unsigned int)
120
T(9, ui, unsigned int)
121
T(10, ui, unsigned int)
122
T(11, ui, unsigned int)
123
T(12, ui, unsigned int)
124
T(13, ui, unsigned int)
125
T(14, ui, unsigned int)
126
T(15, ui, unsigned int)

powered by: WebSVN 2.1.0

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