2017-12-05 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / c-c++-common / dfp / func-mixed.c
blob6f7e2eb4157a48990115af65dd575d3d3aa101fe
1 /* { dg-options "-Wall" } */
3 /* C99 6.5.2.2 Function calls.
4 Test scalar passing and return values involving decimal floating
5 point types. */
7 #include "dfp-dbg.h"
9 /* A handful of functions that return their Nth _Decimal32
10 argument with mixed types in parameter list. */
12 _Decimal32
13 arg0_32 (_Decimal32 arg0, int arg1, unsigned int arg2,
14 float arg3, double arg4, long double arg5)
16 return arg0;
19 _Decimal32
20 arg1_32 (int arg0, _Decimal32 arg1, unsigned int arg2,
21 float arg3, double arg4, long double arg5)
23 return arg1;
26 _Decimal32
27 arg2_32 (int arg0, unsigned int arg1, _Decimal32 arg2,
28 float arg3, double arg4, long double arg5)
30 return arg2;
34 _Decimal32
35 arg3_32 (int arg0, unsigned int arg1, float arg2,
36 _Decimal32 arg3, double arg4, long double arg5)
38 return arg3;
41 _Decimal32
42 arg4_32 (int arg0, unsigned int arg1, float arg2,
43 double arg3, _Decimal32 arg4, long double arg5)
45 return arg4;
48 _Decimal32
49 arg5_32 (int arg0, unsigned int arg1, float arg2,
50 double arg3, long double arg4, _Decimal32 arg5)
52 return arg5;
55 /* A handful of functions that return their Nth _Decimal64
56 argument with mixed types in parameter list. */
58 _Decimal64
59 arg0_64 (_Decimal64 arg0, int arg1, unsigned int arg2,
60 float arg3, double arg4, long double arg5)
62 return arg0;
65 _Decimal64
66 arg1_64 (int arg0, _Decimal64 arg1, unsigned int arg2,
67 float arg3, double arg4, long double arg5)
69 return arg1;
72 _Decimal64
73 arg2_64 (int arg0, unsigned int arg1, _Decimal64 arg2,
74 float arg3, double arg4, long double arg5)
76 return arg2;
79 _Decimal64
80 arg3_64 (int arg0, unsigned int arg1, float arg2,
81 _Decimal64 arg3, double arg4, long double arg5)
83 return arg3;
86 _Decimal64
87 arg4_64 (int arg0, unsigned int arg1, float arg2,
88 float arg3, _Decimal64 arg4, long double arg5)
90 return arg4;
93 _Decimal64
94 arg5_64 (int arg0, unsigned int arg1, float arg2,
95 double arg3, long double arg4, _Decimal64 arg5)
97 return arg5;
100 /* A handful of functions that return their Nth _Decimal128
101 argument with mixed types in parameter list. */
103 _Decimal128
104 arg0_128 (_Decimal128 arg0, int arg1, unsigned int arg2,
105 float arg3, double arg4, long double arg5)
107 return arg0;
109 _Decimal128
110 arg1_128 (int arg0, _Decimal128 arg1, unsigned int arg2,
111 float arg3, double arg4, long double arg5)
113 return arg1;
116 _Decimal128
117 arg2_128 (int arg0, unsigned int arg1, _Decimal128 arg2,
118 float arg3, double arg4, long double arg5)
120 return arg2;
123 _Decimal128
124 arg3_128 (int arg0, unsigned int arg1, float arg2,
125 _Decimal128 arg3, double arg4, long double arg5)
127 return arg3;
130 _Decimal128
131 arg4_128 (int arg0, unsigned int arg1, float arg2,
132 float arg3, _Decimal32 arg4, long double arg5)
134 return arg4;
137 _Decimal128
138 arg5_128 (int arg0, unsigned int arg1, float arg2,
139 double arg3, long double arg4, _Decimal128 arg5)
141 return arg5;
147 main ()
149 /* _Decimal32 variants. */
150 if (arg0_32 (0.0df, -1, 2, 3.0f, 4.0, 5.0l) != 0.0df) FAILURE
151 if (arg1_32 (0, 1.0df, 2, 3.0f, 4.0, 5.0l) != 1.0df) FAILURE
152 if (arg2_32 (0, -1, 2.0df, 3.0f, 4.0, 5.0l) != 2.0df) FAILURE
153 if (arg3_32 (0, -1, 2.0f, 3.0df, 4.0, 5.0l) != 3.0df) FAILURE
154 if (arg4_32 (0, -1, 2.0f, 3.0, 4.0df, 5.0l) != 4.0df) FAILURE
155 if (arg5_32 (0, -1, 2.0f, 3.0, 4.0l, 5.0df) != 5.0df) FAILURE
157 /* _Decimal64 variants. */
158 if (arg0_64 (0.0dd, -1, 2, 3.0f, 4.0, 5.0l) != 0.0dd) FAILURE
159 if (arg1_64 (0, 1.0dd, 2, 3.0f, 4.0, 5.0l) != 1.0dd) FAILURE
160 if (arg2_64 (0, -1, 2.0dd, 3.0f, 4.0, 5.0l) != 2.0dd) FAILURE
161 if (arg3_64 (0, -1, 2.0f, 3.0dd, 4.0, 5.0l) != 3.0dd) FAILURE
162 if (arg4_64 (0, -1, 2.0f, 3.0, 4.0dd, 5.0l) != 4.0dd) FAILURE
163 if (arg5_64 (0, -1, 2.0f, 3.0, 4.0l, 5.0dd) != 5.0dd) FAILURE
165 /* _Decimal128 variants. */
166 if (arg0_128 (0.0dl, -1, 2, 3.0f, 4.0, 5.0l) != 0.0dl) FAILURE
167 if (arg1_128 (0, 1.0dl, 2, 3.0f, 4.0, 5.0l) != 1.0dl) FAILURE
168 if (arg2_128 (0, -1, 2.0dl, 3.0f, 4.0, 5.0l) != 2.0dl) FAILURE
169 if (arg3_128 (0, -1, 2.0f, 3.0dl, 4.0, 5.0l) != 3.0dl) FAILURE
170 if (arg4_128 (0, -1, 2.0f, 3.0, 4.0dl, 5.0l) != 4.0dl) FAILURE
171 if (arg5_128 (0, -1, 2.0f, 3.0, 4.0l, 5.0dl) != 5.0dl) FAILURE
173 FINISH