summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr58552.C
blob: 17c0d1cf624b2be46b31b9c5147bcd89fbab1755 (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
27
28
29
// { dg-do compile }
// { dg-additional-options "-fcompare-debug" }

extern void fancy_abort () __attribute__ ((__noreturn__));
extern "C" {
    struct __jmp_buf_tag { };
    typedef struct __jmp_buf_tag jmp_buf[1];
    extern int _setjmp (struct __jmp_buf_tag __env[1]) throw ();
}
extern void *gfc_state_stack;
static jmp_buf eof_buf;
static void push_state ()
{
  if (!gfc_state_stack)
    fancy_abort ();
}
bool gfc_parse_file (void)
{
  int seen_program=0;
  if (_setjmp (eof_buf))
    return false;
  if (seen_program)
    goto duplicate_main;
  seen_program = 1;
  push_state ();
  push_state ();
duplicate_main:
  return true;
}