2002-04-08 Michael Chastain <mec@shout.net>
authorMichael Chastain <mec@google.com>
Mon, 8 Apr 2002 22:43:15 +0000 (22:43 +0000)
committerMichael Chastain <mec@google.com>
Mon, 8 Apr 2002 22:43:15 +0000 (22:43 +0000)
* gdb.c++/method.exp: Require "const ... A * ..." for "ptype this"
in a const method.  Add some xfail and fail cases for configurations
that do not emit the "const ...".

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.c++/method.exp

index f398f09deb9664b399c320343cee4a678bc6ffff..1c854f2d8147a7f7c36d79f05f53323dfc316e0c 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-08  Michael Chastain  <mec@shout.net>
+
+       * gdb.c++/method.exp: Require "const ... A * ..." for "ptype this"
+       in a const method.  Add some xfail and fail cases for configurations
+       that do not emit the "const ...".
+
 2002-04-07  Michael Chastain  <mec@shout.net>
 
        * gdb.c++/method.exp: Use gdb_test instead of send_gdb/gdb_expect.
index 2ab4e8fd36cad44419259679702fee8f9fa6542a..3ca5cc1b435035fa81e8465b1156573b7ee858a1 100644 (file)
@@ -107,9 +107,29 @@ gdb_test "print x" \
 
 # Check access to this pointer       
 
-gdb_test "print this" \
-  "\\$\[0-9\]* = \\((const |)(class |)A *\\* *(const|)\\) $hex" \
-  "print this in A::bar"
+get_debug_format
+
+send_gdb "print this\n"
+gdb_expect {
+  -re "\\$\[0-9\]* = \\(const (class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+    pass "print this in A::bar"
+  }
+  -re "\\$\[0-9\]* = \\((class |)A *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+    # gcc versions up to 3.0.4 with -gstabs+ do not emit "const" indicators,
+    # so the output is "A *".  It should be "const A *" or "const A * const".
+    setup_xfail_format "stabs"
+    fail "print this in A::bar (missing const)"
+  }
+  -re "\\$\[0-9\]* = \\(const (class |)\{\\.\\.\\.\} *\\* *(const|)\\) $hex\r\n$gdb_prompt $" {
+    # gcc versions gcc-3_1-branch%20020404 and HEAD%20020404 with -gstabs+
+    # produce good stabs, but gdb prints "const class {...} *" const.
+    # This is PR gdb/277.
+    # setup_kfail "gnats:gdb/277"
+    fail "print this in A::bar (gnats:gdb/277)"
+  }
+  -re ".*$gdb_prompt $" { fail "print this in A::bar" }
+  timeout { fail "(timeout) print this in A::bar" }
+}
 
 # Check again with funk::getFunky (this is the original test case
 # for CHFts23426); sometimes having a constructor with no arguments
This page took 0.031295 seconds and 4 git commands to generate.