Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / torture / pr34099.C
blobcbed17e546a080f34f58ec68035d8d75d8594ca8
1 /* { dg-do run } */
2 /* { dg-skip-if "requires hosted libstdc++ for complex" { ! hostedlib } } */
4 #include <complex>
6 typedef std::complex<double> NumType;
8 void
9 multiply(NumType a, NumType b, unsigned ac, NumType &ab)
11   NumType s;
12   for (unsigned j=0; j<ac; j++)
13     s = a * b;
14   ab = s;
16 extern "C" void abort (void);
17 int main()
19   NumType a(1,2), b(3,-2), c;
20   multiply(a, b, 1, c);
21   if (c.real() != 7
22       || c.imag() != 4)
23     abort ();
24   return 0;