[gdb/testsuite] Fix gdb.fortran/ptype-on-functions.exp with gcc-4.8
authorTom de Vries <tdevries@suse.de>
Thu, 30 Jul 2020 10:35:57 +0000 (12:35 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 30 Jul 2020 10:35:57 +0000 (12:35 +0200)
When running test-case gdb.fortran/ptype-on-functions.exp with gfortran 4.8.5,
we run into:
...
(gdb) ptype some_module::get_number^M
type = integer(kind=4) (Type __class_some_module_Number)^M
(gdb) FAIL: gdb.fortran/ptype-on-functions.exp: ptype some_module::get_number
ptype some_module::set_number^M
type = void (Type __class_some_module_Number, integer(kind=4))^M
(gdb) FAIL: gdb.fortran/ptype-on-functions.exp: ptype some_module::set_number
...

The test-case pattern expects a "_t" suffix on "__class_some_module_Number".

The difference is caused by a gcc commit 073afca6884 'class.c
(gfc_build_class_symbol): Append "_t" to target class names to make the
generated type names unique' which has been present since gcc 4.9.0.

Fix the pattern by optionally matching the _t suffix.

Tested on x86_64-linux, with gfortran 4.8.5 and 7.5.0.

gdb/testsuite/ChangeLog:

2020-07-30  Tom de Vries  <tdevries@suse.de>

* gdb.fortran/ptype-on-functions.exp: Make "_t" suffix on
"__class_some_module_Number_t" optional.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/ptype-on-functions.exp

index 656e59d54b4bdad5a64b0f05cda69c0e25a2bd60..ef7a9387efd828424dba5fb963870b8aec567b2b 100644 (file)
@@ -1,3 +1,8 @@
+2020-07-30  Tom de Vries  <tdevries@suse.de>
+
+       * gdb.fortran/ptype-on-functions.exp: Make "_t" suffix on
+       "__class_some_module_Number_t" optional.
+
 2020-07-29  Tom de Vries  <tdevries@suse.de>
 
        * lib/selftest-support.exp (selftest_setup): Allow breakpoint at
index 9d447530c264b8a64f8345f2a1a796809571beb4..93e984af2437533384e3e86f61c3c0e8163c4fef 100644 (file)
@@ -30,10 +30,10 @@ if ![fortran_runto_main] then {
 }
 
 gdb_test "ptype some_module::get_number" \
-    "type = integer\\(kind=4\\) \\(Type __class_some_module_Number_t\\)"
+    "type = integer\\(kind=4\\) \\(Type __class_some_module_Number(_t)?\\)"
 
 gdb_test "ptype some_module::set_number" \
-    "type = void \\(Type __class_some_module_Number_t, integer\\(kind=4\\)\\)"
+    "type = void \\(Type __class_some_module_Number(_t)?, integer\\(kind=4\\)\\)"
 
 gdb_test "ptype is_bigger" \
     "type = logical\\(kind=4\\) \\(integer\\(kind=4\\), integer\\(kind=4\\)\\)"