This is the mail archive of the gdb-cvs@sourceware.org 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]

[binutils-gdb] Reapply fix for gdb.cp/var-tag.exp C++ failures.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4bc4d42859e3b42c79c89295ef39944bdb3e6753

commit 4bc4d42859e3b42c79c89295ef39944bdb3e6753
Author: Sandra Loosemore <sandra@codesourcery.com>
Date:   Thu Jul 30 11:52:49 2015 -0700

    Reapply fix for gdb.cp/var-tag.exp C++ failures.
    
    2015-07-30  Sandra Loosemore  <sandra@codesourcery.com>
    
    	gdb/testsuite/
    
    	Reapply:
    	2014-05-21  Mark Wielaard  <mjw@redhat.com>
    
    	* gdb.cp/var-tag.exp (do_global_tests): Handle underlying type.

Diff:
---
 gdb/testsuite/ChangeLog          |  7 +++++++
 gdb/testsuite/gdb.cp/var-tag.exp | 11 ++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index eda6625..6c836b6 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2015-07-30  Sandra Loosemore  <sandra@codesourcery.com>
+
+	Reapply:
+	2014-05-21  Mark Wielaard  <mjw@redhat.com>
+
+	* gdb.cp/var-tag.exp (do_global_tests): Handle underlying type.
+
 2015-07-30  Pedro Alves  <palves@redhat.com>
 
 	* linux-low.c (handle_extended_wait): Set the child's last
diff --git a/gdb/testsuite/gdb.cp/var-tag.exp b/gdb/testsuite/gdb.cp/var-tag.exp
index 30aab99..60379e9 100644
--- a/gdb/testsuite/gdb.cp/var-tag.exp
+++ b/gdb/testsuite/gdb.cp/var-tag.exp
@@ -28,13 +28,18 @@ if {[prepare_for_testing $testfile.exp $testfile \
 
 proc do_global_tests {lang} {
     set invalid_print "Attempt to use a type name as an expression"
-    set ptypefmt "type = (class|enum|union|struct) %s {.*}"
+
+    if {$lang == "c++"} {
+	set opt_underlying "(: unsigned int )?"
+    } else {
+	set opt_underlying ""
+    set ptypefmt "type = (class|enum|union|struct) %s $opt_underlying{.*}"
 
     with_test_prefix $lang {
     gdb_test_no_output "set language $lang"
     gdb_test "ptype C" "type = class C {.*}"
     gdb_test "print E" "= a"
-    gdb_test "ptype E" "type = enum E {.*}"
+    gdb_test "ptype E" "type = enum E $opt_underlying{.*}"
     gdb_test "print S" "= {<No data fields>}"
     gdb_test "ptype S" "type = struct S {.*}"
     gdb_test "print U" "= {.*}"
@@ -48,7 +53,7 @@ proc do_global_tests {lang} {
     gdb_test "print SS" [format $invalid_print "SS"]
     gdb_test "ptype SS" [format $ptypefmt "SS"]
     gdb_test "print ee" "= .*"
-    gdb_test "ptype ee" "type = enum EE {.*}"
+    gdb_test "ptype ee" "type = enum EE $opt_underlying{.*}"
     gdb_test "print EE" [format $invalid_print "EE"]
     gdb_test "ptype EE" [format $ptypefmt "EE"]
     gdb_test "print uu" "= {.*}"


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