Merge -r 127928:132243 from trunk
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr34099.C
blob49fa9cac1ebc1d5454028208ef8977ff6f6526c5
1 /* { dg-do run } */
3 #include <complex>
5 typedef std::complex<double> NumType;
7 void
8 multiply(NumType a, NumType b, unsigned ac, NumType &ab)
10   NumType s;
11   for (unsigned j=0; j<ac; j++)
12     s = a * b;
13   ab = s;
15 extern "C" void abort (void);
16 int main()
18   NumType a(1,2), b(3,-2), c;
19   multiply(a, b, 1, c);
20   if (c.real() != 7
21       || c.imag() != 4)
22     abort ();
23   return 0;