OSDN Git Service

2010-02-09 Richard Guenther <rguenther@suse.de>
[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
5 /* { dg-do run } */
6 /* { dg-options "-fsingle-precision-constant" } */
7 /* { dg-add-options c99_runtime } */
8
9 #include <math.h>
10 #include <float.h>
11
12 #include "builtins-config.h"
13
14 int main (void)
15 {
16   int result = 0;
17   double local_DBL_MAX = DBL_MAX; 
18   double local_DBL_MIN = DBL_MIN;
19 #ifdef HAVE_C99_RUNTIME
20   if (isinf (local_DBL_MAX))
21     result |= 1;
22 #endif
23   if (local_DBL_MIN <= 0.0)
24     result |= 1;
25   return result;
26 }