From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uPbgJInvVWGIXQAAWB0awg (envelope-from ) for ; Thu, 30 Sep 2021 13:10:33 -0400 Received: by simark.ca (Postfix, from userid 112) id 951571EE28; Thu, 30 Sep 2021 13:10:33 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 070891EDF7 for ; Thu, 30 Sep 2021 13:10:33 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AB0AA3857C47 for ; Thu, 30 Sep 2021 17:10:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AB0AA3857C47 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633021832; bh=MgKX8Y6104LQFHZVTjTS66FOGQJKn8eyY24UiHKVpII=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=vNwXZUH0nvBUG+OGpKyl/ezz0neolOyFZWLgjzP4tM1EfSd56W6/ICPGCJC8nlTbn pmuPLSjCnyPbJkWJZsy3ymvlERSgb+qUP7P5nNbHMI5tXlnpCQ5rGJWENLW77pkW5Y 5X5KDJVRkfR/xjx+XL1DDegXl4nYDprhR28ybceo= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 61BB93857C58 for ; Thu, 30 Sep 2021 17:09:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 61BB93857C58 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 9CC6A20048 for ; Thu, 30 Sep 2021 17:09:36 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 89F5913AF5 for ; Thu, 30 Sep 2021 17:09:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id z+eiIFDvVWEdWwAAMHmgww (envelope-from ) for ; Thu, 30 Sep 2021 17:09:36 +0000 Date: Thu, 30 Sep 2021 19:09:35 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Prepare nodebug exec in gdb.base/cvexpr.exp Message-ID: <20210930170932.GA25085@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-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: , From: Tom de Vries via Gdb-patches Reply-To: Tom de Vries Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Hi, When running test-case gdb.base/cvexpr.exp with target board unix/-bad, I get: ... gdb compile failed, gcc: error: unrecognized command line option '-bad' ERROR: tcl error sourcing src/gdb/testsuite/gdb.base/cvexpr.exp. ERROR: can't read "use_gdb_stub": no such variable ... This is triggered in a part of the test that claims to require no debug information, but uses the exec containing either dwarf or ctf. Fix this by preparing another executable compiled with nodebug, and using that one instead. Also use with_test_prefix to mark the nodebug part, such that we have: ... gdb compile failed, gcc: error: unrecognized command line option '-bad' UNTESTED: gdb.base/cvexpr.exp: dwarf: failed to prepare gdb compile failed, gcc: error: unrecognized command line option '-bad' UNTESTED: gdb.base/cvexpr.exp: nodebug: failed to prepare ... Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Prepare nodebug exec in gdb.base/cvexpr.exp --- gdb/testsuite/gdb.base/cvexpr.exp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/gdb/testsuite/gdb.base/cvexpr.exp b/gdb/testsuite/gdb.base/cvexpr.exp index 33ae1be0322..f9bb467b4f7 100644 --- a/gdb/testsuite/gdb.base/cvexpr.exp +++ b/gdb/testsuite/gdb.base/cvexpr.exp @@ -509,14 +509,20 @@ foreach testspec $specs { } # These tests don't rely on the debug format. -gdb_test "ptype _Atomic int" "type = _Atomic int" -gdb_test "ptype int * restrict" "type = int \\* restrict" +with_test_prefix nodebug { + if { [prepare_for_testing "failed to prepare" $binfile $srcfile {nodebug}] } { + return 0 + } -# C++ does not have "restrict". -gdb_test_no_output "set lang c++" -with_test_prefix c++ { - gdb_test "ptype int * restrict" "A syntax error in expression.*" + gdb_test "ptype _Atomic int" "type = _Atomic int" + gdb_test "ptype int * restrict" "type = int \\* restrict" - # There is a GCC extension for __restrict__, though. - gdb_test "ptype int * __restrict__" "type = int \\* __restrict__" + # C++ does not have "restrict". + gdb_test_no_output "set lang c++" + with_test_prefix c++ { + gdb_test "ptype int * restrict" "A syntax error in expression.*" + + # There is a GCC extension for __restrict__, though. + gdb_test "ptype int * __restrict__" "type = int \\* __restrict__" + } }