This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[testsuite, committed] Allow any size enum in gdb.cp/var-tag.exp
- From: Sandra Loosemore <sandra at codesourcery dot com>
- To: gdb-patches <gdb-patches at sourceware dot org>
- Date: Wed, 23 Sep 2015 18:21:43 -0600
- Subject: [testsuite, committed] Allow any size enum in gdb.cp/var-tag.exp
- Authentication-results: sourceware.org; auth=none
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 ""
}