blob: 23ab80f351aad3c016bf56ca86dedc42b62aa34c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
/* Test INFINITY macro. Test when infinities supported. */
/* { dg-do run } */
/* { dg-options "-std=c23 -pedantic-errors" } */
/* { dg-add-options ieee } */
/* { dg-require-effective-target inff } */
#include <float.h>
#ifndef INFINITY
#error "INFINITY undefined"
#endif
volatile float f = INFINITY;
extern void abort (void);
extern void exit (int);
int
main (void)
{
(void) _Generic (INFINITY, float : 0);
if (!(INFINITY > FLT_MAX))
abort ();
if (!(f > FLT_MAX))
abort ();
exit (0);
}
|