setjump test
authorMatthias Braun <matze@braunis.de>
Wed, 19 Mar 2008 10:59:50 +0000 (10:59 +0000)
committerMatthias Braun <matze@braunis.de>
Wed, 19 Mar 2008 10:59:50 +0000 (10:59 +0000)
[r18173]

ir/be/test/setjump.c [new file with mode: 0644]

diff --git a/ir/be/test/setjump.c b/ir/be/test/setjump.c
new file mode 100644 (file)
index 0000000..978a7e9
--- /dev/null
@@ -0,0 +1,15 @@
+#include <setjmp.h>
+
+int main(void) {
+       jmp_buf buf;
+       volatile int     k = 0;
+
+       int val = setjmp(buf);
+       printf("Val: %d K: %d\n", val, k);
+
+       k = 1;
+       if(val == 0)
+               longjmp(buf, 20);
+
+       return 0;
+}