This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] ramp up store.exp


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
2003-06-14  Andrew Cagney  <cagney@redhat.com>

	* 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}"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]