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-mixed.c] - Blame information for rev 867

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

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

powered by: WebSVN 2.1.0

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