2 /* { dg-options -O2 } */
4 extern void abort (void);
10 /* [-INF, -1] / [1, +INF] should not give [-1, -1]. */
21 /* [-20, -10] / [2, 10] should give [-10, -1]. */
36 /* [-20, -10] / [-10, -2] should give [1, 10]. */
51 /* [-20, 10] / [2, 10] should give [-10, 5]. */
66 /* [-20, 10] / [-10, -2] should give [-5, 10]. */
81 /* [10, 20] / [2, 10] should give [1, 10]. */
96 /* [10, 20] / [-10, -2] should give [-10, -1]. */
115 foo_mult (int i
, int j
)
119 /* [-20, -10] * [2, 10] should give [-200, -20]. */
134 /* [-20, -10] * [-10, -2] should give [20, 200]. */
149 /* [-20, 10] * [2, 10] should give [-200, 100]. */
164 /* [-20, 10] * [-10, -2] should give [-100, 200]. */
179 /* [10, 20] * [2, 10] should give [20, 200]. */
194 /* [10, 20] * [-10, -2] should give [-200, -20]. */
215 if (foo_div (-10, 5) != -2)
218 if (foo_div (-16, 4) != -4)
221 if (foo_div (-15, -5) != 3)
224 if (foo_div (8, 2) != 4)
227 if (foo_div (10, -2) != -5)
230 if (foo_div (20, 5) != 4)
233 if (foo_div (15, -3) != -5)
236 if (foo_mult (-10, 5) != -50)
239 if (foo_mult (-16, 4) != -64)
242 if (foo_mult (-15, -5) != 75)
245 if (foo_mult (8, 2) != 16)
248 if (foo_mult (10, -2) != -20)
251 if (foo_mult (20, 5) != 100)
254 if (foo_mult (15, -3) != -45)