Mercurial > hg > CbC > CbC_gcc
diff gcc/testsuite/g++.dg/torture/pr34099.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gcc/testsuite/g++.dg/torture/pr34099.C Fri Oct 27 22:46:09 2017 +0900 @@ -0,0 +1,25 @@ +/* { 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; +} +