[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / extract_recip_3.c
blob15bcc27f8bfae6cc960f7b60a2ddf95afc2692ee
1 /* { dg-do compile } */
2 /* { dg-options "-Ofast -fdump-tree-optimized-raw" } */
4 float
5 extract_square (float *a, float *b, float x, float y)
7 *a = 3 / (y * y);
8 *b = 5 / (y * y);
10 return x / (y * y);
13 /* Don't expect the 'powmult' (calculation of y * y)
14 to be deleted until a later pass, so look for one
15 more multiplication than strictly necessary. */
16 float
17 extract_recip (float *a, float *b, float x, float y, float z)
19 *a = 7 / y;
20 *b = x / (y * y);
22 return z / y;
25 /* 4 multiplications in 'extract_square', and 4 in 'extract_recip'. */
26 /* { dg-final { scan-tree-dump-times "mult_expr" 8 "optimized" } } */
28 /* 1 division in 'extract_square', 1 division in 'extract_recip'. */
29 /* { dg-final { scan-tree-dump-times "rdiv_expr" 2 "optimized" } } */