1 /** setjmp/longjmp tests (focusing on getting the jump right).
5 #if !defined(__SDCC_pic14) // Unimplemented setjmp
8 unsigned int global_int
= 0;
11 #if defined(__SDCC_mcs51)
15 T2_isr (void) __interrupt (5) //no using
17 //do not clear flag TF2 so it keeps interrupting !
23 try_fun (jmp_buf catch, int except
)
25 longjmp (catch, except
);
32 longjmp(buf
, 0); // When called with an argument of 0, longjmp() makes setjmp() return 1 instead.
50 // Get FreeBSD version to skip part of test for known broken setjmp (FreeBSD bug #255320, affecting at least FreeBSD 13.0 and FreeBSD 13.1).
52 #include <sys/param.h>
58 #if !defined(__SDCC_pic14) // Unimplemented setjmp
62 #if defined(__SDCC_mcs51)
64 //enable the interrupt and set it's flag to generate some heavy stack usage
70 exception
= setjmp (catch);
74 //should not get here!
77 ASSERT (exception
== 1);
79 #if !defined(__FreeBSD__) || __FreeBSD_version >= 1302000 // Known FreeBSD 13.0 and 13.1 bug #255320.
84 // C99 might require setjmp to be a macro. The standard seems self-contradicting on this issue.