shithub: mc

ref: 34f2230c4a505f3b94bc33ed07f0839fe66a0e93
dir: /lib/std/test/sjlj.myr/

View raw version
use std

var st

const main = {
	var jb

	st = 1
	if std.setjmp(&jb)
		std.put("nonlocal return\n")
		std.exit(st)
	;;
	st = 0
	std.put("doing jmp\n")
	dolongjmp(&jb)
	std.fatal("unreachable\n")
}

const dolongjmp = {jb
	std.longjmp(jb)
}