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 EF4453856DF1 for ; Wed, 5 Jul 2023 21:52:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EF4453856DF1 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=1688593927; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YR6/RsbqFowdvz0mtGt5jqLznotsh+DwDHG9BqWi/vI=; b=b93/7xC0beTI1a6JqfI3ZscivWwwsacSSDXFhjYeF5T8Cva1xtG0ckXctpAfO5NS79Lehm SMjOZlysri3Lom7IacBSQzvqD1L3SduFAfapdxcL52PaXCTQXipp28TDthH+pTEpRf5e3f 1iZ62EXb0fwnLfoGPm313xkssE1iX/c= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-247-X2AlhoNSM2yHh561fxfw5w-1; Wed, 05 Jul 2023 17:52:06 -0400 X-MC-Unique: X2AlhoNSM2yHh561fxfw5w-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 833451C04326 for ; Wed, 5 Jul 2023 21:52:05 +0000 (UTC) Received: from pdp-11.redhat.com (unknown [10.22.34.21]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60FE14CD0C8; Wed, 5 Jul 2023 21:52:05 +0000 (UTC) From: Marek Polacek To: GCC Patches Cc: Jason Merrill Subject: [PATCH] testsuite: fix dwarf2/utf-1.C with DWARF4 Date: Wed, 5 Jul 2023 17:51:51 -0400 Message-ID: <20230705215151.84788-1-polacek@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-12.2 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,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: 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? 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 -- 2.41.0