Implement C _FloatN, _FloatNx types.
[official-gcc.git] / gcc / testsuite / gcc.dg / torture / float16-floath.c
blob6857c2e9aa87d4e369eac37e24c917db5416c91d
1 /* Test _Float16 <float.h> macros. */
2 /* { dg-do run } */
3 /* { dg-options "" } */
4 /* { dg-add-options float16 } */
5 /* { dg-require-effective-target float16_runtime } */
7 #define WIDTH 16
8 #define EXT 0
9 #include "floatn-floath.h"
11 #ifndef FLT16_MANT_DIG
12 # error "FLT16_MANT_DIG undefined"
13 #endif
15 #ifndef FLT16_DECIMAL_DIG
16 # error "FLT16_DECIMAL_DIG undefined"
17 #endif
19 #ifndef FLT16_DIG
20 # error "FLT16_DIG undefined"
21 #endif
23 #ifndef FLT16_MIN_EXP
24 # error "FLT16_MIN_EXP undefined"
25 #endif
27 #ifndef FLT16_MIN_10_EXP
28 # error "FLT16_MIN_10_EXP undefined"
29 #endif
31 #ifndef FLT16_MAX_EXP
32 # error "FLT16_MAX_EXP undefined"
33 #endif
35 #ifndef FLT16_MAX_10_EXP
36 # error "FLT16_MAX_10_EXP undefined"
37 #endif
39 #ifndef FLT16_MAX
40 # error "FLT16_MAX undefined"
41 #endif
43 #ifndef FLT16_EPSILON
44 # error "FLT16_EPSILON undefined"
45 #endif
47 #ifndef FLT16_MIN
48 # error "FLT16_MIN undefined"
49 #endif
51 #ifndef FLT16_TRUE_MIN
52 # error "FLT16_TRUE_MIN undefined"
53 #endif
55 #if FLT16_DECIMAL_DIG > DECIMAL_DIG
56 # error "FLT16_DECIMAL_DIG > DECIMAL_DIG"
57 #endif
59 #if FLT16_MANT_DIG != 11 || FLT16_MAX_EXP != 16 || FLT16_MIN_EXP != -13
60 # error "_Float16 bad format"
61 #endif