From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id gbLfJC2P8mm9ZgQAWB0awg (envelope-from ) for ; Wed, 29 Apr 2026 19:07:25 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JTjXemSC; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 93FF11E0BA; Wed, 29 Apr 2026 19:07:25 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C3C291E093 for ; Wed, 29 Apr 2026 19:07:24 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 58C1C4358A6C for ; Wed, 29 Apr 2026 23:07:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58C1C4358A6C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=JTjXemSC Received: from mail-ua1-x936.google.com (mail-ua1-x936.google.com [IPv6:2607:f8b0:4864:20::936]) by sourceware.org (Postfix) with ESMTPS id 1A4604BB58A9 for ; Wed, 29 Apr 2026 23:05:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1A4604BB58A9 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1A4604BB58A9 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::936 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777503938; cv=none; b=ReY0IRx3AmUMRVbhe5AwdltPxip1mKH1i2IBViS4lhaQ/3dDW1CVBlzz74dBr2nMKOG8NUi3cyFOY3Qssesy8K/sG+ODrXA1VH8v3tOXCUKZVEuxvzRFSRRamPt4LK9F8NLH4d2b2CMzmqw6fBhM3f4cuYTRWJd+glWqlLob7oM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777503938; c=relaxed/simple; bh=sniron1aT3HrECpDMGArjbCUoORWoEifLejXUHmq14g=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=BnqMo+OUhYo3ynR7xLZB0wGbKkp3GTfnG+iAnFPff8E47Ivsw/WC5RYrJDrQ//2/k+EpFg04AZ55N6Y9z9bBxCCOlI6M39liYAKh9+QwaKW7I65wk/A0S0zOwXxyuuLH88uoM95St+lvcQdqvfPZdLDeJv2Vpy4nnu8vh9fJTMA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A4604BB58A9 Received: by mail-ua1-x936.google.com with SMTP id a1e0cc1a2514c-9568bae58f7so191372241.3 for ; Wed, 29 Apr 2026 16:05:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1777503937; x=1778108737; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=JMIeKPOfnmuWM/xSSG0I6UyNGzZT1rARoB545Xhyt+Y=; b=JTjXemSCTZO0swm5P7oMMnqRgMRyYrwyCoLoRJTYGaUjnSiRXPrxeL2jKzuyPCBTOv 79ORF0OPSPYJjUtMhXtgO4oIfAWB3mN+7DjPqEefV78jr5cc6bWuzk2cT/dCD6+ef8zh obMvkGPZ/5GnyjtYuHazgClMiX4W6dHx9u34buwLRGNppieLHIL58IV1NpC0rpIdnd4G 0O4JvqvDOm4lhB3Z2bL0R8BVZNZfCUndgCWdcKHDQ4JeY7EzXBDz6wgUaU8wPdI9lE/0 6hI8Rs03QT5pWBIubUtdNPiRBy5JsbK/Mydb6QJFbzv33WhCDsq9dQbHe53Yhnj+oRuU 9Fgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777503937; x=1778108737; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=JMIeKPOfnmuWM/xSSG0I6UyNGzZT1rARoB545Xhyt+Y=; b=Jd6ayhUrsXMqSDigFpEpT5k2r1KNWl7sHG+VikPmx5PHae9u6txn+5EQKhPdiiXUf8 nXUqoBcn6EKuyrp0UdltL9Zni96yj/TNk732QMNWuQJyJjTC8kSDHiITb7kXws3UtjY+ IERP1E6iTCVrsMpNzN3YostlRK7fIoVsef09w+FD3DeJ4GG3l0ZgJ4D06zVbP+oHyFQP a6v67tkMDuuamulXKjdwskRRZqHdxJbllhNLvJJ1KvM4JuDQCWIDUSWaW7weOu0Ro+vY lXR4cjKZIs9q9WO/HvDQWWSs1lqV48Snhv2484vwdMNh5gJj3H5sUPQaaUgK+o/umYL4 gbTg== X-Gm-Message-State: AOJu0YwI7/zUW/w6DhMNfKnqpWtDkWKVFMdyDRfbEMST74uLLmw05PQ2 Ds1K6LJD6SuLSD82VjDXPUpzrQONr+nxDQZb94nTPraRigwEeRDfunX7XXjbYcwOLNYG6Ukt60U 7kR+q X-Gm-Gg: AeBDiev8/CeORn5gPA1lnoiHI7dv10B8X9f7gC3pxPNeDxIgXriGSJ6aR+4idZv2r96 1WEagURhLJiQElEx7E05P8GSAsJ/JrQOPyzJNTQM40EpwS0FaF4MMwTp5L8Gny1DQ1iMkEUNVZt P8pvsxzpdT/SYmfSv3fbCU1dTAv5jds+p+t6kd6BZmCxeobJj6V/SE6jh4Nzb5Uoq68TIdCjpmH FC9oz/XpGcCAJMoAqXo680D1NxSnOk5swliD4sAN8dO8To6ayLrUxLGA0SpkKesuXBgz8stRAX2 VPMFYiRuQV0/QgOFKGBiv0/NwopzHzAhXXeTSUjnkNM+WfUzbCsr0Y6m2qi7ha8QW748PAGeplF rjIyR87Ufa06DOBWkqWUmxtgmmXkYf/G+RsdpLXoCW7EkJhhGJG89/ElEspN1emKYMnP0fR4UpJ qQz3AKdQ2hUxTGFUbt7MQrRTlS7xo+cfLTpnWvTGQZKGR/ X-Received: by 2002:a05:6102:2acd:b0:612:164e:ab02 with SMTP id ada2fe7eead31-62ad1d38cb4mr324270137.5.1777503937393; Wed, 29 Apr 2026 16:05:37 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8083:f04c:42e3:5943:38f6]) by smtp.gmail.com with ESMTPSA id a1e0cc1a2514c-95cb75c4030sm1925092241.4.2026.04.29.16.05.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 16:05:36 -0700 (PDT) From: Thiago Jung Bauermann To: gdb-patches@sourceware.org Subject: [PATCH v2 17/37] GDB: testsuite: C++: Don't return value from top-level (manual) Date: Wed, 29 Apr 2026 20:04:08 -0300 Message-ID: <20260429230432.60487-18-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260429230432.60487-1-thiago.bauermann@linaro.org> References: <20260429230432.60487-1-thiago.bauermann@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org This patch manually changes "return -1" and "return 0" statements that weren't caught by the sed command. These return statements fall into one of these criteria: - misaligned line, which is then fixed by this patch; - return at top level but inside block such as save_vars, with_test_prefix, foreach, gdb_test_multiple. Some weren't changed because they didn't meet the criteria above, or weren't trivial to check. --- gdb/testsuite/gdb.cp/anon-struct.exp | 2 +- gdb/testsuite/gdb.cp/converts.exp | 2 +- gdb/testsuite/gdb.cp/cp-relocate.exp | 8 ++++---- gdb/testsuite/gdb.cp/cpsizeof.exp | 2 +- gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp | 4 ++-- gdb/testsuite/gdb.cp/fpointer.exp | 2 +- gdb/testsuite/gdb.cp/koenig.exp | 2 +- gdb/testsuite/gdb.cp/method2.exp | 2 +- gdb/testsuite/gdb.cp/nsnested.exp | 2 +- gdb/testsuite/gdb.cp/nsnoimports.exp | 2 +- gdb/testsuite/gdb.cp/oranking.exp | 2 +- gdb/testsuite/gdb.cp/pr10728.exp | 12 ++++++------ gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp | 2 +- gdb/testsuite/gdb.cp/save-bp-qualified.exp | 4 ++-- gdb/testsuite/gdb.cp/smartp.exp | 2 +- gdb/testsuite/gdb.cp/static-print-quit.exp | 2 +- 16 files changed, 26 insertions(+), 26 deletions(-) diff --git a/gdb/testsuite/gdb.cp/anon-struct.exp b/gdb/testsuite/gdb.cp/anon-struct.exp index e420d75207fd..10b7ce6c7766 100644 --- a/gdb/testsuite/gdb.cp/anon-struct.exp +++ b/gdb/testsuite/gdb.cp/anon-struct.exp @@ -18,11 +18,11 @@ # for types and functions within anonymous structures. standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } { - return -1 + return } # Clang doesn't add any names for functions within anonymous structures, # so there is no way to try and refer to them inside GDB. if {[test_compiler_info clang-*-* c++]} { diff --git a/gdb/testsuite/gdb.cp/converts.exp b/gdb/testsuite/gdb.cp/converts.exp index 7d26db9f3022..60a732f87ee0 100644 --- a/gdb/testsuite/gdb.cp/converts.exp +++ b/gdb/testsuite/gdb.cp/converts.exp @@ -14,11 +14,11 @@ # along with this program. If not, see . standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } { - return -1 + return } ############################################ if {![runto_main]} { diff --git a/gdb/testsuite/gdb.cp/cp-relocate.exp b/gdb/testsuite/gdb.cp/cp-relocate.exp index c42c67a95e75..67a9f21b9646 100644 --- a/gdb/testsuite/gdb.cp/cp-relocate.exp +++ b/gdb/testsuite/gdb.cp/cp-relocate.exp @@ -19,12 +19,12 @@ standard_testfile .cc append binfile .o require allow_cplus_tests if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {c++ debug}] != "" } { - untested "failed to compile" - return -1 + untested "failed to compile" + return } proc get_func_address { func } { global gdb_prompt hex @@ -65,11 +65,11 @@ gdb_test_multiple "info functions func<.>" "info functions" { -re "$gdb_prompt $" { if { ${func1_name} != "" && ${func2_name} != "" } { pass "info functions" } else { fail "info functions" - return -1 + return } } } # Check that all the functions have different addresses. @@ -103,11 +103,11 @@ gdb_test_multiple "info file" "info file" { -re "$gdb_prompt $" { if { ${func1_sec} != "" && ${func2_sec} != "" } { pass "info file" } else { fail "info file" - return -1 + return } } } if { $func1_sec == $func2_sec } { diff --git a/gdb/testsuite/gdb.cp/cpsizeof.exp b/gdb/testsuite/gdb.cp/cpsizeof.exp index a43ae6431acf..239811855791 100644 --- a/gdb/testsuite/gdb.cp/cpsizeof.exp +++ b/gdb/testsuite/gdb.cp/cpsizeof.exp @@ -17,11 +17,11 @@ standard_testfile .cc require allow_cplus_tests if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}] } { - return -1 + return } if {![runto_main]} { perror "could not run to main" return diff --git a/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp b/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp index 110970c89b8b..e0d34c86a11d 100644 --- a/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp +++ b/gdb/testsuite/gdb.cp/expand-psymtabs-cxx.exp @@ -17,12 +17,12 @@ standard_testfile .cc set executable ${testfile} if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {debug c++} ] != "" } { - untested "failed to compile" - return -1 + untested "failed to compile" + return } clean_restart ${executable} gdb_test_no_output "set language c++" diff --git a/gdb/testsuite/gdb.cp/fpointer.exp b/gdb/testsuite/gdb.cp/fpointer.exp index a97eef7e55b6..f4f69a0532d6 100644 --- a/gdb/testsuite/gdb.cp/fpointer.exp +++ b/gdb/testsuite/gdb.cp/fpointer.exp @@ -17,11 +17,11 @@ # complex expressions. standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } { - return -1 + return } if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.cp/koenig.exp b/gdb/testsuite/gdb.cp/koenig.exp index 474c4a95b41e..4fd755ad7b7c 100644 --- a/gdb/testsuite/gdb.cp/koenig.exp +++ b/gdb/testsuite/gdb.cp/koenig.exp @@ -20,11 +20,11 @@ lappend opts debug lappend opts c++ lappend opts additional_flags=-Wno-unused-comparison lappend opts additional_flags=-std=c++11 if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} $opts] } { - return -1 + return } ############################################ if {![runto_main]} { diff --git a/gdb/testsuite/gdb.cp/method2.exp b/gdb/testsuite/gdb.cp/method2.exp index 4eed2197c36c..e64853ab7ae8 100644 --- a/gdb/testsuite/gdb.cp/method2.exp +++ b/gdb/testsuite/gdb.cp/method2.exp @@ -21,11 +21,11 @@ require allow_cplus_tests standard_testfile .cc if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { - return -1 + return } if {![runto_main]} { return } diff --git a/gdb/testsuite/gdb.cp/nsnested.exp b/gdb/testsuite/gdb.cp/nsnested.exp index 8c1cef585a8d..11b326fa9b9c 100644 --- a/gdb/testsuite/gdb.cp/nsnested.exp +++ b/gdb/testsuite/gdb.cp/nsnested.exp @@ -14,11 +14,11 @@ # along with this program. If not, see . standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } { - return -1 + return } ############################################ if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.cp/nsnoimports.exp b/gdb/testsuite/gdb.cp/nsnoimports.exp index 3077e447c285..7c9e70ac3bf1 100644 --- a/gdb/testsuite/gdb.cp/nsnoimports.exp +++ b/gdb/testsuite/gdb.cp/nsnoimports.exp @@ -14,11 +14,11 @@ # along with this program. If not, see . standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } { - return -1 + return } ############################################ if {![runto_main]} { return diff --git a/gdb/testsuite/gdb.cp/oranking.exp b/gdb/testsuite/gdb.cp/oranking.exp index f7a2f4636227..1f418a96a7db 100644 --- a/gdb/testsuite/gdb.cp/oranking.exp +++ b/gdb/testsuite/gdb.cp/oranking.exp @@ -14,11 +14,11 @@ # along with this program. If not, see . standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } { - return -1 + return } ############################################ if {![runto_main]} { diff --git a/gdb/testsuite/gdb.cp/pr10728.exp b/gdb/testsuite/gdb.cp/pr10728.exp index 0625d243bd8f..2560325ae727 100644 --- a/gdb/testsuite/gdb.cp/pr10728.exp +++ b/gdb/testsuite/gdb.cp/pr10728.exp @@ -26,22 +26,22 @@ include_file pr10728-x.h set tfx [standard_output_file pr10728-x.o] set tfy [standard_output_file pr10728-y.o] if { [gdb_compile "${srcdir}/${subdir}/$srcfile2" "${tfy}.o" object {c++}] != "" } { - untested "failed to compile second object file" - return -1 + untested "failed to compile second object file" + return } if { [gdb_compile "${srcdir}/${subdir}/$srcfile" "${tfx}.o" object {debug c++}] != "" } { - untested "failed to compile first object file" - return -1 + untested "failed to compile first object file" + return } if { [gdb_compile "${tfx}.o ${tfy}.o" ${binfile} executable {debug c++}] != "" } { - untested "failed to compile" - return -1 + untested "failed to compile" + return } clean_restart $::testfile if {![runto_main]} { diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp b/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp index a21485e215cb..ed15018b37ff 100644 --- a/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp +++ b/gdb/testsuite/gdb.cp/rvalue-ref-sizeof.exp @@ -20,11 +20,11 @@ standard_testfile .cc require allow_cplus_tests if {[prepare_for_testing ${testfile}.exp $testfile $srcfile \ {debug c++ additional_flags="-std=gnu++11"}] } { - return -1 + return } if {![runto_main]} { perror "could not run to main" return diff --git a/gdb/testsuite/gdb.cp/save-bp-qualified.exp b/gdb/testsuite/gdb.cp/save-bp-qualified.exp index a6851ba96623..345290276628 100644 --- a/gdb/testsuite/gdb.cp/save-bp-qualified.exp +++ b/gdb/testsuite/gdb.cp/save-bp-qualified.exp @@ -36,11 +36,11 @@ proc restart {} { return 1 } with_test_prefix "save" { if {![restart]} { - return -1 + return } gdb_breakpoint "function" qualified gdb_breakpoint "function" @@ -54,11 +54,11 @@ with_test_prefix "save" { gdb_test "save breakpoint $bps" "" "save breakpoint bps" } with_test_prefix "restore" { if {![restart]} { - return -1 + return } # Restore the breakpoints. gdb_test "source $bps" "" "source bps" diff --git a/gdb/testsuite/gdb.cp/smartp.exp b/gdb/testsuite/gdb.cp/smartp.exp index 8a79f4385a9c..4c04a465e475 100644 --- a/gdb/testsuite/gdb.cp/smartp.exp +++ b/gdb/testsuite/gdb.cp/smartp.exp @@ -14,11 +14,11 @@ # along with this program. If not, see . standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug c++}] } { - return -1 + return } ############################################ if {![runto_main]} { diff --git a/gdb/testsuite/gdb.cp/static-print-quit.exp b/gdb/testsuite/gdb.cp/static-print-quit.exp index 19756f64732e..58f4f5283b30 100644 --- a/gdb/testsuite/gdb.cp/static-print-quit.exp +++ b/gdb/testsuite/gdb.cp/static-print-quit.exp @@ -32,11 +32,11 @@ gdb_test_multiple "print c" "" { pass $gdb_test_name } -re "\r\n$pagination_prompt$" { # gdb-7.1 did not crash with this testcase but it had the same bug. untested "bug does not reproduce" - return 0 + return } } gdb_test "q" ".*"