From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 95027385828A; Tue, 18 Oct 2022 13:32:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 95027385828A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666099976; bh=xG6rHYl+1ZDtyNrbUGRjT3rSrqYZEX9AUb5gpEjxdF0=; h=From:To:Subject:Date:From; b=htJr1MY7HBnz8DkMMNmwzihhprj+OJTd+5D97UbTnmD2cDYe18yDFt2lzMaHdoGLj z2WS2JRrcH7bgwGxoMhECeZ8HrWqDSJ8m0h77bwRfpxVkc7+x9SD0pK/S3WTSGtoWa gMS37QOdiIiAA13GSJsYc08XjIlxN+yrDHiLYOJ8= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.base/return-nodebug.exp with local-remote-host.exp X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: 473487c23ee1213bcba6fce37e8676eb39ab9180 X-Git-Newrev: 95dcf7dff68f1455b3576e291da60a1d949560fb Message-Id: <20221018133256.95027385828A@sourceware.org> Date: Tue, 18 Oct 2022 13:32:56 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D95dcf7dff68f= 1455b3576e291da60a1d949560fb commit 95dcf7dff68f1455b3576e291da60a1d949560fb Author: Tom de Vries Date: Tue Oct 18 15:32:46 2022 +0200 [gdb/testsuite] Fix gdb.base/return-nodebug.exp with local-remote-host.= exp =20 With host board local-remote-host.exp and test-case gdb.base/return-nodebug.exp, I run into: ... Executing on host: gcc -fno-stack-protector -fdiagnostics-color=3Dnever= \ -DTYPE=3Dsigned\ char -c -g -o return-nodebug-signed-char0.o \ /home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.base/return-node= bug.c \ (timeout =3D 300) builtin_spawn [open ...]^M gcc: error: char: No such file or directory ... =20 Avoid the quoting problem by not using spaces in the define. =20 Tested on x86_64-linux. Diff: --- gdb/testsuite/gdb.base/return-nodebug.c | 8 ++++++++ gdb/testsuite/gdb.base/return-nodebug.exp | 18 ++++++++++++------ gdb/testsuite/gdb.base/return-nodebug1.c | 8 ++++++++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/gdb.base/return-nodebug.c b/gdb/testsuite/gdb.ba= se/return-nodebug.c index a5ec060207a..358323aa2dd 100644 --- a/gdb/testsuite/gdb.base/return-nodebug.c +++ b/gdb/testsuite/gdb.base/return-nodebug.c @@ -15,6 +15,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . = */ =20 +#ifdef TYPE_NOSPACE_long_long +#define TYPE long long +#elif defined TYPE_NOSPACE_signed_char +#define TYPE signed char +#else +#define TYPE TYPE_NOSPACE +#endif + extern TYPE func (void); =20 static void diff --git a/gdb/testsuite/gdb.base/return-nodebug.exp b/gdb/testsuite/gdb.= base/return-nodebug.exp index 1cce09d2fc4..331375d89f8 100644 --- a/gdb/testsuite/gdb.base/return-nodebug.exp +++ b/gdb/testsuite/gdb.base/return-nodebug.exp @@ -52,17 +52,23 @@ foreach type {{signed char} {short} {int} {long} {long = long} {float} {double}} { if { $skip_float_test && ($type =3D=3D "float" || $type =3D=3D "double= ") } { continue } - set typeesc [string map {{ } {\ }} $type] - set typenospace [string map {{ } -} $type] + set typenospace_dash \ + [string map {{ } -} $type] + set typenospace_underscore \ + [string map {{ } _} $type] =20 standard_testfile .c return-nodebug1.c =20 - set additional_flags "additional_flags=3D-DTYPE=3D$typeesc" + set additional_flags {} + lappend additional_flags \ + additional_flags=3D-DTYPE_NOSPACE=3D$typenospace_underscore + lappend additional_flags \ + additional_flags=3D-DTYPE_NOSPACE_$typenospace_underscore =20 if {[prepare_for_testing_full "failed to prepare" \ - [list ${testfile}-${typenospace} debug \ - $srcfile [list debug $additional_flags] \ - $srcfile2 [list $additional_flags]]]} { + [list ${testfile}-${typenospace_dash} debug \ + $srcfile [concat {debug} $additional_flags] \ + $srcfile2 $additional_flags]]} { continue } =20 diff --git a/gdb/testsuite/gdb.base/return-nodebug1.c b/gdb/testsuite/gdb.b= ase/return-nodebug1.c index bd32fc45d74..f2269e0dd2f 100644 --- a/gdb/testsuite/gdb.base/return-nodebug1.c +++ b/gdb/testsuite/gdb.base/return-nodebug1.c @@ -15,6 +15,14 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . = */ =20 +#ifdef TYPE_NOSPACE_long_long +#define TYPE long long +#elif defined TYPE_NOSPACE_signed_char +#define TYPE signed char +#else +#define TYPE TYPE_NOSPACE +#endif + TYPE func (void) {