[rfa/testsuite] ptype.exp: fix FAILs for unused types

Michael Elizabeth Chastain mec@shout.net
Wed Mar 26 18:04:00 GMT 2003


This patch fixes two FAILs in gdb.base/ptype.exp with gcc HEAD
-gdwarf-2.

  gdb.base/ptype.exp: ptype t_char_array
  gdb.base/ptype.exp: ptype func_type

gdb.base/ptype.c typedef's some types but then does not actually use
them.  Recent versions of gcc HEAD with -gdwarf-2 optimize away the type
information.  So this patch simply uses the types.

Tested on my usual testbed: native i686-pc-linux-gnu with gcc v2 and v3,
-gdward-2 and -gstabs+.  I specifically checked that it fixes the
FAILs associated with gcc HEAD.

OK to commit?

Michael C

2003-03-26  Michael Chastain  <mec@shout.net>

	* gdb.base/ptype.exp: Actually use some typedef'd types.

Index: ptype.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ptype.c,v
retrieving revision 1.2
diff -u -r1.2 ptype.c
--- ptype.c	21 Feb 2002 20:34:16 -0000	1.2
+++ ptype.c	26 Mar 2003 17:39:21 -0000
@@ -59,6 +59,7 @@
 
 /* PR 3742 */
 typedef char t_char_array[];
+t_char_array *pv_char_array;
 
 /**** pointers *******/
 
@@ -236,6 +237,8 @@
 int (*xptr) (int (*) (), int (*) (void), int);
 int (*(*ffptr) (char)) (short);
 int (*(*(*fffptr) (char)) (short)) (long);
+
+func_type v_func_type;
 
 /* Here are the sort of stabs we expect to see for the above:
 



More information about the Gdb-patches mailing list