PR middle-end/77357 - strlen of constant strings not folded
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / reassoc-39.c
blob9befe184a018515da50a4dd14782d79482fd07d9
1 /* PR tree-optimization/67815 */
2 /* { dg-do compile } */
3 /* { dg-options "-Ofast -g -fdump-tree-reassoc1-details" } */
5 extern float barf (float, float);
6 extern double bar (double, double);
8 float
9 f0 (float x)
11 return 7.5 * __builtin_copysignf (2.0, x);
14 float
15 f1 (float x)
17 return -7.5 * __builtin_copysignf (2.0, x);
20 double
21 f2 (double x, double y)
23 return x * ((1.0/12) * __builtin_copysign (1.0, y));
26 double
27 f3 (double x, double y)
29 return (x * (-1.0/12)) * __builtin_copysign (1.0, y);
32 double
33 f4 (double x, double y, double z)
35 return (x * z) * ((1.0/12) * __builtin_copysign (4.0, y));
38 double
39 f5 (double x, double y, double z)
41 return (x * (-1.0/12)) * z * __builtin_copysign (2.0, y);
44 float
45 f6 (float x, float y)
47 return 7.5f * y * __builtin_copysignf (2.0f, x);
50 float
51 f7 (float x, float y)
53 return -7.5f * y * __builtin_copysignf (2.0f, x);
56 float
57 f8 (float x)
59 float tmp1 = 7.5f;
60 float tmp2 = __builtin_copysignf (2.0f, x);
61 return tmp1 * tmp2;
64 double
65 f9 (double x)
67 double tmp1 = 7.5;
68 double tmp2 = __builtin_copysign (2.0, x);
69 return tmp1 * tmp2;
72 float
73 f10 (float x)
75 float tmp1 = 7.5f;
76 float tmp2 = __builtin_copysignf (2.0f, x);
77 float tmp3 = tmp2 * 24.0f;
78 return tmp1 * tmp2;
81 double
82 f11 (double x)
84 double tmp1 = 7.5;
85 double tmp2 = __builtin_copysign (2.0, x);
86 double tmp3 = tmp2 * 24.0;
87 return tmp1 * tmp2;
90 float
91 f12 (float x)
93 float tmp1 = 7.5f;
94 float tmp2 = __builtin_copysignf (2.0f, x);
95 /* Can't reassoc here. */
96 return barf (tmp1 * tmp2, tmp2);
99 double
100 f13 (double x)
102 double tmp1 = 7.5;
103 double tmp2 = __builtin_copysign (2.0, x);
104 /* Can't reassoc here. */
105 return bar (tmp1 * tmp2, tmp2);
107 /* { dg-final { scan-tree-dump-times "Optimizing copysign" 12 "reassoc1"} }*/