Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/torture/pr34099.C @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* { dg-do run } */ | |
2 | |
3 #include <complex> | |
4 | |
5 typedef std::complex<double> NumType; | |
6 | |
7 void | |
8 multiply(NumType a, NumType b, unsigned ac, NumType &ab) | |
9 { | |
10 NumType s; | |
11 for (unsigned j=0; j<ac; j++) | |
12 s = a * b; | |
13 ab = s; | |
14 } | |
15 extern "C" void abort (void); | |
16 int main() | |
17 { | |
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; | |
24 } | |
25 |