From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id HX2YCVvsomISGgEAWB0awg (envelope-from ) for ; Fri, 10 Jun 2022 03:01:47 -0400 Received: by simark.ca (Postfix, from userid 112) id 11BFE1E223; Fri, 10 Jun 2022 03:01:47 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=Xc2SpJef; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.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 911A71E143 for ; Fri, 10 Jun 2022 03:01:46 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 06A50383EC5C for ; Fri, 10 Jun 2022 07:01:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06A50383EC5C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1654844506; bh=5SfwTQK1I4zRbKsEmjBgHK6Oqhs0SlD+wMG1I8LGMDs=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Xc2SpJefuFdc28GPrmjmcjdIOdpguTZvp1UxkUmxdM+0xLf7pc5tVCY4AYmzaanYa ZbTDmE7Nt3nKAeIrYKsRcgebccTXCtheNKCIfZAtyQNGT9h4uxW4x3TED6YkQcRGQ6 Z8LLIcGNTocaWynGobb/NNN4VYw500ySMPiVtZ7I= Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id A2D26386F82B for ; Fri, 10 Jun 2022 07:01:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A2D26386F82B 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 9A7951F86B for ; Fri, 10 Jun 2022 07:01:25 +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 879D7139ED for ; Fri, 10 Jun 2022 07:01:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id +8HzH0XsomIrKQAAMHmgww (envelope-from ) for ; Fri, 10 Jun 2022 07:01:25 +0000 Date: Fri, 10 Jun 2022 09:01:24 +0200 To: gdb-patches@sourceware.org Subject: [committed][gdb/testsuite] Fix XPASS with gcc-12 in gdb.base/vla-struct-fields.exp Message-ID: <20220610070122.GA15280@delia.home> 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, With gcc-12, I get for test-case gdb.base/vla-struct-fields.exp: ... (gdb) print inner_vla_struct_object_size == sizeof(inner_vla_struct_object)^M $7 = 1^M (gdb) XPASS: gdb.base/vla-struct-fields.exp: size of inner_vla_struct_object ... Fix this by limiting the xfailing to gcc-11 and earlier. Also, limit the xfailing to the equality test. Tested on x86_64-linux. Committed to trunk. Thanks, - Tom [gdb/testsuite] Fix XPASS with gcc-12 in gdb.base/vla-struct-fields.exp --- gdb/testsuite/gdb.base/vla-struct-fields.exp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.base/vla-struct-fields.exp b/gdb/testsuite/gdb.base/vla-struct-fields.exp index 384d6881779..eeee6b8d6a1 100644 --- a/gdb/testsuite/gdb.base/vla-struct-fields.exp +++ b/gdb/testsuite/gdb.base/vla-struct-fields.exp @@ -60,8 +60,20 @@ gdb_test "print vla_struct_object_size == sizeof(vla_struct_object)" \ gdb_test "print vla_union_object_size == sizeof(vla_union_object)" \ " = 1" "size of vla_union_object" -# Fails due to incorrect debugging information generated by GCC. -setup_xfail "*-*-*" -gdb_test \ - "print inner_vla_struct_object_size == sizeof(inner_vla_struct_object)" \ - " = 1" "size of inner_vla_struct_object" +set a -1 +gdb_test_multiple "print inner_vla_struct_object_size" "" { + -re -wrap " = ($decimal)" { + set a $expect_out(1,string) + } +} +set b -1 +gdb_test_multiple "print sizeof(inner_vla_struct_object)" "" { + -re -wrap " = ($decimal)" { + set b $expect_out(1,string) + } +} +if { [test_compiler_info "gcc-*"] && [gcc_major_version] <= 11 } { + # Fails due to incorrect debugging information generated by GCC. + setup_xfail "*-*-*" +} +gdb_assert {$a == $b} "size of inner_vla_struct_object"