view gcc/testsuite/g++.dg/torture/pr34099.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

/* { dg-do run } */

#include <complex>

typedef std::complex<double> NumType;

void
multiply(NumType a, NumType b, unsigned ac, NumType &ab)
{
  NumType s;
  for (unsigned j=0; j<ac; j++)
    s = a * b;
  ab = s;
}
extern "C" void abort (void);
int main()
{
  NumType a(1,2), b(3,-2), c;
  multiply(a, b, 1, c);
  if (c.real() != 7
      || c.imag() != 4)
    abort ();
  return 0;
}