view gcc/testsuite/g++.dg/pr85657.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
line wrap: on
line source

// { dg-do compile { target { powerpc*-*-linux* } } }
// { dg-require-effective-target ppc_float128_sw }
// { dg-options "-mvsx -mfloat128 -O2 -mabi=ibmlongdouble -Wno-psabi" }

// PR 85657
// Check that __ibm128 and long double can be used in the same template,
// even if long double uses the IBM extended double representation.

template <class __T> inline bool
iszero (__T __val)
{
  return __val == 0;
}

int
use_template (void)
{
  long double ld = 0.0;
  __ibm128 ibm = 0.0;

  __asm__ (" # %x0, %x1" : "+d" (ld), "+d" (ibm));

  return iszero (ld) + iszero (ibm);
}