1 /* { dg-options "-O2 -mcmodel=small -fPIC" } */
2 /* { dg-do compile } */
3
4 extern int __finite (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
5 extern int __finitef (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
6 extern int __signbit (double __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
7 extern int __signbitf (float __value) __attribute__ ((__nothrow__)) __attribute__ ((__const__));
8 int
__ecvt_r(value,ndigit,decpt,sign,buf,len)9 __ecvt_r (value, ndigit, decpt, sign, buf, len)
10 double value;
11 int ndigit, *decpt, *sign, len;
12 char *buf;
13 {
14 if ((sizeof (value) == sizeof (float) ? __finitef (value) : __finite (value)) && value != 0.0)
15 {
16 double d;
17 double f = 1.0;
18 d = -value;
19 if (d < 1.0e-307)
20 {
21 do
22 {
23 f *= 10.0;
24 }
25 while (d * f < 1.0);
26 }
27 }
28 if (ndigit <= 0 && len > 0)
29 {
30 buf[0] = '\0';
31 *sign = (sizeof (value) == sizeof (float) ? __finitef (value) : __finite (value)) ? (sizeof (value) == sizeof (float) ? __signbitf (value) : __signbit (value)) != 0 : 0;
32 }
33 }
34