[gdb/testsuite] Fix fail in gdb.fortran/ptype-on-functions.exp with gcc-7
authorTom de Vries <tdevries@suse.de>
Tue, 6 Jul 2021 15:04:14 +0000 (17:04 +0200)
committerTom de Vries <tdevries@suse.de>
Tue, 6 Jul 2021 15:04:14 +0000 (17:04 +0200)
commit52e44e8d29bf3b3d0bef74c8b25dd21f053a9eb9
treef5cfe618363d94ea0ac0effa5c0aafa771f150b7
parent5354f52ba23dd2702e5d6ee75a886fd89a468a02
[gdb/testsuite] Fix fail in gdb.fortran/ptype-on-functions.exp with gcc-7

Since commit 05b85772061 "gdb/fortran: Add type info of formal parameter for
clang" I see:
...
(gdb) ptype say_string^M
type = void (character*(*), integer(kind=4))^M
(gdb) FAIL: gdb.fortran/ptype-on-functions.exp: ptype say_string
...

The part of the commit causing the fail is:
...
 gdb_test "ptype say_string" \
-    "type = void \\(character\\*\\(\\*\\), integer\\(kind=\\d+\\)\\)"
+    "type = void \\(character\[^,\]+, $integer8\\)"
...
which fails to take into account that for gcc-7 and before, the type for
string length of a string argument is int, not size_t.

Fix this by allowing both $integer8 and $integer4.

Tested on x86_64-linux, with gcc-7 and gcc-10.

gdb/testsuite/ChangeLog:

2021-07-06  Tom de Vries  <tdevries@suse.de>

* gdb.fortran/ptype-on-functions.exp: Allow both $integer8 and
$integer4 for size of string length.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.fortran/ptype-on-functions.exp
This page took 0.024633 seconds and 4 git commands to generate.