From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 2EC2038582AC for ; Tue, 18 Jul 2023 16:54:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2EC2038582AC Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689699258; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lDArD3FAS/BqZ08Jzs+urzHY5tY7jGE3RFXyCr26VNI=; b=ZVCRV28Txhg9V6HcMrpuzmxQD6R0fvX0bQ746ahbwauu/zsHr4o15XJ9vl/933J4vTPWsR uX8jPI1jjPZSJSYcojJ+mA8wyGjl8UMUcsWegvgBKmvJXjWvNsUSX0QtnymMxNl3/3+PR2 wmZlj41IvnDukdCbIqgIJBId41/lci8= Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-351-zPguZRGZOaiVE0EggDSIHA-1; Tue, 18 Jul 2023 12:54:17 -0400 X-MC-Unique: zPguZRGZOaiVE0EggDSIHA-1 Received: by mail-oi1-f200.google.com with SMTP id 5614622812f47-39ecef7a101so9091577b6e.2 for ; Tue, 18 Jul 2023 09:54:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689699256; x=1692291256; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lDArD3FAS/BqZ08Jzs+urzHY5tY7jGE3RFXyCr26VNI=; b=FS49YG/lCvz2rzvas0Xme3ts0Z7lEWdb+95czKXW5a2xdBPh4HGLjKKLOX/cBpL8SE MbtvYDPdnedQCU7lklmGIH+QCErhMBGzFi6LXcnonSM0GYbiovLx3yHiLKJM9Md3ixH3 Pe6/ucFKA0xTGp+4fi34PvjNo5twwRZ4PQVKnjvDDayAdFJKwdE3EPh5450nPKO/5lPP rgHXfIRkeGPQctEpztzIEFwT6yG8N4QrwUY40bg2ah45jN2T1xsZqhjsDH/E4s90kMNT w7/i/qPgVoKgQ9kGwAkFvZeGWRLr5xIUhscINmK+aKGBKUWsDQUMqali2IPE0GQ3anqM m1VQ== X-Gm-Message-State: ABy/qLbMKQvzoA67clmdIy1KT6CxMSyJxKyKalKd54kNZlXWtnnYEFOF gkKfaTYCh7hTBG9wP188Vy2GtlVLolmOIti+rLBCrtnlxWRby+0vfBAQo1kADisVGmcEmtLbv1y pUoaBt91RIC1gi3HUC9DnYUZvgA== X-Received: by 2002:a05:6808:1586:b0:3a3:dd78:f43 with SMTP id t6-20020a056808158600b003a3dd780f43mr17126361oiw.2.1689699256433; Tue, 18 Jul 2023 09:54:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlHwnwXb5KazNeI5d0cAa0FOhokwzNylJyelr+vqPQyLQdUwNt0JMAz+kO0SZeJEIdGMeXKZTg== X-Received: by 2002:a05:6808:1586:b0:3a3:dd78:f43 with SMTP id t6-20020a056808158600b003a3dd780f43mr17126350oiw.2.1689699256191; Tue, 18 Jul 2023 09:54:16 -0700 (PDT) Received: from [192.168.1.108] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id t12-20020a0cde0c000000b00636b3519467sm856049qvk.54.2023.07.18.09.54.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 18 Jul 2023 09:54:15 -0700 (PDT) Message-ID: <9665b7b9-3eb2-04b6-46d1-a2c573067021@redhat.com> Date: Tue, 18 Jul 2023 12:54:15 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] testsuite: fix dwarf2/utf-1.C with DWARF4 To: Marek Polacek , GCC Patches References: <20230705215151.84788-1-polacek@redhat.com> From: Jason Merrill In-Reply-To: <20230705215151.84788-1-polacek@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 7/5/23 17:51, Marek Polacek wrote: > Running > $ make check-c++ RUNTESTFLAGS='--target_board=unix\{-gdwarf-5,-gdwarf-4\} dwarf2.exp=utf-1.C' > shows > FAIL: g++.dg/debug/dwarf2/utf-1.C -std=gnu++20 scan-assembler-times DW_AT_encoding \\(0x10\\) 3 > because with -gdwarf-4 the output is: > > .byte 0x10 # DW_AT_encoding > > but with -gdwarf-5 the output is the expected: > > # DW_AT_encoding (0x10) > > The difference is caused by the DWARF5 optimize_implicit_const > optimization: > > > I suppose we could do what testsuite/rust/debug/chartype.rs does > and just run the test with -gdwarf-4. > > Tested on x86_64-pc-linux-gnu, ok for trunk? OK. > gcc/testsuite/ChangeLog: > > * g++.dg/debug/dwarf2/utf-1.C: Use -gdwarf-4. Adjust expected > output. > --- > gcc/testsuite/g++.dg/debug/dwarf2/utf-1.C | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/gcc/testsuite/g++.dg/debug/dwarf2/utf-1.C b/gcc/testsuite/g++.dg/debug/dwarf2/utf-1.C > index 43b354f1bb5..0ce4d8727d6 100644 > --- a/gcc/testsuite/g++.dg/debug/dwarf2/utf-1.C > +++ b/gcc/testsuite/g++.dg/debug/dwarf2/utf-1.C > @@ -1,8 +1,13 @@ > // { dg-do compile { target c++20 } } > -// { dg-options { -gdwarf -dA } } > +// { dg-options { -gdwarf-4 -dA } } > > // Test that all three use DW_ATE_UTF. > -// { dg-final { scan-assembler-times {DW_AT_encoding \(0x10\)} 3 } } > +// This test uses -gdwarf-4 since in DWARF5 optimize_implicit_const > +// would optimize the output from: > +// .byte 0x10 # DW_AT_encoding > +// into: > +// # DW_AT_encoding (0x10) > +// { dg-final { scan-assembler-times "0x10\[ \t]\[^\n\r]* DW_AT_encoding" 3 } } > > char8_t c8; > char16_t c16; > > base-commit: be240fc6acc9714e66afbfbe6dc193844bfcba05