summaryrefslogtreecommitdiffstats
path: root/tests/run-make/longjmp-across-rust/foo.c
blob: bd71cc4d777128b9877043b7b928eee0b9592343 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <assert.h>
#include <setjmp.h>

static jmp_buf ENV;

extern void test_middle();

void test_start(void(*f)()) {
  if (setjmp(ENV) != 0)
    return;
  f();
  assert(0);
}

void test_end() {
  longjmp(ENV, 1);
  assert(0);
}