Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.c-torture / execute / divconst-2.c
blobb58f1bfddc45530d981843909e1900491adee8a5
1 long
2 f (long x)
4 return x / (-0x7fffffffL - 1L);
7 long
8 r (long x)
10 return x % (-0x7fffffffL - 1L);
13 /* Since we have a negative divisor, this equation must hold for the
14 results of / and %; no specific results are guaranteed. */
15 long
16 std_eqn (long num, long denom, long quot, long rem)
18 /* For completeness, a check for "ABS (rem) < ABS (denom)" belongs here,
19 but causes trouble on 32-bit machines and isn't worthwhile. */
20 return quot * (-0x7fffffffL - 1L) + rem == num;
23 long nums[] =
25 -1L, 0x7fffffffL, -0x7fffffffL - 1L
28 main ()
30 int i;
32 for (i = 0;
33 i < sizeof (nums) / sizeof (nums[0]);
34 i++)
35 if (std_eqn (nums[i], -0x7fffffffL - 1L, f (nums[i]), r (nums[i])) == 0)
36 abort ();
38 exit (0);