Add a new type:var variant to the guality.exp testsuite to check that gdb gets the correct type for a variable or function. To use it in a guality test add something like:
/* { dg-final { gdb-test 50 "type:main" "int (int, char **)" } } */
Which will put a breakpoint at line 50 and check that the type of "main" equals "int (int, char **)" according to gdb. The test harness will make sure to squash all extra whitespace/newlines that gdb might use to make comparisons of large structs easy.
gcc/testsuite/ChangeLog
- lib/gcc-gdb-test.exp (gdb-test): Handle type:var for gdb ptype matching. Catch '
5ea3273 Add guality [p]type test.
gcc/testsuite/ChangeLog | 6 ++
gcc/testsuite/gcc.dg/guality/const-volatile.c | 83 +++++++++++++++++++++++++
gcc/testsuite/lib/gcc-gdb-test.exp | 47 ++++++++++++--
3 files changed, 132 insertions(+), 4 deletions(-)
Upstream: gcc.gnu.org