[gcc r17-2319] testsuite: Fix gcc.target/x86_64/abi tests on NetBSD

Rainer Orth via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:755885f5424c5b843e8b82c3afb4aa1a1d4a6e58

commit r17-2319-g755885f5424c5b843e8b82c3afb4aa1a1d4a6e58
Author: Rainer Orth <[email protected]>
Date:   Fri Jul 10 19:25:24 2026 +0200

    testsuite: Fix gcc.target/x86_64/abi tests on NetBSD
    
    Several of the gcc.target/x86_64/abi tests FAIL on NetBSD/amd64:
    
    FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c -mcall-ms2sysv-xlogues -O0 -g3 "-DGEN_ARGS=-p0\ --omit-rbp-clobbers" (test for excess errors)
    Excess errors:
    gcc.target/x86_64/abi/ms-sysv/ms-sysv.c:394:19: warning: array subscript has type 'char' [-Wchar-subscripts]
    
    FAIL: gcc.target/x86_64/abi/ms-sysv/ms-sysv.c  -O2 "-DGEN_ARGS=-p1" (test for ex
    cess errors)
    Excess errors:
    gcc.target/x86_64/abi/ms-sysv/ms-sysv.c:394:19: warning: array subscript has type 'char' [-Wchar-subscripts]
    gcc/ms-sysv/ms-sysv-generated.h:42:1: error: bp cannot be used in 'asm' here
    
    The first issue is fixed by casting the isspace arg to unsigned char,
    the second matches the fix for FreeBSD/amd64:
    
    commit ffc4b179a3bc254b7303d7f9ddbe3e9291851cec
    Author: Rainer Orth <[email protected]>
    Date:   Sat Apr 25 05:10:01 2026 +0200
    
        testsuite: Fix gcc.target/x86_64/abi tests on FreeBSD
    
    Tested on amd64-pc-netbsd10.1, amd64-pc-freebsd15.1, i386-pc-solaris2.11,
    and x86_64-pc-linux-gnu.
    
    2026-07-10  Rainer Orth  <[email protected]>
    
            gcc/testsuite:
            * gcc.target/x86_64/abi/ms-sysv/ms-sysv.c (long_optarg): Cast
            isspace arg to unsigned char.
            * gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp (runtest_ms_sysv): Add
            --omit-rbp-clobbers on NetBSD.

Diff:
---
 gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c   | 2 +-
 gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c
index f055b9c6fc74..7fc82b169637 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c
+++ b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.c
@@ -391,7 +391,7 @@ static long long_optarg (const char *optarg, const char *optstr)
   errno = 0;
   ret = strtol(optarg, &end, 0);
 
-  while (isspace (*end))
+  while (isspace ((unsigned char) *end))
     ++end;
 
   if (errno || *end)
diff --git a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp
index 4ff83bba1c50..752c3b5cf778 100644
--- a/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp
+++ b/gcc/testsuite/gcc.target/x86_64/abi/ms-sysv/ms-sysv.exp
@@ -80,7 +80,9 @@ proc runtest_ms_sysv { cflags generator_args } {
     # to generate bp clobbers.
     if { [regexp "(^| )-(O0|fno-omit-frame-pointer|p|pg)( |$)" \
 		 "$TEST_ALWAYS_FLAGS $cflags" match]
-	 || [istarget *-*-solaris*] || [istarget *-*-freebsd*] } then {
+	 || [istarget *-*-solaris*]
+	 || [istarget *-*-freebsd*]
+	 || [istarget *-*-netbsd*] } then {
 	set generator_args "$generator_args --omit-rbp-clobbers"
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.