2 divconst-2.c from the execute part of the gcc torture tests.
11 #pragma disable_warning 85
13 #ifndef __SDCC_pdk14 // Lack of memory
17 return x
/ (-0x7fffffffL
- 1L);
23 return x
% (-0x7fffffffL
- 1L);
26 #if !(defined(__SDCC_pic14) && !defined(__SDCC_PIC14_ENHANCED)) // Pseudo-stack size limit
27 /* Since we have a negative divisor, this equation must hold for the
28 results of / and %; no specific results are guaranteed. */
30 std_eqn (long num
, long denom
, long quot
, long rem
)
32 /* For completeness, a check for "ABS (rem) < ABS (denom)" belongs here,
33 but causes trouble on 32-bit machines and isn't worthwhile. */
34 return quot
* (-0x7fffffffL
- 1L) + rem
== num
;
40 -1L, 0x7fffffffL
, -0x7fffffffL
- 1L
45 testTortureExecute (void)
47 #ifndef __SDCC_pdk14 // Lack of memory
48 #if !(defined (__SDCC_pdk15) && defined(__SDCC_STACK_AUTO)) // Lack of code memory
52 i
< sizeof (nums
) / sizeof (nums
[0]);
54 #if !(defined(__SDCC_pic14) && !defined(__SDCC_PIC14_ENHANCED)) // Pseudo-stack size limit
55 if (std_eqn (nums
[i
], -0x7fffffffL
- 1L, f (nums
[i
]), r (nums
[i
])) == 0)