summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.hp/foll-fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.hp/foll-fork.c')
-rw-r--r--gdb/testsuite/gdb.hp/foll-fork.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.hp/foll-fork.c b/gdb/testsuite/gdb.hp/foll-fork.c
new file mode 100644
index 00000000000..89f92ae22fe
--- /dev/null
+++ b/gdb/testsuite/gdb.hp/foll-fork.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+
+void callee (i)
+ int i;
+{
+ printf("callee: %d\n", i);
+}
+
+main ()
+{
+ int pid;
+ int v = 5;
+
+ pid = fork ();
+ if (pid == 0)
+ {
+ v++;
+ /* printf ("I'm the child!\n"); */
+ }
+ else
+ {
+ v--;
+ /* printf ("I'm the proud parent of child #%d!\n", pid); */
+ }
+}