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]

[RFA] Add long long tests to ptype.exp


 
2001-09-20  Michael Snyder  <msnyder@redhat.com>

	* gdb.base/ptype.exp: Add tests for long long.

Index: ptype.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ptype.exp,v
retrieving revision 1.2
diff -c -3 -p -r1.2 ptype.exp
*** ptype.exp	2001/03/06 08:21:51	1.2
--- ptype.exp	2001/09/20 21:53:45
*************** gdb_expect {
*** 73,79 ****
  # Here and elsewhere, we accept
  # "long", "long int", or "int" for long variables (whatis.exp already
  # has an XFAIL for "int" (Sun cc bug), so no need to fail it here).
! gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\]    (unsigned |)char v_char_member;.*\[\r\n\]    (short|short int) v_short_member;.*\[\r\n\]    int v_int_member;.*\[\r\n\]    (long|long int|int) v_long_member;.*\[\r\n\]    float v_float_member;.*\[\r\n\]    double v_double_member;.*\[\r\n\]\}.*" "ptype structure" 
  
  
  # Test the equivalence between '.' and '->' for struct member references.
--- 73,79 ----
  # Here and elsewhere, we accept
  # "long", "long int", or "int" for long variables (whatis.exp already
  # has an XFAIL for "int" (Sun cc bug), so no need to fail it here).
! gdb_test "ptype struct t_struct" "type = struct t_struct \{.*\[\r\n\]    (unsigned |)char v_char_member;.*\[\r\n\]    (short|short int) v_short_member;.*\[\r\n\]    int v_int_member;.*\[\r\n\]    (long|long int|int) v_long_member;.*\[\r\n\]    (long long|long long int) v_long_long_member;.*\[\r\n\]    float v_float_member;.*\[\r\n\]    double v_double_member;.*\[\r\n\]\}.*" "ptype structure" 
  
  
  # Test the equivalence between '.' and '->' for struct member references.
*************** gdb_test "ptype struct link" "type = str
*** 100,106 ****
  #
  # test ptype command with unions
  #
! gdb_test "ptype union t_union" "type = union t_union \{.*\[\r\n\]    (unsigned |)char v_char_member;.*\[\r\n\]    (short|short int) v_short_member;.*\[\r\n\]    int v_int_member;.*\[\r\n\]    (long|long int|int) v_long_member;.*\[\r\n\]    float v_float_member;.*\[\r\n\]    double v_double_member;.*\[\r\n\]\}.*" "ptype union" 
  
  # IBM's xlc puts out bogus stabs--the stuff field is type 42,
  # which isn't defined.
--- 100,106 ----
  #
  # test ptype command with unions
  #
! gdb_test "ptype union t_union" "type = union t_union \{.*\[\r\n\]    (unsigned |)char v_char_member;.*\[\r\n\]    (short|short int) v_short_member;.*\[\r\n\]    int v_int_member;.*\[\r\n\]    (long|long int|int) v_long_member;.*\[\r\n\]    (long long|long long int) v_long_long_member;.*\[\r\n\]    float v_float_member;.*\[\r\n\]    double v_double_member;.*\[\r\n\]\}.*" "ptype union" 
  
  # IBM's xlc puts out bogus stabs--the stuff field is type 42,
  # which isn't defined.
*************** gdb_test "ptype v_int" "type = int.*" "p
*** 236,241 ****
--- 236,242 ----
  #
  #send "ptype v_long\n"
  #gdb_expect {
+ #    -re "type = long long.*$gdb_prompt $"	{ fail "ptype long" }
  #    -re "type = long.*$gdb_prompt $"	{ pass "ptype long" }
  #    -re ".*$gdb_prompt $"	{ fail "ptype long" }
  #    timeout		{ fail "(timeout) ptype long" }
*************** gdb_test "ptype v_int" "type = int.*" "p
*** 244,249 ****
--- 245,251 ----
  #
  #send "ptype v_signed_long\n"
  #gdb_expect {
+ #    -re "type = long long.*$gdb_prompt $"	{ fail "ptype signed long" }
  #    -re "type = long.*$gdb_prompt $"	{ pass "ptype signed long" }
  #    -re ".*$gdb_prompt $"	{ fail "ptype signed long" }
  #    timeout		{ fail "(timeout) ptype signed long" }
*************** gdb_test "ptype v_int" "type = int.*" "p
*** 252,260 ****
--- 254,287 ----
  #
  #send "ptype v_unsigned_long\n"
  #gdb_expect {
+ #    -re "type = unsigned long long.*$gdb_prompt $"	{ fail "ptype unsigned long" }
  #    -re "type = unsigned long.*$gdb_prompt $"	{ pass "ptype unsigned long" }
  #    -re ".*$gdb_prompt $"	{ fail "ptype unsigned long" }
  #    timeout		{ fail "(timeout) ptype unsigned long" }
