[committed,testsuite] generalize enum regexp in gdb.cp/classes.exp
Commit Message
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
@@ -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 $" {