]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/c2x-float-3.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / c2x-float-3.c
CommitLineData
3cfe746f
JM
1/* Test INFINITY macro. Test when infinities supported. */
2/* { dg-do run } */
3/* { dg-options "-std=c2x -pedantic-errors" } */
4/* { dg-add-options ieee } */
5/* { dg-require-effective-target inff } */
6
7#include <float.h>
8
9#ifndef INFINITY
10#error "INFINITY undefined"
11#endif
12
13volatile float f = INFINITY;
14
15extern void abort (void);
16extern void exit (int);
17
18int
19main (void)
20{
21 (void) _Generic (INFINITY, float : 0);
22 if (!(INFINITY > FLT_MAX))
23 abort ();
24 if (!(f > FLT_MAX))
25 abort ();
26 exit (0);
27}