2 /* { dg-options "-O2" } */
4 extern double fabs(double);
5 extern float fabsf(float);
6 extern void abort(void);
19 double test2(double x
)
21 return fabs(x
)*fabs(x
);
26 return fabsf(x
)*fabsf(x
);
29 double test3(double x
, double y
)
34 float test3f(float x
, float y
)
39 double test4(double x
, double y
)
44 float test4f(float x
, float y
)
51 if (test1(1.0) != 1.0)
53 if (test1(2.0) != 4.0)
55 if (test1(0.0) != 0.0)
57 if (test1(-1.0) != 1.0)
59 if (test1(-2.0) != 4.0)
62 if (test1f(1.0f
) != 1.0f
)
64 if (test1f(2.0f
) != 4.0f
)
66 if (test1f(0.0f
) != 0.0f
)
68 if (test1f(-1.0f
) != 1.0f
)
70 if (test1f(-2.0f
) != 4.0f
)
73 if (test2(1.0) != 1.0)
75 if (test2(2.0) != 4.0)
77 if (test2(0.0) != 0.0)
79 if (test2(-1.0) != 1.0)
81 if (test2(-2.0) != 4.0)
84 if (test2f(1.0f
) != 1.0f
)
86 if (test2f(2.0f
) != 4.0f
)
88 if (test2f(0.0f
) != 0.0f
)
90 if (test2f(-1.0f
) != 1.0f
)
92 if (test2f(-2.0f
) != 4.0f
)
95 if (test3(1.0,1.0) != 1.0)
97 if (test3(1.0,-1.0) != 1.0)
99 if (test3(1.0,2.0) != 4.0)
101 if (test3(1.0,-2.0) != 4.0)
103 if (test3(2.0,1.0) != 4.0)
105 if (test3(2.0,-1.0) != 4.0)
107 if (test3(2.0,2.0) != 16.0)
109 if (test3(2.0,-2.0) != 16.0)
111 if (test3(-2.0,1.0) != 4.0)
113 if (test3(-2.0,-1.0) != 4.0)
115 if (test3(-2.0,2.0) != 16.0)
117 if (test3(-2.0,-2.0) != 16.0)
120 if (test3f(1.0f
,1.0f
) != 1.0f
)
122 if (test3f(1.0f
,-1.0f
) != 1.0f
)
124 if (test3f(1.0f
,2.0f
) != 4.0f
)
126 if (test3f(1.0f
,-2.0f
) != 4.0f
)
128 if (test3f(2.0f
,1.0f
) != 4.0f
)
130 if (test3f(2.0f
,-1.0f
) != 4.0f
)
132 if (test3f(2.0f
,2.0f
) != 16.0f
)
134 if (test3f(2.0f
,-2.0f
) != 16.0f
)
136 if (test3f(-2.0f
,1.0f
) != 4.0f
)
138 if (test3f(-2.0f
,-1.0f
) != 4.0f
)
140 if (test3f(-2.0f
,2.0f
) != 16.0f
)
142 if (test3f(-2.0f
,-2.0f
) != 16.0f
)
145 if (test4(1.0,1.0) != 1.0)
147 if (test4(1.0,-1.0) != 1.0)
149 if (test4(-1.0,1.0) != 1.0)
151 if (test4(-1.0,-1.0) != 1.0)
153 if (test4(6.0,3.0) != 4.0)
155 if (test4(6.0,-3.0) != 4.0)
157 if (test4(-6.0,3.0) != 4.0)
159 if (test4(-6.0,-3.0) != 4.0)
162 if (test4f(1.0f
,1.0f
) != 1.0f
)
164 if (test4f(1.0f
,-1.0f
) != 1.0f
)
166 if (test4f(-1.0f
,1.0f
) != 1.0f
)
168 if (test4f(-1.0f
,-1.0f
) != 1.0f
)
170 if (test4f(6.0f
,3.0f
) != 4.0f
)
172 if (test4f(6.0f
,-3.0f
) != 4.0f
)
174 if (test4f(-6.0f
,3.0f
) != 4.0f
)
176 if (test4f(-6.0f
,-3.0f
) != 4.0f
)