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  <christina.schimpe@intel.com>

	* gdb.cp/ptype-cv-cp.cc: New const and volatile typedef
	  variables.
	* gdb.cp/ptype-cv-cp.exp: Add new tests.
This commit is contained in:
Christina Schimpe 2021-11-16 10:58:11 +01:00 committed by Andrew Burgess
parent 999a4952a2
commit 5ee59b4bf2
2 changed files with 16 additions and 0 deletions

View File

@ -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 ()

View File

@ -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"