1 extern int strcmp(const char *, const char *);
2 extern char *strcpy(char *, const char *);
3 extern void abort(void);
4 extern void exit(int);
5 
6 void *buf[20];
7 
8 void __attribute__((noinline))
sub2(void)9 sub2 (void)
10 {
11   __builtin_longjmp (buf, 1);
12 }
13 
14 int
main()15 main ()
16 {
17   char *p = (char *) __builtin_alloca (20);
18 
19   strcpy (p, "test");
20 
21   if (__builtin_setjmp (buf))
22     {
23       if (strcmp (p, "test") != 0)
24 	abort ();
25 
26       exit (0);
27     }
28 
29   {
30     int *q = (int *) __builtin_alloca (p[2] * sizeof (int));
31     int i;
32 
33     for (i = 0; i < p[2]; i++)
34       q[i] = 0;
35 
36     while (1)
37       sub2 ();
38   }
39 }
40