From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14834 invoked by alias); 14 Jun 2003 22:08:00 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 14536 invoked from network); 14 Jun 2003 22:07:56 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 14 Jun 2003 22:07:56 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id E1C872B5F for ; Sat, 14 Jun 2003 18:07:50 -0400 (EDT) Message-ID: <3EEB9CB6.4070001@redhat.com> Date: Sat, 14 Jun 2003 22:08:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: [commit] ramp up store.exp Content-Type: multipart/mixed; boundary="------------080900010207000500030205" X-SW-Source: 2003-06/txt/msg00498.txt.bz2 This is a multi-part message in MIME format. --------------080900010207000500030205 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1189 Hello, The attached ramps up the store.exp test by encouraging the compiler to use more registers. For the d10v, I get just one failure: > FAIL: gdb.base/store.exp: up print old r - longest However, for the i386, I see: > FAIL: gdb.base/store.exp: print old r - longest > FAIL: gdb.base/store.exp: print old r - double > FAIL: gdb.base/store.exp: print old r - doublest > FAIL: gdb.base/store.exp: up print old r - int > FAIL: gdb.base/store.exp: up print old r - long > FAIL: gdb.base/store.exp: up print old r - longest > FAIL: gdb.base/store.exp: up print old r - double > FAIL: gdb.base/store.exp: up print old r - doublest (outch) before, and: FAIL: gdb.base/store.exp: print old r - doublest FAIL: gdb.base/store.exp: up print old r - int FAIL: gdb.base/store.exp: up print old r - long FAIL: gdb.base/store.exp: up print old r - longest FAIL: gdb.base/store.exp: up print old r - doublest after the register_to_value patch is applied. I guess there'll be some more fixing. People might want to anticipate a jump in failures as this appears to be pushing GDB's boundaries :-(. KFAIL away. Committed, I'll commit the bulk of the register_to_value fix in a tick, Andrew --------------080900010207000500030205 Content-Type: text/plain; name="diffs" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diffs" Content-length: 6677 2003-06-14 Andrew Cagney * gdb.base/store.exp: Test longest and doublest. Test all parameters. Weaken return statement match. * gdb.base/store.c: Add longest and doublest - aka long long and long double functions. Put all parameters into local register variables. Use negative values. Index: gdb.base/store.c =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/store.c,v retrieving revision 1.2 diff -u -r1.2 store.c --- gdb.base/store.c 6 Dec 2002 19:21:51 -0000 1.2 +++ gdb.base/store.c 14 Jun 2003 21:55:54 -0000 @@ -31,6 +31,14 @@ return u + v; } +typedef long long longest; + +longest +add_longest (register longest u, register longest v) +{ + return u + v; +} + float add_float (register float u, register float v) { @@ -43,56 +51,82 @@ return u + v; } +typedef long double doublest; + +doublest +add_doublest (register doublest u, register doublest v) +{ + return u + v; +} + /* */ char wack_char (register char u, register char v) { - register char l = u; - l = add_char (l, v); + register char l = u, r = v; + l = add_char (l, r); return l; } short wack_short (register short u, register short v) { - register short l = u; - l = add_short (l, v); + register short l = u, r = v; + l = add_short (l, r); return l; } int wack_int (register int u, register int v) { - register int l = u; - l = add_int (l, v); + register int l = u, r = v; + l = add_int (l, r); return l; } long wack_long (register long u, register long v) { - register long l = u; - l = add_long (l, v); + register long l = u, r = v; + l = add_long (l, r); + return l; +} + +long +wack_longest (register longest u, register longest v) +{ + register longest l = u, r = v; + l = add_longest (l, r); return l; } float wack_float (register float u, register float v) { - register float l = u; - l = add_float (l, v); + register float l = u, r = v; + l = add_float (l, r); return l; } double wack_double (register double u, register double v) { - register double l = u; - l = add_double (l, v); + register double l = u, r = v; + l = add_double (l, r); + return l; +} + +doublest +wack_doublest (register doublest u, register doublest v) +{ + register doublest l = u, r = v; + l = add_doublest (l, r); return l; } +/* */ + struct s_1 { short s[1]; } z_1, s_1; struct s_2 { short s[2]; } z_2, s_2; struct s_3 { short s[3]; } z_3, s_3; @@ -219,20 +253,24 @@ main () { /* These calls are for current frame test. */ - wack_char (1, 2); - wack_short (1, 2); - wack_int (1, 2); - wack_long (1, 2); - wack_float (1, 2); - wack_double (1, 2); + wack_char (-1, -2); + wack_short (-1, -2); + wack_int (-1, -2); + wack_long (-1, -2); + wack_longest (-1, -2); + wack_float (-1, -2); + wack_double (-1, -2); + wack_doublest (-1, -2); /* These calls are for up frame. */ - wack_char (1, 2); - wack_short (1, 2); - wack_int (1, 2); - wack_long (1, 2); - wack_float (1, 2); - wack_double (1, 2); + wack_char (-1, -2); + wack_short (-1, -2); + wack_int (-1, -2); + wack_long (-1, -2); + wack_longest (-1, -2); + wack_float (-1, -2); + wack_double (-1, -2); + wack_doublest (-1, -2); /* These calls are for current frame test. */ wack_struct_1 (); Index: gdb.base/store.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/store.exp,v retrieving revision 1.2 diff -u -r1.2 store.exp --- gdb.base/store.exp 4 Jan 2003 03:59:27 -0000 1.2 +++ gdb.base/store.exp 14 Jun 2003 21:55:54 -0000 @@ -54,43 +54,49 @@ # -proc check_set { t old new add } { +proc check_set { t l r new add } { global gdb_prompt gdb_test "tbreak wack_${t}" - gdb_test "continue" "register ${t} l = u;" "continue set ${t}" - gdb_test "next" "l = add_${t} .l, v.;" "next ${t}" - gdb_test "print l" " = ${old}" "print old ${t}" + gdb_test "continue" "register ${t} l = u, r = v;" "continue to wack_${t}" + gdb_test "next" "l = add_${t} .l, r.;" "next ${t}" + gdb_test "print l" " = ${l}" "print old l - ${t}" + gdb_test "print r" " = ${r}" "print old r - ${t}" gdb_test "set variable l = 4" - gdb_test "print l" " = ${new}" "print new ${t}" + gdb_test "print l" " = ${new}" "print new l - ${t}" gdb_test "next" "return l;" - gdb_test "print l" " = ${add}" "print add ${t}" + gdb_test "print l" " = ${add}" "print add - ${t}" } -check_set "char" "1 ..001." "4 ..004." "6 ..006." -check_set "short" "1" "4" "6" -check_set "int" "1" "4" "6" -check_set "long" "1" "4" "6" -check_set "float" "1" "4" "6" -check_set "double" "1" "4" "6" +check_set "char" "-1 .*" "-2 .*" "4 ..004." "2 ..002." +check_set "short" "-1" "-2" "4" "2" +check_set "int" "-1" "-2" "4" "2" +check_set "long" "-1" "-2" "4" "2" +check_set "longest" "-1" "-2" "4" "2" +check_set "float" "-1" "-2" "4" "2" +check_set "double" "-1" "-2" "4" "2" +check_set "doublest" "-1" "-2" "4" "2" # -proc up_set { t old new } { +proc up_set { t l r new } { global gdb_prompt gdb_test "tbreak add_${t}" - gdb_test "continue" "return u . v;" "continue up ${t}" - gdb_test "up" "l = add_${t} .l, v.;" "up ${t}" - gdb_test "print l" " = ${old}" "print old up ${t}" + gdb_test "continue" "return u . v;" "continue to add_${t}" + gdb_test "up" "l = add_${t} .l, r.;" "up ${t}" + gdb_test "print l" " = ${l}" "up print old l - ${t}" + gdb_test "print r" " = ${r}" "up print old r - ${t}" gdb_test "set variable l = 4" - gdb_test "print l" " = ${new}" "print new up ${t}" + gdb_test "print l" " = ${new}" "up print new l - ${t}" } -up_set "char" "1 ..001." "4 ..004." -up_set "short" "1" "4" -up_set "int" "1" "4" -up_set "long" "1" "4" -up_set "float" "1" "4" -up_set "double" "1" "4" +up_set "char" "-1 .*" "-2 .*" "4 ..004." +up_set "short" "-1" "-2" "4" +up_set "int" "-1" "-2" "4" +up_set "long" "-1" "-2" "4" +up_set "longest" "-1" "-2" "4" +up_set "float" "-1" "-2" "4" +up_set "double" "-1" "-2" "4" +up_set "doublest" "-1" "-2" "4" # @@ -133,7 +139,11 @@ gdb_test "tbreak wack_field_${t}" gdb_test "continue" "register struct f_${t} u = f_${t};" \ "continue field ${t}" - gdb_test "next" "return u;" "next field ${t}" + + # Match either the return statement, or the line immediatly after + # it. The compiler can end up merging the return statement into + # the return instruction. + gdb_test "next" "(return u;|\})" "next field ${t}" gdb_test "print u" " = {i = 1, j = 1, k = 1}" "old field ${t}" gdb_test "set variable u = F_${t}" --------------080900010207000500030205--