[committed,testsuite] generalize enum regexp in gdb.cp/classes.exp

Message ID 5604A368.8090905@codesourcery.com
State New, archived
Headers

Commit Message

Sandra Loosemore Sept. 25, 2015, 1:29 a.m. UTC
  This patch is very similar to the patch I pushed yesterday for 
gdb.cp/var-tag.exp:

https://sourceware.org/ml/gdb-patches/2015-09/msg00555.html

I found another instance in gdb.cp/classes.exp where the regexp had a 
hard-coded assumption that enum types are int-sized.  This patch fixes 
the failure on arm-none-eabi, where GCC defaults to -fshort-enums as 
permitted by both the C++ standard and the AAPCS.  I've checked it in as 
obvious after verifying it works.

-Sandra
  

Patch

diff --git a/gdb/testsuite/gdb.cp/classes.exp b/gdb/testsuite/gdb.cp/classes.exp
index 1d714d3..00f16fc 100644
--- a/gdb/testsuite/gdb.cp/classes.exp
+++ b/gdb/testsuite/gdb.cp/classes.exp
@@ -419,7 +419,7 @@  proc test_enums {} {
     # ptype on the enum member
 
     gdb_test_multiple "ptype obj_with_enum.priv_enum" "ptype obj_with_enum.priv_enum" {
-        -re "type = enum ClassWithEnum::PrivEnum (: unsigned int )?\{ ?(ClassWithEnum::)?red, (ClassWithEnum::)?green, (ClassWithEnum::)?blue, (ClassWithEnum::)?yellow = 42 ?\}$nl$gdb_prompt $" {
+        -re "type = enum ClassWithEnum::PrivEnum (: unsigned (int|short|char) )?\{ ?(ClassWithEnum::)?red, (ClassWithEnum::)?green, (ClassWithEnum::)?blue, (ClassWithEnum::)?yellow = 42 ?\}$nl$gdb_prompt $" {
 	    pass "ptype obj_with_enum.priv_enum"
         }
 	-re "type = enum PrivEnum \{ ?(ClassWithEnum::)?red, (ClassWithEnum::)?green, (ClassWithEnum::)?blue, (ClassWithEnum::)?yellow = 42 ?\}$nl$gdb_prompt $" {