Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / extract_recip_4.c
blob816e3615e5082dcb3d4e752059d708b99ec5b6cf
1 /* { dg-do compile } */
2 /* { dg-options "-Ofast -fdump-tree-optimized-raw" } */
4 /* Don't expect any of these divisions to be extracted. */
5 double f (double x, int p)
7 if (p > 0)
9 return 1.0/(x * x);
12 if (p > -1)
14 return x * x * x;
16 return 1.0 /(x);
19 /* Expect a reciprocal to be extracted here. */
20 double g (double *a, double x, double y)
22 *a = 3 / y;
23 double k = x / (y * y);
25 if (y * y == 2.0)
26 return k + 1 / y;
27 else
28 return k - 1 / y;
31 /* Expect 2 divisions in 'f' and 1 in 'g'. */
32 /* { dg-final { scan-tree-dump-times "rdiv_expr" 3 "optimized" } } */
33 /* Expect 3 multiplications in 'f' and 4 in 'g'. */
34 /* { dg-final { scan-tree-dump-times "mult_expr" 7 "optimized" } } */