Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/opt/nrv17.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do run } |
2 | |
3 #include <cstdlib> | |
4 #include <complex> | |
5 | |
6 void __attribute__((noinline)) | |
7 h(std::complex<double> x) | |
8 { | |
9 if (x.real() != 2.0) | |
10 std::abort (); | |
11 } | |
12 | |
13 void __attribute__((noinline)) | |
14 g(std::complex<double> x) | |
15 { | |
16 if (x.real() != 0.5) | |
17 std::abort (); | |
18 } | |
19 | |
20 void __attribute__((noinline)) | |
21 f(std::complex<double> x) | |
22 { | |
23 h (x); | |
24 x = 1.0 / x; | |
25 g (x); | |
26 } | |
27 | |
28 int main() | |
29 { | |
30 f(2.0); | |
31 return 0; | |
32 } |