re PR middle-end/57147 (setjmp call and if body wrongly elided (function runs off...
[gcc.git] / gcc / testsuite / gcc.dg / torture / pr57147-3.c
1 /* { dg-do compile } */
2
3 typedef char * ptr_t;
4 struct __jmp_buf_tag {
5 };
6 typedef struct __jmp_buf_tag sigjmp_buf[1];
7 sigjmp_buf GC_jmp_buf;
8 void GC_fault_handler(int sig)
9 {
10 }
11 void GC_setup_temporary_fault_handler() {
12 GC_set_and_save_fault_handler(GC_fault_handler);
13 }
14 ptr_t GC_find_limit(ptr_t p)
15 {
16 GC_setup_temporary_fault_handler();
17 if (__sigsetjmp (GC_jmp_buf, 1) == 0)
18 for (;;)
19 ;
20 }