[testsuite] require sqrt_insn effective target where needed
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr110011.c
blob5b04d3e298a8624c7b7aafbc1902bb17af1f346b
1 /* { dg-do run } */
2 /* { dg-require-effective-target float128_runtime } */
3 /* Force long double to be with IBM format here, to verify
4 _Float128 constant still uses its own format (IEEE) for
5 encoding rather than IBM format. */
6 /* { dg-options "-mfp-in-toc -mabi=ibmlongdouble" } */
7 /* { dg-add-options float128 } */
9 #define MPFR_FLOAT128_MAX 0x1.ffffffffffffffffffffffffffffp+16383f128
11 __attribute__ ((noipa))
12 _Float128 f128_max ()
14 return MPFR_FLOAT128_MAX;
17 typedef union
19 int w[4];
20 _Float128 f128;
21 } U;
23 int main ()
26 U umax;
27 umax.f128 = f128_max ();
28 /* ieee float128 max:
29 7ffeffff ffffffff ffffffff ffffffff. */
30 if (umax.w[1] != 0xffffffff || umax.w[2] != 0xffffffff)
31 __builtin_abort ();
32 #ifdef __LITTLE_ENDIAN__
33 if (umax.w[0] != 0xffffffff || umax.w[3] != 0x7ffeffff)
34 __builtin_abort ();
35 #else
36 if (umax.w[3] != 0xffffffff || umax.w[0] != 0x7ffeffff)
37 __builtin_abort ();
38 #endif
40 return 0;