+ #}
+ #
+ #
+ #send "ptype v_long_long\n"
+ #gdb_expect {
+ #    -re "type = long long.*$gdb_prompt $"	{ pass "ptype long long" }
+ #    -re ".*$gdb_prompt $"	{ fail "ptype long long" }
+ #    timeout		{ fail "(timeout) ptype long long" }
+ #}
+ #
+ #
+ #send "ptype v_signed_long_long\n"
+ #gdb_expect {
+ #    -re "type = long long.*$gdb_prompt $"	{ pass "ptype signed long long" }
+ #    -re ".*$gdb_prompt $"	{ fail "ptype signed long long" }
+ #    timeout		{ fail "(timeout) ptype signed long long" }
+ #}
+ #
+ #
+ #send "ptype v_unsigned_long\n"
+ #gdb_expect {
+ #    -re "type = unsigned long long.*$gdb_prompt $"	{ pass "ptype unsigned long long" }
+ #    -re ".*$gdb_prompt $"	{ fail "ptype unsigned long long" }
+ #    timeout		{ fail "(timeout) ptype unsigned long long" }
  #}
  #
  #
Index: ptype.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/ptype.c,v
retrieving revision 1.1.1.3
diff -c -3 -p -r1.1.1.3 ptype.c
*** ptype.c	2000/01/06 03:06:51	1.1.1.3
--- ptype.c	2001/09/20 21:53:45
*************** long		v_long;
*** 28,33 ****
--- 28,37 ----
  signed long	v_signed_long;
  unsigned long	v_unsigned_long;
  
+ long long		v_long_long;
+ signed long long	v_signed_long_long;
+ unsigned long long	v_unsigned_long_long;
+ 
  float		v_float;
  double		v_double;
  
*************** long		v_long_array[2];
*** 54,59 ****
--- 58,67 ----
  signed long	v_signed_long_array[2];
  unsigned long	v_unsigned_long_array[2];
  
+ long long		v_long_long_array[2];
+ signed long long	v_signed_long_long_array[2];
+ unsigned long long	v_unsigned_long_long_array[2];
+ 
  float		v_float_array[2];
  double		v_double_array[2];
  
*************** long		*v_long_pointer;
*** 78,83 ****
--- 86,95 ----
  signed long	*v_signed_long_pointer;
  unsigned long	*v_unsigned_long_pointer;
  
+ long long		*v_long_long_pointer;
+ signed long long	*v_signed_long_long_pointer;
+ unsigned long long	*v_unsigned_long_long_pointer;
+ 
  float		*v_float_pointer;
  double		*v_double_pointer;
  
*************** struct t_struct {
*** 88,93 ****
--- 100,106 ----
      short	v_short_member;
      int		v_int_member;
      long	v_long_member;
+     long long	v_long_long_member;
      float	v_float_member;
      double	v_double_member;
  } v_struct1;
*************** struct {
*** 99,104 ****
--- 112,118 ----
      short	v_short_member;
      int		v_int_member;
      long	v_long_member;
+     long long	v_long_long_member;
      float	v_float_member;
      double	v_double_member;
  } v_struct2;
*************** union t_union {
*** 119,124 ****
--- 133,139 ----
      short	v_short_member;
      int		v_int_member;
      long	v_long_member;
+     long long	v_long_long_member;
      float	v_float_member;
      double	v_double_member;
  } v_union;
*************** union {
*** 128,133 ****
--- 143,149 ----
      short	v_short_member;
      int		v_int_member;
      long	v_long_member;
+     long long	v_long_long_member;
      float	v_float_member;
      double	v_double_member;
  } v_union2;
*************** long		v_long_func () { return (0); }
*** 159,164 ****
--- 175,184 ----
  signed long	v_signed_long_func () { return (0); }
  unsigned long	v_unsigned_long_func () { return (0); }
  
+ long long		v_long_long_func () { return (0); }
+ signed long long	v_signed_long_long_func () { return (0); }
+ unsigned long long	v_unsigned_long_long_func () { return (0); }
+ 
  float		v_float_func () { return (0.0); }
  double		v_double_func () { return (0.0); }
  
*************** int main ()
*** 268,273 ****
--- 288,297 ----
    v_signed_long = 0;
    v_unsigned_long = 0;
  
+   v_long_long = 0;
+   v_signed_long_long = 0;
+   v_unsigned_long_long = 0;
+ 
    v_float = 0;
    v_double = 0;
  
*************** int main ()
*** 287,292 ****
--- 311,320 ----
    v_signed_long_array[0] = 0;
    v_unsigned_long_array[0] = 0;
  
+   v_long_long_array[0] = 0;
+   v_signed_long_long_array[0] = 0;
+   v_unsigned_long_long_array[0] = 0;
+ 
    v_float_array[0] = 0;
    v_double_array[0] = 0;
  
*************** int main ()
*** 305,310 ****
--- 333,342 ----
    v_long_pointer = 0;
    v_signed_long_pointer = 0;
    v_unsigned_long_pointer = 0;
+ 
+   v_long_long_pointer = 0;
+   v_signed_long_long_pointer = 0;
+   v_unsigned_long_long_pointer = 0;
  
    v_float_pointer = 0;
    v_double_pointer = 0;

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