aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/setjmp-6.c
blob: d821d230ce0af0f0d128a2cd992218ec881e5dd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* PR69569 */
/* { dg-do compile } */
/* { dg-options "-O3" } */
/* { dg-require-effective-target indirect_jumps } */

#include <setjmp.h>

jmp_buf buf;

struct str {
    int Count;
};
int fun2(struct str *p1)
{
    int i = 1;
    while (1) {
	setjmp(buf);
	break;
    }
    for (; i;) {
	i = 0;
	for (; i < (p1 ? p1->Count : 1); i++)
	  fun2(p1);
    }
    return 1;
}