diff options
author | Pedro Alves <palves@redhat.com> | 2009-03-18 15:36:01 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2009-03-18 15:36:01 +0000 |
commit | 51272cf2e948babb8d236bb5525db2154db02207 (patch) | |
tree | 423cdebf6a49220c63418e4450e01ba88205ab0b /gdb/testsuite/gdb.base/return-nodebug.c | |
parent | 42e5fcbf34e8d4850abaef7b3e6021348e59eedd (diff) |
* return-nodebug.c: Don't include stdio.h.
(init): Delete.
(func): Delete definition and provide extern declaration.
(t): New.
(main): Don't call printf. Call func and store its result in t.
* return-nodebug1.c: New.
* return-nodebug.exp: Don't expect stdio output. Instead, print
the global variable t. Drop printf formatters and cast types from
foreach loop. Don't use prepare_for_testing. Compile
return-nodebug.c and return-nodebug1.c in separate steps. Don't
define FORMAT or CAST.
Diffstat (limited to 'gdb/testsuite/gdb.base/return-nodebug.c')
-rw-r--r-- | gdb/testsuite/gdb.base/return-nodebug.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/gdb/testsuite/gdb.base/return-nodebug.c b/gdb/testsuite/gdb.base/return-nodebug.c index e1211b3604..cba242d83b 100644 --- a/gdb/testsuite/gdb.base/return-nodebug.c +++ b/gdb/testsuite/gdb.base/return-nodebug.c @@ -15,34 +15,20 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include <stdio.h> - -static TYPE -init (void) -{ - return 0; -} - -static TYPE -func (void) -{ - return 31; -} +extern TYPE func (void); static void marker (void) { } +TYPE t; + int main (void) { - /* Preinitialize registers to 0 to avoid false PASS by leftover garbage. */ - init (); - - printf ("result=" FORMAT "\n", CAST func ()); + t = func (); - /* Cannot `next' with no debug info. */ marker (); return 0; |