summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/bz5274.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.base/bz5274.c')
-rw-r--r--testsuite/systemtap.base/bz5274.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/bz5274.c b/testsuite/systemtap.base/bz5274.c
new file mode 100644
index 00000000..4e4cfb16
--- /dev/null
+++ b/testsuite/systemtap.base/bz5274.c
@@ -0,0 +1,44 @@
+#include <setjmp.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void funcd(int i, jmp_buf env)
+{
+ printf("In %s: %s :%d : i=%d. Calling longjmp\n", "bz5274.c",__func__,__LINE__,i);
+ longjmp(env, i);
+}
+
+void funcc(int i, jmp_buf env)
+{
+ printf("In %s: %s :%d : i=%d. Calling funcd\n", "bz5274.c",__func__,__LINE__,i);
+ funcd(i,env);
+}
+
+
+void funcb(int i, jmp_buf env)
+{
+ printf("In %s: %s :%d : i=%d. Calling funcc\n", "bz5274.c",__func__,__LINE__,i);
+ funcc(i,env);
+}
+
+
+void funca(char *s, jmp_buf env)
+{
+ int i;
+
+ i = setjmp(env);
+ if (i == 4)
+ return;
+ funcb(++i, env);
+ return;
+}
+
+
+
+int main(int argc, char **argv)
+{
+ jmp_buf env;
+
+ funca("Hello World", env);
+ exit(0);
+}