diff options
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/restore.c | 16 |
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 */ |