From: Christina Schimpe Date: Tue, 16 Nov 2021 09:58:11 +0000 (+0100) Subject: gdb/testsuite: Extend tests for print of cv qualifiers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5ee59b4bf20b9109064fda706503628b3e4b2d7a;p=binutils-gdb.git gdb/testsuite: Extend tests for print of cv qualifiers This commit supplements whatis and ptype command tests for print of const-volatile qualifiers. gdb/testsuite/ChangeLog: 2021-11-16 Christina Schimpe * gdb.cp/ptype-cv-cp.cc: New const and volatile typedef variables. * gdb.cp/ptype-cv-cp.exp: Add new tests. --- diff --git a/gdb/testsuite/gdb.cp/ptype-cv-cp.cc b/gdb/testsuite/gdb.cp/ptype-cv-cp.cc index 9560dfa80b6..27dc2f1b33c 100644 --- a/gdb/testsuite/gdb.cp/ptype-cv-cp.cc +++ b/gdb/testsuite/gdb.cp/ptype-cv-cp.cc @@ -26,6 +26,10 @@ __attribute__((used)) const_my_int v_const_my_int (1); volatile_my_int v_volatile_my_int (2); const_volatile_my_int v_const_volatile_my_int (3); volatile_const_my_int v_volatile_const_my_int (4); +__attribute__((used)) const my_int v2_const_my_int (5); +volatile my_int v2_volatile_my_int (6); +const volatile my_int v2_const_volatile_my_int (7); +volatile const my_int v2_volatile_const_my_int (8); int main () diff --git a/gdb/testsuite/gdb.cp/ptype-cv-cp.exp b/gdb/testsuite/gdb.cp/ptype-cv-cp.exp index b3574cbd34e..5518a4e30e6 100644 --- a/gdb/testsuite/gdb.cp/ptype-cv-cp.exp +++ b/gdb/testsuite/gdb.cp/ptype-cv-cp.exp @@ -41,3 +41,15 @@ if {[test_compiler_info {gcc-[0-3]-*}] setup_xfail "gcc/45997" "*-*-*" } gdb_test "ptype v_volatile_const_my_int" "type = const volatile int" + +gdb_test "ptype v2_const_my_int" "type = const int" +gdb_test "whatis v2_const_my_int" "type = const my_int" + +gdb_test "ptype v2_volatile_my_int" "type = volatile int" +gdb_test "whatis v2_volatile_my_int" "type = volatile my_int" + +gdb_test "ptype v2_const_volatile_my_int" "type = const volatile int" +gdb_test "whatis v2_const_volatile_my_int" "type = const volatile my_int" + +gdb_test "ptype v2_volatile_const_my_int" "type = const volatile int" +gdb_test "whatis v2_volatile_const_my_int" "type = const volatile my_int"