[testsuite,committed] Allow any size enum in gdb.cp/var-tag.exp

Message ID 56034217.40408@codesourcery.com
State New, archived
Headers

Commit Message

Sandra Loosemore Sept. 24, 2015, 12:21 a.m. UTC
  I found that the C++ enum tests that allow a base type specifier in 
gdb.cp/var-tag.log were failing on arm-none-eabi.  The problem was that 
the regexp it was matching against only allowed for int type, while the 
C++ standard allows the representation to be any integer type that is 
big enough to hold all the values of the enumeration.  On ARM the AAPCS 
allows the use of types smaller than an int, and GCC defaults to 
-fshort-enums on arm-none-eabi.

I've checked in this tweak to the regexp as an obvious fix, after 
verifying that it PASSes both on arm-none-eabi and a target where it 
already used to work (nios2-linux-gnu).

-Sandra
  

Patch

diff --git a/gdb/testsuite/gdb.cp/var-tag.exp b/gdb/testsuite/gdb.cp/var-tag.exp
index 71d9237..6dc198c 100644
--- a/gdb/testsuite/gdb.cp/var-tag.exp
+++ b/gdb/testsuite/gdb.cp/var-tag.exp
@@ -30,7 +30,7 @@  proc do_global_tests {lang} {
     set invalid_print "Attempt to use a type name as an expression"
 
     if {$lang == "c++"} {
-	set opt_underlying "(: unsigned int )?"
+	set opt_underlying "(: unsigned (int|short|char) )?"
     } else {
 	set opt_underlying ""
     }