OSDN Git Service

* gcc.dg/single-precision-constant.c: Tweak for non-C99 runtimes.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / single-precision-constant.c
1 /* Test that double precision constants are correctly handled 
2    when code is compiled with -fsingle-precision-constant */
3 /* Origin: Carlos O'Donell <carlos@codesourcery.com> */
4 /* { dg-do run } */
5 /* { dg-options "-fsingle-precision-constant" } */
6 #include <math.h>
7 #include <float.h>
8
9 #include "builtins-config.h"
10
11 int main (void)
12 {
13   int result = 0;
14   double local_DBL_MAX = DBL_MAX; 
15   double local_DBL_MIN = DBL_MIN;
16 #ifdef HAVE_C99_RUNTIME
17   if (isinf (local_DBL_MAX))
18     result |= 1;
19 #endif
20   if (local_DBL_MIN <= 0.0)
21     result |= 1;
22   return result;
23 }