aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/lto/20110201-1_0.c
blob: 871a49fe1897511e39827b96c7c57931d689ce92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-lto-do run } */
/* { dg-lto-options { { -O0 -flto -fno-math-errno } } } */
/* { dg-lto-options { "-O0 -flto -fno-math-errno -mfpu=neon-vfpv4" } { target arm*-*-* } } */
/* { dg-require-effective-target arm_neon_ok_no_float_abi { target arm*-*-* } } */
/* { dg-require-linker-plugin "" } */
/* { dg-require-effective-target sqrt_insn } */

/* We require a linker plugin because otherwise we'd need to link
   against libm which we are not sure here has cabs on all targets.
   This is because collect2 invokes ld on the -O0 object code
   which does not have folded cabs.  */

double cabs(_Complex double);
double __attribute__((used)) __attribute__ ((optimize ("O2,fast-math")))
foo (_Complex double x, int b)
{
  if (b)
    x = 0;
  return cabs(x);
}

int main() { return 0; }