2 bug-2197.c - originally part of the tests from the execute part of the gcc torture suite (see 20020503-1.c).
3 Heavily modified to reproduce the underlying issue of bug 2197 on multiple architectures.
8 #if defined(__SDCC_MODEL_SMALL) || defined(__SDCC_MODEL_MEDIUM) || \
9 (defined(__SDCC_mcs51) && defined(__SDCC_STACK_AUTO)) || defined(__SDCC_pdk15) || defined(__SDCC_pic14)
16 /* GCSE unified the two i<0 tests, but if-conversion to ui=abs(i)
17 inserted the code at the wrong place corrupting the i<0 test. */
20 inttostr (long i
, char buf
[N
])
23 char *p
= buf
+ (N
-1);
29 while ((ui
/= 10) != 0);
36 testTortureExecute (void)
38 #ifndef __SDCC_pdk14 // Lack of memory
41 p
= inttostr (-1, buf
);
46 ASSERT(p
== buf
+ (N
-1) - 2);