This is the mail archive of the gdb-patches@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]

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


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

2015-09-23 Sandra Loosemore <sandra@codesourcery.com>

	gdb/testsuite/
	* gdb.cp/var-tag.exp (do_global_tests): Generalize opt_underlying
	to allow any size enum.
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 ""
     }

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