From 3a63e3f9b9fa675e1718de5a463fdd1eb72b863d Mon Sep 17 00:00:00 2001 From: Michael Chastain Date: Mon, 8 Apr 2002 22:43:15 +0000 Subject: [PATCH] 2002-04-08 Michael Chastain * 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 | 6 ++++++ gdb/testsuite/gdb.c++/method.exp | 26 +++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f398f09deb9..1c854f2d814 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2002-04-08 Michael Chastain + + * 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 * gdb.c++/method.exp: Use gdb_test instead of send_gdb/gdb_expect. diff --git a/gdb/testsuite/gdb.c++/method.exp b/gdb/testsuite/gdb.c++/method.exp index 2ab4e8fd36c..3ca5cc1b435 100644 --- a/gdb/testsuite/gdb.c++/method.exp +++ b/gdb/testsuite/gdb.c++/method.exp @@ -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 -- 2.30.2