view 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
line wrap: on
line source

// { dg-do run }

#include <cstdlib>
#include <complex>

void __attribute__((noinline))
h(std::complex<double> x)
{
  if (x.real() != 2.0)
    std::abort ();
}

void __attribute__((noinline))
g(std::complex<double> x)
{
  if (x.real() != 0.5)
    std::abort ();
}

void __attribute__((noinline))
f(std::complex<double> x)
{
  h (x);
  x = 1.0 / x;
  g (x);
}

int main()
{
  f(2.0);
  return 0;
}