OSDN Git Service

* gcc.dg/intmax_t-1.c: Remove mmix-*-* from dg-error statement.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / builtins-45.c
1 /* { dg-do compile } */
2 /* { dg-options "-O1 -fno-trapping-math -fdump-tree-optimized" } */
3   
4 extern void f(int);
5 extern void link_error ();
6
7 extern float x;
8 extern double y;
9 extern long double z;
10
11 int
12 main ()
13 {
14   double nan = __builtin_nan ("");
15   float nanf = __builtin_nanf ("");
16   long double nanl = __builtin_nanl ("");
17
18   double pinf = __builtin_inf ();
19   float pinff = __builtin_inff ();
20   long double pinfl = __builtin_infl ();
21
22   if (__builtin_finite (pinf))
23     link_error ();
24   if (__builtin_finitef (pinff))
25     link_error ();
26   if (__builtin_finitel (pinfl))
27     link_error ();
28
29   if (__builtin_finite (nan))
30     link_error ();
31   if (__builtin_finitef (nanf))
32     link_error ();
33   if (__builtin_finitel (nanl))
34     link_error ();
35
36   if (!__builtin_finite (4.0))
37     link_error ();
38   if (!__builtin_finitef (4.0))
39     link_error ();
40   if (!__builtin_finitel (4.0))
41     link_error ();
42 }
43
44
45 /* Check that all instances of link_error were subject to DCE.  */
46 /* { dg-final { scan-tree-dump-times "link_error" 0 "optimized" } } */
47 /* { dg-final { cleanup-tree-dump "optimized" } } */