From: Jim Blandy Date: Mon, 7 May 2001 00:05:15 +0000 (+0000) Subject: * restore.c: Make the code of caller0 correspond to its comment. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a360f470be5d95525a465c500cf5d9cd4beada3;p=binutils-gdb.git * restore.c: Make the code of caller0 correspond to its comment. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 08f5ad6601a..9ba2c8d31c1 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-05-06 Jim Blandy + + * restore.c: Make the code of caller0 correspond to its comment. + 2001-05-03 Michael Snyder * 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 974e94486cc..e05d68c2145 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 */