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 sourceware.org (Postfix) with ESMTPS id 9C2F038708F2 for ; Wed, 6 May 2020 11:50:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9C2F038708F2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tdevries@suse.de 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 4265EACD5 for ; Wed, 6 May 2020 11:50:10 +0000 (UTC) Date: Wed, 6 May 2020 13:50:05 +0200 From: Tom de Vries To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix gdb.base/store.exp with gcc-10 Message-ID: <20200506115004.GA28108@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=-20.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP 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: Wed, 06 May 2020 11:50:10 -0000 Hi, When running gdb.base/store.exp with gcc-10 instead of gcc-9, we have: ... (gdb) PASS: gdb.base/store.exp: continue to wack_double print l^M -$22 = ^M +$22 = -1^M -(gdb) UNSUPPORTED: gdb.base/store.exp: var double l; print old l, expecting -1 -(gdb) PASS: gdb.base/store.exp: var double l; print old l, expecting -1 +print r^M +$23 = ^M +(gdb) FAIL: gdb.base/store.exp: var double l; print old r, expecting -2 ... With gcc-9, there's no location info for both l and r, but with gcc-10, there's location info for l, but not r. The test-case only checks for location info availability of l, and then assumes location info for r is also available. Fix this by allowing missing location info for r. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix gdb.base/store.exp with gcc-10 gdb/testsuite/ChangeLog: 2020-05-06 Tom de Vries * gdb.base/store.exp (check_set, up_set): Allowing missing location info for r. --- gdb/testsuite/gdb.base/store.exp | 52 +++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/gdb/testsuite/gdb.base/store.exp b/gdb/testsuite/gdb.base/store.exp index 4708662bff9..f3a6c061457 100644 --- a/gdb/testsuite/gdb.base/store.exp +++ b/gdb/testsuite/gdb.base/store.exp @@ -55,26 +55,37 @@ proc check_set { t l r new add } { } } - set supported 1 + set supported_l 1 set test "${prefix}; print old l, expecting ${l}" gdb_test_multiple "print l" "$test" { - -re " = \r\n$gdb_prompt $" { + -re -wrap " = " { unsupported $test - set supported 0 + set supported_l 0 } - -re " = ${l}\r\n$gdb_prompt $" { + -re -wrap " = ${l}" { pass $test } } - if { $supported } { - gdb_test "print r" " = ${r}" \ - "${prefix}; print old r, expecting ${r}" + + set test "${prefix}; print old r, expecting ${r}" + gdb_test_multiple "print r" "$test" { + -re -wrap " = " { + unsupported $test + } + -re -wrap " = ${r}" { + pass $test + } + } + + if { $supported_l } { gdb_test_no_output "set variable l = 4" \ "${prefix}; setting l to 4" gdb_test "print l" " = ${new}" \ "${prefix}; print new l, expecting ${new}" - gdb_test "next" "return l \\+ r;" \ - "${prefix}; next over add call" + } + gdb_test "next" "return l \\+ r;" \ + "${prefix}; next over add call" + if { $supported_l } { gdb_test "print l" " = ${add}" \ "${prefix}; print incremented l, expecting ${add}" } @@ -101,20 +112,29 @@ proc up_set { t l r new } { gdb_test "up" "l = add_${t} .l, r.;" \ "${prefix}; up" - set supported 1 + set supported_l 1 set test "${prefix}; print old l, expecting ${l}" gdb_test_multiple "print l" "$test" { - -re " = \r\n$gdb_prompt $" { + -re -wrap " = " { unsupported $test - set supported 0 + set supported_l 0 } - -re " = ${l}\r\n$gdb_prompt $" { + -re -wrap " = ${l}" { pass $test } } - if { $supported } { - gdb_test "print r" " = ${r}" \ - "${prefix}; print old r, expecting ${r}" + + set test "${prefix}; print old r, expecting ${r}" + gdb_test_multiple "print r" "$test" { + -re -wrap " = " { + unsupported $test + } + -re -wrap " = ${r}" { + pass $test + } + } + + if { $supported_l } { gdb_test_no_output "set variable l = 4" \ "${prefix}; set l to 4" gdb_test "print l" " = ${new}" \