summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/recurse.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1994-06-07 01:57:15 +0000
committerStan Shebs <shebs@codesourcery.com>1994-06-07 01:57:15 +0000
commitef44eed173353ff002da6fe92680e40068cd081f (patch)
treebeeeaecb50227b8c1fe964debaf3c8f45bc9ac9a /gdb/testsuite/gdb.base/recurse.c
parent33268150cbbcc90ec13f5603d566537cf4cd569e (diff)
downloadbinutils-gdb-ef44eed173353ff002da6fe92680e40068cd081f.tar.gz
Reorganized GDB tests - base
Diffstat (limited to 'gdb/testsuite/gdb.base/recurse.c')
-rw-r--r--gdb/testsuite/gdb.base/recurse.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/recurse.c b/gdb/testsuite/gdb.base/recurse.c
new file mode 100644
index 00000000000..6ae93a5dd95
--- /dev/null
+++ b/gdb/testsuite/gdb.base/recurse.c
@@ -0,0 +1,21 @@
+/* Trivial code used to test watchpoints in recursive code and
+ auto-deletion of watchpoints as they go out of scope. */
+
+static int
+recurse (a)
+ int a;
+{
+ int b = 0;
+
+ if (a == 1)
+ return 1;
+
+ b = a;
+ b *= recurse (a - 1);
+ return b;
+}
+
+main()
+{
+ recurse (10);
+}