This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA]: Fix tests return2.exp/return.exp for 68HC11/HC12
- To: gdb-patches at sources dot redhat dot com
- Subject: [RFA]: Fix tests return2.exp/return.exp for 68HC11/HC12
- From: Stephane Carrez <Stephane dot Carrez at worldnet dot fr>
- Date: Sun, 15 Jul 2001 11:08:05 +0200
Hi!
The 68HC11/HC12 returns the 64-bit entities in memory (long long and double).
The caller passes a hidden pointer as first argument, and the function is
supposed to put the result in the memory area.
At present, there is no way to know what is the address of the memory slot
for the return value (this problem is not related to HC11 but concerns all
targets that set RETURN_IN_MEMORY(TYPE) in GCC).
The following patch marks the tests that try to 'return' values (long long
and double) as failed for HC11, or don't execute the test for HC11.
Can you approve this patch?
Stephane
2001-07-15 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* gdb.base/return2.exp: return of long long and double fails for
68HC11; don't execute these tests on that platform.
* gdb.base/return.exp: Return of a double fails for 68hc11.
Index: gdb.base/return.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/return.exp,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 return.exp
--- return.exp 1999/04/16 01:34:31 1.1.1.1
+++ return.exp 2001/07/15 08:59:39
@@ -1,4 +1,4 @@
-# Copyright (C) 1992, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1997, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -73,6 +73,10 @@ proc return_tests { } {
gdb_test "p tmp2" ".* = 5" "correct value returned (integer test)"
gdb_test "continue" "return -5.0;" "continue to return of -5.0"
+
+ # Return of a double does not work for 68hc11 (need struct return
+ # in memory).
+ setup_xfail "m6811-*-*"
send_gdb "return 5.0\n"
gdb_expect {
-re "Make .* return now.*y or n. $" {
@@ -84,6 +88,7 @@ proc return_tests { } {
timeout { fail "(timeout) did not return (double test)" }
}
+ setup_xfail "m6811-*-*"
gdb_test "next" "printf.*" "next over call to func3"
# This test is going to fail on all i*86 systems using an i*87.
@@ -108,7 +113,7 @@ proc return_tests { } {
# process start, making this test pass, it will be for a version that
# is not xfailed.
- setup_xfail "i*86-*-*" "sparc-*-solaris2.3*" "sparc-*-solaris2.4*"
+ setup_xfail "i*86-*-*" "sparc-*-solaris2.3*" "sparc-*-solaris2.4*" "m6811-*-*"
gdb_test "p tmp3" ".* = 5.*" "correct value returned double test (known problem with i*86 and sparc solaris"
}
Index: gdb.base/return2.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/return2.exp,v
retrieving revision 1.2
diff -u -p -r1.2 return2.exp
--- return2.exp 2001/03/06 08:21:51 1.2
+++ return2.exp 2001/07/15 08:59:39
@@ -1,4 +1,4 @@
-# Copyright 2000 Free Software Foundation, Inc.
+# Copyright 2000, 2001 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -109,9 +109,13 @@ proc return2_tests { } {
return_1 "short"
return_1 "int"
return_1 "long"
- return_1 "long_long"
+ if { ! [istarget "m6811-*-*"] } then {
+ return_1 "long_long"
+ }
return_1 "float"
- return_1 "double"
+ if { ! [istarget "m6811-*-*"] } then {
+ return_1 "double"
+ }
}
# Start with a fresh gdb.