Tighten condition in vect/pr85586.c (PR 85654)
[official-gcc.git] / gcc / testsuite / gcc.dg / floatn-arithconv.c
blobc3eb24e1fcd1dc53212f07b72e27fb5dc2ab0378
1 /* Tests for _FloatN / _FloatNx types: test usual arithmetic
2 conversions. */
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__
13 #include <float.h>
15 int i;
17 #define TEST(VAR, TYPE1, TYPE2, RESTYPE) \
18 do \
19 { \
20 typedef __typeof__ ((TYPE1) 0 + (TYPE2) 1) restype; \
21 typedef __typeof__ (i ? (TYPE1) 0 : (TYPE2) 1) restype2; \
22 typedef RESTYPE exptype; \
23 extern restype VAR; \
24 extern restype2 VAR; \
25 extern exptype VAR; \
26 } \
27 while (0)
29 void
30 f (void)
32 TEST (v1, float, double, double);
33 #if DBL_MANT_DIG > FLT32_MANT_DIG
34 TEST (v2, double, _Float32, double);
35 #endif
36 #if DBL_MANT_DIG <= FLT64_MANT_DIG
37 TEST (v3, double, _Float64, _Float64);
38 #endif
39 #if DBL_MANT_DIG >= FLT32X_MANT_DIG
40 TEST (v4, double, _Float32x, double);
41 #endif
42 #if FLT_MANT_DIG <= FLT32_MANT_DIG
43 TEST (v5, float, _Float32, _Float32);
44 #endif
45 #if FLT32X_MANT_DIG <= FLT64_MANT_DIG
46 TEST (v6, _Float32x, _Float64, _Float64);
47 #endif
48 TEST (v7, _Float32, _Float64, _Float64);
49 TEST (v8, _Float32, _Float32x, _Float32x);