OSDN Git Service

cp/:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / warn / huge-val1.C
1 // PR c++/23139: HUGE_VAL definition should be accepted with -pedantic.
2 // Origin: Joseph Myers <joseph@codesourcery.com>
3 // { dg-do link }
4 // { dg-options "-pedantic-errors" }
5
6 #include <math.h>
7
8 double d = HUGE_VAL;
9 #ifdef HUGE_VALF
10 float f = HUGE_VALF;
11 #endif
12 #ifdef HUGE_VALL
13 long double l = HUGE_VALL;
14 #endif
15
16 extern void link_failure ();
17
18 int
19 main ()
20 {
21 #ifdef __GLIBC__
22   if (HUGE_VAL != __builtin_huge_val ())
23     link_failure ();
24 #ifdef HUGE_VALF
25   if (HUGE_VALF != __builtin_huge_valf ())
26     link_failure ();
27 #endif
28 #ifdef HUGE_VALL
29   if (HUGE_VALL != __builtin_huge_vall ())
30     link_failure ();
31 #endif
32 #endif
33 }