Handle T_HRESULT types in CodeView records
[official-gcc.git] / gcc / testsuite / gcc.c-torture / execute / divconst-2.c
blob3464ae1210ac497e0a60ac2cd309c8c5cca64c5a
1 void abort (void);
2 void exit (int);
4 long
5 f (long x)
7 return x / (-0x7fffffffL - 1L);
10 long
11 r (long x)
13 return x % (-0x7fffffffL - 1L);
16 /* Since we have a negative divisor, this equation must hold for the
17 results of / and %; no specific results are guaranteed. */
18 long
19 std_eqn (long num, long denom, long quot, long rem)
21 /* For completeness, a check for "ABS (rem) < ABS (denom)" belongs here,
22 but causes trouble on 32-bit machines and isn't worthwhile. */
23 return quot * (-0x7fffffffL - 1L) + rem == num;
26 long nums[] =
28 -1L, 0x7fffffffL, -0x7fffffffL - 1L
31 int
32 main (void)
34 int i;
36 for (i = 0;
37 i < sizeof (nums) / sizeof (nums[0]);
38 i++)
39 if (std_eqn (nums[i], -0x7fffffffL - 1L, f (nums[i]), r (nums[i])) == 0)
40 abort ();
42 exit (0);