1 |
688 |
jeremybenn |
/* { dg-options "-O -fno-tree-ccp -fno-tree-copy-prop" } */
|
2 |
|
|
#define CSF __builtin_copysignf
|
3 |
|
|
#define CSD __builtin_copysign
|
4 |
|
|
#define CSL __builtin_copysignl
|
5 |
|
|
#define MODFF __builtin_modff
|
6 |
|
|
#define MODFD __builtin_modf
|
7 |
|
|
#define MODFL __builtin_modfl
|
8 |
|
|
|
9 |
|
|
extern void link_error (void);
|
10 |
|
|
|
11 |
|
|
void
|
12 |
|
|
foo (void)
|
13 |
|
|
{
|
14 |
|
|
float iptrf;
|
15 |
|
|
double iptr;
|
16 |
|
|
long double iptrl;
|
17 |
|
|
long long iptrll;
|
18 |
|
|
if ((CSF (1.0F, MODFF (0x1p10F + 0.5f, &iptrf)) != CSF (1.0F, 0.5f))
|
19 |
|
|
|| (CSF (1.0F, iptrf) != 0x1p10f))
|
20 |
|
|
link_error ();
|
21 |
|
|
if (MODFD (0x1p10F + 0.5, &iptr) != 0.5
|
22 |
|
|
|| (CSD (1.0, MODFD (0x1p10F + 0.5, &iptr)) != CSD (1.0, 0.5))
|
23 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, 0x1p10)))
|
24 |
|
|
link_error ();
|
25 |
|
|
if (MODFL (0x1p10F + 0.5l, &iptrl) != 0.5l
|
26 |
|
|
|| (CSL (1.0L, MODFL (0x1p10F + 0.5l, &iptrl)) != CSL (1.0L, 0.5l))
|
27 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 0x1p10l)))
|
28 |
|
|
link_error ();
|
29 |
|
|
if ((CSF (1.0F, (MODFF (0x1p10F + 0x1p-10f, &iptrf)))
|
30 |
|
|
!= CSF (1.0F, 0x1p-10f))
|
31 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, 0x1p10f)))
|
32 |
|
|
link_error ();
|
33 |
|
|
if (MODFD (0x1p10F + 0x1p-10, &iptr) != 0x1p-10
|
34 |
|
|
|| (CSD (1.0, (MODFD (0x1p10F + 0x1p-10, &iptr)))
|
35 |
|
|
!= CSD (1.0, 0x1p-10)) || (CSD (1.0, iptr) != CSD (1.0, 0x1p10)))
|
36 |
|
|
link_error ();
|
37 |
|
|
if (MODFL (0x1p10F + 0x1p-10l, &iptrl) != 0x1p-10l
|
38 |
|
|
|| (CSL (1.0L, (MODFL (0x1p10F + 0x1p-10l, &iptrl)))
|
39 |
|
|
!= CSL (1.0L, 0x1p-10l))
|
40 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 0x1p10l)))
|
41 |
|
|
link_error ();
|
42 |
|
|
if ((CSF (1.0F, (MODFF (12345678L / 17.0f, &iptrf)))
|
43 |
|
|
!= CSF (1.0F, (-726216L + 12345678L / 17.0f)))
|
44 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, 726216.0f)))
|
45 |
|
|
link_error ();
|
46 |
|
|
if (MODFD (12345678L / 17.0, &iptr) != -726216L + 12345678L / 17.0
|
47 |
|
|
|| (CSD (1.0, (MODFD (12345678L / 17.0, &iptr)))
|
48 |
|
|
!= CSD (1.0, (-726216L + 12345678L / 17.0)))
|
49 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, 726216.0)))
|
50 |
|
|
link_error ();
|
51 |
|
|
if ((CSL (1.0L, (MODFL (12345678L / 17.0l, &iptrl)))
|
52 |
|
|
!= CSL (1.0L, (-726216L + 12345678L / 17.0l)))
|
53 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 726216.0l)))
|
54 |
|
|
link_error ();
|
55 |
|
|
if (MODFF (555.555f, &iptrf) != -555 + 555.555f
|
56 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, 555.0f)))
|
57 |
|
|
link_error ();
|
58 |
|
|
if (MODFD (555.555, &iptr) != -555 + 555.555
|
59 |
|
|
|| (CSD (1.0, (MODFD (555.555, &iptr))) != CSD (1.0, (-555 + 555.555)))
|
60 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, 555.0)))
|
61 |
|
|
link_error ();
|
62 |
|
|
if (MODFL (555.555l, &iptrl) != -555 + 555.555l
|
63 |
|
|
|| (CSL (1.0L, (MODFL (555.555l, &iptrl)))
|
64 |
|
|
!= CSL (1.0L, (-555 + 555.555l)))
|
65 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 555.0l)))
|
66 |
|
|
link_error ();
|
67 |
|
|
if (MODFF (5000 / 11.0f, &iptrf) != -454 + 5000 / 11.0f
|
68 |
|
|
|| (CSF (1.0F, (MODFF (5000 / 11.0f, &iptrf)))
|
69 |
|
|
!= CSF (1.0F, (-454 + 5000 / 11.0f)))
|
70 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, 454.0f)))
|
71 |
|
|
link_error ();
|
72 |
|
|
if (MODFD (5000 / 11.0, &iptr) != -454 + 5000 / 11.0
|
73 |
|
|
|| (CSD (1.0, (MODFD (5000 / 11.0, &iptr)))
|
74 |
|
|
!= CSD (1.0, (-454 + 5000 / 11.0)))
|
75 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, 454.0)))
|
76 |
|
|
link_error ();
|
77 |
|
|
if ((CSL (1.0L, (MODFL (5000 / 11.0l, &iptrl)))
|
78 |
|
|
!= CSL (1.0L, (-454 + 5000 / 11.0l)))
|
79 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 454.0l)))
|
80 |
|
|
link_error ();
|
81 |
|
|
if ((CSF (1.0F, (MODFF (1000 / 7.0f, &iptrf)))
|
82 |
|
|
!= CSF (1.0F, (-142 + 1000 / 7.0f)))
|
83 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, 142.0f)))
|
84 |
|
|
link_error ();
|
85 |
|
|
if ((CSD (1.0, (MODFD (1000 / 7.0, &iptr)))
|
86 |
|
|
!= CSD (1.0, (-142 + 1000 / 7.0)))
|
87 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, 142.0)))
|
88 |
|
|
link_error ();
|
89 |
|
|
if ((CSL (1.0L, (MODFL (1000 / 7.0l, &iptrl)))
|
90 |
|
|
!= CSL (1.0L, (-142 + 1000 / 7.0l)))
|
91 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 142.0l)))
|
92 |
|
|
link_error ();
|
93 |
|
|
if (MODFF (123 / 7.0f, &iptrf) != -17 + 123 / 7.0f
|
94 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, 17.0f)))
|
95 |
|
|
link_error ();
|
96 |
|
|
if (MODFD (123 / 7.0, &iptr) != -17 + 123 / 7.0
|
97 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, 17.0)))
|
98 |
|
|
link_error ();
|
99 |
|
|
if ((CSL (1.0L, (MODFL (123 / 7.0l, &iptrl)))
|
100 |
|
|
!= CSL (1.0L, (-17 + 123 / 7.0l)))
|
101 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 17.0l)))
|
102 |
|
|
link_error ();
|
103 |
|
|
if ((CSF (1.0F, (MODFF (117 / 7.0f, &iptrf)))
|
104 |
|
|
!= CSF (1.0F, (-16 + 117 / 7.0f)))
|
105 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, 16.0f)))
|
106 |
|
|
link_error ();
|
107 |
|
|
if ((CSD (1.0, (MODFD (117 / 7.0, &iptr))) != CSD (1.0, (-16 + 117 / 7.0)))
|
108 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, 16.0)))
|
109 |
|
|
link_error ();
|
110 |
|
|
if (MODFL (117 / 7.0l, &iptrl) != -16 + 117 / 7.0l
|
111 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 16.0l)))
|
112 |
|
|
link_error ();
|
113 |
|
|
if (MODFF (5.5f, &iptrf) != 0.5f || (CSF (1.0F, iptrf) != CSF (1.0F, 5.0f)))
|
114 |
|
|
link_error ();
|
115 |
|
|
if (MODFD (5.5, &iptr) != 0.5 || (CSD (1.0, iptr) != CSD (1.0, 5.0)))
|
116 |
|
|
link_error ();
|
117 |
|
|
if (MODFL (5.5l, &iptrl) != 0.5l || (CSL (1.0L, iptrl) != CSL (1.0L, 5.0l)))
|
118 |
|
|
link_error ();
|
119 |
|
|
if ((CSF (1.0F, (MODFF (1.5f, &iptrf))) != CSF (1.0F, 0.5f))
|
120 |
|
|
|| (CSF (1.0F, iptrf) != 1.0f))
|
121 |
|
|
link_error ();
|
122 |
|
|
if ((CSD (1.0, (MODFD (1.5, &iptr))) != CSD (1.0, 0.5))
|
123 |
|
|
|| (CSD (1.0, iptr) != 1.0))
|
124 |
|
|
link_error ();
|
125 |
|
|
if (MODFL (1.5l, &iptrl) != iptrl != 1.0l || (CSL (1.0L, iptrl) != 1.0l))
|
126 |
|
|
link_error ();
|
127 |
|
|
if (MODFF (4 / 3.0f, &iptrf) != -1 + 4 / 3.0f
|
128 |
|
|
|| (CSF (1.0F, (MODFF (4 / 3.0f, &iptrf)))
|
129 |
|
|
!= CSF (1.0F, (-1 + 4 / 3.0f))) || (CSF (1.0F, iptrf) != (1.0F)))
|
130 |
|
|
link_error ();
|
131 |
|
|
if (MODFD (4 / 3.0, &iptr) != -1 + 4 / 3.0 || (CSD (1.0, iptr) != 1.0))
|
132 |
|
|
link_error ();
|
133 |
|
|
if (MODFL (4 / 3.0l, &iptrl) != iptrl != 1.0l
|
134 |
|
|
|| (CSL (1.0L, iptrl) != 1.0l))
|
135 |
|
|
link_error ();
|
136 |
|
|
if ((((MODFF (1.0f, &iptrf)))) || (CSF (1.0F, iptrf) != 1.0f))
|
137 |
|
|
link_error ();
|
138 |
|
|
if ((((MODFD (1.0, &iptr))) != 0.0) || (CSD (1.0, iptr) != 1.0))
|
139 |
|
|
link_error ();
|
140 |
|
|
if ((((MODFL (1.0l, &iptrl))) != 0.0l) || (CSL (1.0L, iptrl) != 1.0l))
|
141 |
|
|
link_error ();
|
142 |
|
|
if (MODFF (0.5f, &iptrf) != 0.5f || (CSF (1.0F, iptrf) != CSF (1.0F, 0.0f)))
|
143 |
|
|
link_error ();
|
144 |
|
|
if (MODFD (0.5, &iptr) != 0.5 || (CSD (1.0, iptr) != CSD (1.0, 0.0)))
|
145 |
|
|
link_error ();
|
146 |
|
|
if ((CSL (1.0L, (MODFL (0.5l, &iptrl))) != CSL (1.0L, 0.5l))
|
147 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 0.0l)))
|
148 |
|
|
link_error ();
|
149 |
|
|
if (MODFF (4 / 9.0f, &iptrf) != 4 / 9.0f
|
150 |
|
|
!= (CSF (1.0F, (MODFF (4 / 9.0f, &iptrf))) != CSF (1.0F, (4 / 9.0f)))
|
151 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, 0.0f)))
|
152 |
|
|
link_error ();
|
153 |
|
|
if (MODFD (4 / 9.0, &iptr) != 4 / 9.0
|
154 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, 0.0)))
|
155 |
|
|
link_error ();
|
156 |
|
|
if (MODFL (4 / 9.0l, &iptrl) != 4 / 9.0l
|
157 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 0.0l)))
|
158 |
|
|
link_error ();
|
159 |
|
|
if (MODFF (1 / 3.0f, &iptrf) != 1 / 3.0f
|
160 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, 0.0f)))
|
161 |
|
|
link_error ();
|
162 |
|
|
if (MODFD (1 / 3.0, &iptr) != 1 / 3.0
|
163 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, 0.0)))
|
164 |
|
|
link_error ();
|
165 |
|
|
if ((CSL (1.0L, (MODFL (1 / 3.0l, &iptrl))) != CSL (1.0L, (1 / 3.0l)))
|
166 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 0.0l)))
|
167 |
|
|
link_error ();
|
168 |
|
|
if ((CSF (1.0F, (MODFF (1 / 9.0f, &iptrf))) != CSF (1.0F, (1 / 9.0f)))
|
169 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, 0.0f)))
|
170 |
|
|
link_error ();
|
171 |
|
|
if (MODFD (1 / 9.0, &iptr) != 1 / 9.0
|
172 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, 0.0)))
|
173 |
|
|
link_error ();
|
174 |
|
|
if ((CSL (1.0L, (MODFL (1 / 9.0l, &iptrl))) != CSL (1.0L, (1 / 9.0l)))
|
175 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 0.0l)))
|
176 |
|
|
link_error ();
|
177 |
|
|
if ((((MODFF (0.0f, &iptrf)))) || (CSF (1.0F, iptrf) != CSF (1.0F, 0.0f)))
|
178 |
|
|
link_error ();
|
179 |
|
|
if ((((MODFD (0.0, &iptr)))) || (CSD (1.0, iptr) != CSD (1.0, 0.0)))
|
180 |
|
|
link_error ();
|
181 |
|
|
if ((((MODFL (0.0l, &iptrl))) != 0.0l)
|
182 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, 0.0l)))
|
183 |
|
|
link_error ();
|
184 |
|
|
if ((((MODFF (-0.0f, &iptrf)))) || (CSF (1.0F, iptrf) != CSF (1.0F, -0.0f)))
|
185 |
|
|
link_error ();
|
186 |
|
|
if ((((MODFD (-0.0, &iptr)))) || (CSD (1.0, iptr) != CSD (1.0, -0.0)))
|
187 |
|
|
link_error ();
|
188 |
|
|
if ((CSL (1.0L, (MODFL (-0.0l, &iptrl))) != CSL (1.0L, -0.0l))
|
189 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, -0.0l)))
|
190 |
|
|
link_error ();
|
191 |
|
|
if (MODFF (-1 / 9.0f, &iptrf) != -1 / 9.0f
|
192 |
|
|
|| (CSF (1.0F, (MODFF (-1 / 9.0f, &iptrf))) != CSF (1.0F, (-1 / 9.0f)))
|
193 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, -0.0f)))
|
194 |
|
|
link_error ();
|
195 |
|
|
if (MODFD (-1 / 9.0, &iptr) != -1 / 9.0
|
196 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, -0.0)))
|
197 |
|
|
link_error ();
|
198 |
|
|
if ((CSL (1.0L, (MODFL (-1 / 9.0l, &iptrl))) != CSL (1.0L, (-1 / 9.0l)))
|
199 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, -0.0l)))
|
200 |
|
|
link_error ();
|
201 |
|
|
if ((CSF (1.0F, (MODFF (-1 / 3.0f, &iptrf))) != CSF (1.0F, (-1 / 3.0f)))
|
202 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, -0.0f)))
|
203 |
|
|
link_error ();
|
204 |
|
|
if (MODFD (-1 / 3.0, &iptr) != -1 / 3.0
|
205 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, -0.0)))
|
206 |
|
|
link_error ();
|
207 |
|
|
if ((CSL (1.0L, (MODFL (-1 / 3.0l, &iptrl))) != CSL (1.0L, (-1 / 3.0l)))
|
208 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, -0.0l)))
|
209 |
|
|
link_error ();
|
210 |
|
|
if (MODFF (-4 / 9.0f, &iptrf) != -4 / 9.0f
|
211 |
|
|
|| (CSF (1.0F, (MODFF (-4 / 9.0f, &iptrf))) != CSF (1.0F, (-4 / 9.0f)))
|
212 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, -0.0f)))
|
213 |
|
|
link_error ();
|
214 |
|
|
if (MODFD (-4 / 9.0, &iptr) != -4 / 9.0
|
215 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, -0.0)))
|
216 |
|
|
link_error ();
|
217 |
|
|
if (MODFL (-4 / 9.0l, &iptrl) != -4 / 9.0l
|
218 |
|
|
|| (CSL (1.0L, (MODFL (-4 / 9.0l, &iptrl))) != CSL (1.0L, (-4 / 9.0l)))
|
219 |
|
|
|| (CSL (1.0L, iptrl) != CSL (1.0L, -0.0l)))
|
220 |
|
|
link_error ();
|
221 |
|
|
if (MODFF (-0.5f, &iptrf) != -0.5f
|
222 |
|
|
|| (CSF (1.0F, iptrf) != CSF (1.0F, -0.0f)))
|
223 |
|
|
link_error ();
|
224 |
|
|
if (MODFD (-0.5, &iptr) != -0.5
|
225 |
|
|
!= (CSD (1.0, (MODFD (-0.5, &iptr))) != CSD (1.0, -0.5))
|
226 |
|
|
|| (CSD (1.0, iptr) != CSD (1.0, -0.0)))
|
227 |
|
|
(MODFL (-0.5l, (long double *) &iptrll));
|
228 |
|
|
if ((((MODFF (-1.0f, &iptrf)))) || (CSF (1.0F, iptrf) != -1.0f))
|
229 |
|
|
link_error ();
|
230 |
|
|
if ((((MODFD (-1.0, &iptr))) != -0.0) || (CSD (1.0, iptr) != -1.0))
|
231 |
|
|
link_error ();
|
232 |
|
|
if ((((MODFL (-1.0l, &iptrl)))) || (CSL (1.0L, iptrl) != -1.0l))
|
233 |
|
|
link_error ();
|
234 |
|
|
if ((CSF (1.0F, (MODFF (-4 / 3.0f, &iptrf))) != CSF (1.0F, (1 - 4 / 3.0f)))
|
235 |
|
|
|| (CSF (1.0F, iptrf) != -1.0f))
|
236 |
|
|
link_error ();
|
237 |
|
|
if (MODFD (-4 / 3.0, &iptr) != 1 - 4 / 3.0 || (CSD (1.0, iptr) != -1.0))
|
238 |
|
|
link_error ();
|
239 |
|
|
if (MODFL (-4 / 3.0l, &iptrl) != 1 - 4 / 3.0l
|
240 |
|
|
|| (CSL (1.0L, (MODFL (-4 / 3.0l, &iptrl)))
|
241 |
|
|
!= CSL (1.0L, (1 - 4 / 3.0l))) || (CSL (1.0L, iptrl) != -1.0l))
|
242 |
|
|
link_error ();
|
243 |
|
|
if ((CSF (1.0F, (MODFF (-1.5f, &iptrf))) != CSF (1.0F, -0.5f))
|
244 |
|
|
|| (CSF (1.0F, iptrf) != -1.0f))
|
245 |
|
|
link_error ();
|
246 |
|
|
if ((CSD (1.0, (MODFD (-1.5, &iptr))) != CSD (1.0, -0.5))
|
247 |
|
|
|| (CSD (1.0, iptr) != -1.0))
|
248 |
|
|
link_error ();
|
249 |
|
|
}
|