1 /* Tests for _FloatN / _FloatNx types: test usual arithmetic
3 /* { dg-do compile } */
4 /* { dg-options "" } */
5 /* { dg-add-options float32 } */
6 /* { dg-add-options float64 } */
7 /* { dg-add-options float32x } */
8 /* { dg-require-effective-target float32 } */
9 /* { dg-require-effective-target float64 } */
10 /* { dg-require-effective-target float32x } */
12 #define __STDC_WANT_IEC_60559_TYPES_EXT__
17 #define TEST(VAR, TYPE1, TYPE2, RESTYPE) \
20 typedef __typeof__ ((TYPE1) 0 + (TYPE2) 1) restype; \
21 typedef __typeof__ (i ? (TYPE1) 0 : (TYPE2) 1) restype2; \
22 typedef RESTYPE exptype; \
24 extern restype2 VAR; \
32 TEST (v1
, float, double, double);
33 #if DBL_MANT_DIG > FLT32_MANT_DIG
34 TEST (v2
, double, _Float32
, double);
36 #if DBL_MANT_DIG <= FLT64_MANT_DIG
37 TEST (v3
, double, _Float64
, _Float64
);
39 #if DBL_MANT_DIG >= FLT32X_MANT_DIG
40 TEST (v4
, double, _Float32x
, double);
42 #if FLT_MANT_DIG <= FLT32_MANT_DIG
43 TEST (v5
, float, _Float32
, _Float32
);
45 #if FLT32X_MANT_DIG <= FLT64_MANT_DIG
46 TEST (v6
, _Float32x
, _Float64
, _Float64
);
48 TEST (v7
, _Float32
, _Float64
, _Float64
);
49 TEST (v8
, _Float32
, _Float32x
, _Float32x
);