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

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

// PR target/5740
// This testcase ICEd on SPARC -m64 because emit_group_load tried
// to move a DFmode register into DImode register directly.
// { dg-do compile }
// { dg-options "-O2" }

struct C
{
  C (double y, double z) { __real__ x = y; __imag__ x = z; }
  double r () const { return __real__ x; }
  double i () const { return __imag__ x; }
  __complex__ double x;
};

C conj (const C& z)
{
  return C (z.r (), -z.i ());
}