re PR target/85657 (Make __ibm128 a separate type, even if long double uses the IBM...
[official-gcc.git] / gcc / testsuite / g++.dg / pr85657.C
blobe62b62abcc5a10f230f361c633c1109e6e665bf0
1 // { dg-do compile { target { powerpc*-*-linux* } } }
2 // { dg-require-effective-target ppc_float128_sw }
3 // { dg-options "-mvsx -mfloat128 -O2 -mabi=ibmlongdouble -Wno-psabi" }
5 // PR 85657
6 // Check that __ibm128 and long double can be used in the same template,
7 // even if long double uses the IBM extended double representation.
9 template <class __T> inline bool
10 iszero (__T __val)
12   return __val == 0;
15 int
16 use_template (void)
18   long double ld = 0.0;
19   __ibm128 ibm = 0.0;
21   __asm__ (" # %x0, %x1" : "+d" (ld), "+d" (ibm));
23   return iszero (ld) + iszero (ibm);