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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [dfp/] [func-scalar.c] - Blame information for rev 856

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

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-options "-std=gnu99" } */
2
 
3
/* C99 6.5.2.2 Function calls.
4
   Test scalar passing and return values involving decimal floating
5
   point types.  */
6
 
7
extern void abort (void);
8
 
9
/* A handful of functions that return their Nth _Decimal32
10
   argument.  */
11
 
12
_Decimal32
13
arg0_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
14
         _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
15
{
16
  return arg0;
17
}
18
 
19
_Decimal32
20
arg1_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
21
         _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
22
{
23
  return arg1;
24
}
25
 
26
_Decimal32
27
arg2_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
28
         _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
29
{
30
  return arg2;
31
}
32
 
33
_Decimal32
34
arg3_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
35
         _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
36
{
37
  return arg3;
38
}
39
 
40
_Decimal32
41
arg4_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
42
         _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
43
{
44
  return arg4;
45
}
46
 
47
_Decimal32
48
arg5_32 (_Decimal32 arg0, _Decimal32 arg1, _Decimal32 arg2,
49
         _Decimal32 arg3, _Decimal32 arg4, _Decimal32 arg5)
50
{
51
  return arg5;
52
}
53
 
54
 
55
/* A handful of functions that return their Nth _Decimal64
56
   argument.  */
57
 
58
_Decimal64
59
arg0_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
60
         _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
61
{
62
  return arg0;
63
}
64
 
65
_Decimal64
66
arg1_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
67
         _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
68
{
69
  return arg1;
70
}
71
 
72
_Decimal64
73
arg2_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
74
         _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
75
{
76
  return arg2;
77
}
78
 
79
_Decimal64
80
arg3_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
81
         _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
82
{
83
  return arg3;
84
}
85
 
86
_Decimal64
87
arg4_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
88
         _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
89
{
90
  return arg4;
91
}
92
 
93
_Decimal64
94
arg5_64 (_Decimal64 arg0, _Decimal64 arg1, _Decimal64 arg2,
95
         _Decimal64 arg3, _Decimal64 arg4, _Decimal64 arg5)
96
{
97
  return arg5;
98
}
99
 
100
 
101
/* A handful of functions that return their Nth _Decimal128
102
   argument.  */
103
 
104
_Decimal128
105
arg0_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
106
         _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
107
{
108
  return arg0;
109
}
110
 
111
_Decimal128
112
arg1_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
113
         _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
114
{
115
  return arg1;
116
}
117
 
118
_Decimal128
119
arg2_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
120
         _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
121
{
122
  return arg2;
123
}
124
 
125
_Decimal128
126
arg3_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
127
         _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
128
{
129
  return arg3;
130
}
131
 
132
_Decimal128
133
arg4_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
134
         _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
135
{
136
  return arg4;
137
}
138
 
139
_Decimal128
140
arg5_128 (_Decimal128 arg0, _Decimal128 arg1, _Decimal128 arg2,
141
         _Decimal128 arg3, _Decimal128 arg4, _Decimal128 arg5)
142
{
143
  return arg5;
144
}
145
 
146
 
147
 
148
int
149
main ()
150
{
151
  /* _Decimal32 variants.  */
152
  if (arg0_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 0.0df)
153
    abort ();
154
  if (arg1_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 1.0df)
155
    abort ();
156
  if (arg2_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 2.0df)
157
    abort ();
158
  if (arg3_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 3.0df)
159
    abort ();
160
  if (arg4_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 4.0df)
161
    abort ();
162
  if (arg5_32 (0.0df, 1.0df, 2.0df, 3.0df, 4.0df, 5.0df) != 5.0df)
163
    abort ();
164
 
165
  /* _Decimal64 variants.  */
166
  if (arg0_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 0.0dd)
167
    abort ();
168
  if (arg1_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 1.0dd)
169
    abort ();
170
  if (arg2_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 2.0dd)
171
    abort ();
172
  if (arg3_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 3.0dd)
173
    abort ();
174
  if (arg4_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 4.0dd)
175
    abort ();
176
  if (arg5_64 (0.0dd, 1.0dd, 2.0dd, 3.0dd, 4.0dd, 5.0dd) != 5.0dd)
177
    abort ();
178
 
179
  /* _Decimal128 variants.  */
180
  if (arg0_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 0.0dl)
181
    abort ();
182
  if (arg1_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 1.0dl)
183
    abort ();
184
  if (arg2_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 2.0dl)
185
    abort ();
186
  if (arg3_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 3.0dl)
187
    abort ();
188
  if (arg4_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 4.0dl)
189
    abort ();
190
  if (arg5_128 (0.0dl, 1.0dl, 2.0dl, 3.0dl, 4.0dl, 5.0dl) != 5.0dl)
191
    abort ();
192
 
193
  return 0;
194
}

powered by: WebSVN 2.1.0

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