From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by server2.sourceware.org (Postfix) with ESMTPS id CB68B3940CE8 for ; Sat, 7 Mar 2020 21:46:43 +0000 (GMT) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C2CC5AD89 for ; Sat, 7 Mar 2020 21:46:42 +0000 (UTC) Date: Sat, 7 Mar 2020 22:46:40 +0100 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix testing build_executable result Message-ID: <20200307214639.GA16959@delia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2020 21:46:44 -0000 Hi, When running with target board unix/-feliminate-dwarf2-dups, we run into these FAILs: ... FAIL: gdb.cp/rvalue-ref-params.exp: print value of f1 on Child&& in f2 FAIL: gdb.cp/ref-params.exp: print value of f1 on Child in main FAIL: gdb.cp/ref-params.exp: print value of f2 on Child in main FAIL: gdb.cp/ref-params.exp: print value of f1 on Child& in f2 FAIL: gdb.cp/ref-params.exp: print mf1(MQ) FAIL: gdb.cp/ref-params.exp: print mf2(MQ) FAIL: gdb.cp/ref-params.exp: print f1(MQR) FAIL: gdb.cp/ref-params.exp: print mf1(MQR) FAIL: gdb.cp/ref-params.exp: print mf2(MQR) ... This is due to comparing the result of build_executable to 1, while build_executable returns either 0 for success, or -1 for failure. Fix this by comparing with -1 instead. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix testing build_executable result gdb/testsuite/ChangeLog: 2020-03-07 Tom de Vries * gdb.cp/ref-params.exp: Compare build_executable result with -1. * gdb.cp/rvalue-ref-params.exp: Same. --- gdb/testsuite/gdb.cp/ref-params.exp | 2 +- gdb/testsuite/gdb.cp/rvalue-ref-params.exp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.cp/ref-params.exp b/gdb/testsuite/gdb.cp/ref-params.exp index 2b45ee7fc8..2b00501706 100644 --- a/gdb/testsuite/gdb.cp/ref-params.exp +++ b/gdb/testsuite/gdb.cp/ref-params.exp @@ -24,7 +24,7 @@ if { [skip_cplus_tests] } { continue } standard_testfile .cc -if {[build_executable $testfile.exp $testfile $srcfile {debug c++}] == 1} { +if {[build_executable $testfile.exp $testfile $srcfile {debug c++}] == -1} { return -1 } diff --git a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp index e1c54aa40a..fec4b6fadd 100644 --- a/gdb/testsuite/gdb.cp/rvalue-ref-params.exp +++ b/gdb/testsuite/gdb.cp/rvalue-ref-params.exp @@ -21,7 +21,7 @@ if {[skip_cplus_tests]} { continue } standard_testfile .cc if {[prepare_for_testing $testfile.exp $testfile $srcfile \ - {debug c++ additional_flags="-std=gnu++11"}] == 1} { + {debug c++ additional_flags="-std=gnu++11"}] == -1} { return -1 }