5 #define TST int i, a[2], b[2]; \
6 for (i = 0; i < 2; i++) a[i] = 0; \
7 for (i = 0; i < 2; i++) b[i] = 0
11 static void tst1 (void)
17 static void tst2(void)
26 static void tst3 (jmp_buf loc
)
32 static void tst4(jmp_buf loc
)
41 static void tst (void)
47 if (setjmp (jmp
) == 0) {
54 if (setjmp (loc
) == 0) {
62 printf ("incorrect cnt %d\n", cnt
);
71 static void stack (void)
74 static int way_point1
;
75 static int way_point2
;
81 if (setjmp (buf1
) != 101) {
87 else if (g_counter
== 5)
105 else if (g_counter
== 5)
121 if (!(way_point1
== 0 && way_point2
== 0 &&
122 g_counter
== 6 && counter
== 2))
123 printf ("Failed %d %d %d %d\n",
124 way_point1
, way_point2
, g_counter
, counter
);
128 static int last_value
;
130 static void jump (int val
)
135 static void check (void)
140 value
= setjmp (env
);
141 if (value
!= last_value
+ 1) {
142 printf ("incorrect value %d %d\n",
143 value
, last_value
+ 1);
148 #if !(defined(__FreeBSD__) || defined(__NetBSD__))
149 /* longjmp(jmp_buf, 0) not supported */
164 for (i
= 0; i
< 10; i
++) {