[committed] Fix previously latent bug in reorg affecting cris port
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / pr85657-3.c
blob1d2e69d6341ba8b53f2a89dce7eaa05e8403492f
1 /* { dg-do run { target { powerpc*-*-linux* } } } */
2 /* { dg-require-effective-target ppc_float128_sw } */
3 /* { dg-require-effective-target vsx_hw } */
4 /* { dg-options "-mvsx -O2" } */
6 /* PR 85657 -- make __ibm128 a full type. */
8 __attribute__ ((__noinline__))
9 __float128
10 ibm128_to_float128 (__ibm128 a)
12 return (__float128)a + 1.0q;
15 __attribute__ ((__noinline__))
16 __float128
17 ldouble_to_float128 (long double a)
19 return (__float128)a + 1.0q;
22 __attribute__ ((__noinline__))
23 __ibm128
24 float128_to_ibm128 (__float128 a)
26 return (__ibm128)a + (__ibm128)1.0;
29 __attribute__ ((__noinline__))
30 __ibm128
31 ldouble_to_ibm128 (long double a)
33 return (__ibm128)a + (__ibm128)1.0;
36 __attribute__ ((__noinline__))
37 long double
38 ibm128_to_ldouble (__ibm128 a)
40 return (long double)a + 1.0L;
43 __attribute__ ((__noinline__))
44 long double
45 float128_to_ldouble (__float128 a)
47 return (long double)a + 1.0L;
50 volatile __float128 f128 = 1.25Q;
51 volatile __ibm128 i128 = (__ibm128)3.5L;
52 volatile long double ld = 4.75L;
54 volatile double f128_p1 = 2.25;
55 volatile double i128_p1 = 4.5;
56 volatile double ld_p1 = 5.75;
58 extern void abort (void);
60 int
61 main (void)
63 if (((double) float128_to_ldouble (f128)) != f128_p1)
64 abort ();
66 if (((double) float128_to_ibm128 (f128)) != f128_p1)
67 abort ();
69 if (((double) ibm128_to_ldouble (i128)) != i128_p1)
70 abort ();
72 if (((double) ibm128_to_float128 (i128)) != i128_p1)
73 abort ();
75 if (((double) ldouble_to_ibm128 (ld)) != ld_p1)
76 abort ();
78 if (((double) ldouble_to_float128 (ld)) != ld_p1)
79 abort ();
81 return 0;