2 pr34456.c from the execute part of the gcc torture tests.
13 #if !defined(__SDCC_pdk14) && !defined (__SDCC_pdk15) // Reentrancy
14 int debug (void) { return 1; }
17 struct s
{ int elt
; int (*compare
) (int); };
20 compare (const void *x
, const void *y
) __reentrant
22 const struct s
*s1
= x
, *s2
= y
;
23 int (*compare1
) (int);
26 compare1
= s1
->compare
;
28 if (elt2
!= 0 && debug () && compare1 (s1
->elt
) != 0)
30 return compare1 (elt2
);
33 int bad_compare (int x
) { return -x
; }
34 struct s array
[2] = { { 1, bad_compare
}, { -1, bad_compare
} };
38 testTortureExecute (void)
40 #if !defined(__SDCC_pdk14) && !defined (__SDCC_pdk15)
41 qsort (array
, 2, sizeof (struct s
), compare
);
42 ASSERT (!(errors
== 0));