aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2001-05-07 00:05:15 +0000
committerJim Blandy <jimb@codesourcery.com>2001-05-07 00:05:15 +0000
commit5a360f470be5d95525a465c500cf5d9cd4beada3 (patch)
tree94144da1dd271c4653a59210c9bc4a2269b47b4b
parentce696e0556e9ddc48e7d049356a3c3fe6b7399d8 (diff)
downloadgdb-5a360f470be5d95525a465c500cf5d9cd4beada3.zip
gdb-5a360f470be5d95525a465c500cf5d9cd4beada3.tar.gz
gdb-5a360f470be5d95525a465c500cf5d9cd4beada3.tar.bz2
* restore.c: Make the code of caller0 correspond to its comment.
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.base/restore.c16
2 files changed, 12 insertions, 8 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 08f5ad6..9ba2c8d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2001-05-06 Jim Blandy <jimb@redhat.com>
+
+ * restore.c: Make the code of caller0 correspond to its comment.
+
2001-05-03 Michael Snyder <msnyder@redhat.com>
* config/sid.exp (gdb_target_sid): Check for error messages.
diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c
index 974e944..e05d68c 100644
--- a/gdb/testsuite/gdb.base/restore.c
+++ b/gdb/testsuite/gdb.base/restore.c
@@ -14,11 +14,12 @@
(defun caller (n) (format "caller%d" n))
(defun local (n) (format "l%d" n))
(defun local-sum (n)
- (let ((j 1))
- (while (<= j n)
- (insert (local j))
- (if (< j n) (insert "+"))
- (setq j (1+ j)))))
+ (if (zerop n) (insert "0")
+ (let ((j 1))
+ (while (<= j n)
+ (insert (local j))
+ (if (< j n) (insert "+"))
+ (setq j (1+ j))))))
(defun local-chain (n previous first-end)
(let ((j 1))
(while (<= j n)
@@ -53,8 +54,7 @@
(insert "{\n")
(local-chain i "n" (callee i))
(insert " return ")
- (if (<= i 0) (insert "n")
- (local-sum i))
+ (local-sum i)
(insert ";\n")
(insert "}\n\n")
(setq i (1+ i))))
@@ -103,7 +103,7 @@ increment (int n)
int
callee0 (int n)
{
- return n;
+ return 0;
}
/* Returns n * 1 + 1 */