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.133.124]) by sourceware.org (Postfix) with ESMTPS id 658C4395B41E for ; Wed, 16 Nov 2022 14:41:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 658C4395B41E 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=1668609718; 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=VMzdArfziATboBTXarqBYAyaQgHuTTkzWSkgXEPg5MM=; b=VscclSd4OzawLMH289Q2GBLCwQoOd3qzJzufusdT3quh0SLETQuA/mnlJZQqMAQOLc9rKY UcpcFP2LX56FRWX1o+FUyFJ3pn8U39XAt2Vz8lRVR6phspIssE8QmZnQO+HNn7XQ4GCYfc mtmEJ0hxhzF9mHT4hjWaJkO+ouUwS6Y= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-300-fOLUZBWVP7WLVYblzQZiRQ-1; Wed, 16 Nov 2022 09:41:56 -0500 X-MC-Unique: fOLUZBWVP7WLVYblzQZiRQ-1 Received: by mail-ed1-f71.google.com with SMTP id q13-20020a056402518d00b00462b0599644so12734003edd.20 for ; Wed, 16 Nov 2022 06:41:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=VMzdArfziATboBTXarqBYAyaQgHuTTkzWSkgXEPg5MM=; b=eGK+tsyQv/PJSY+G8XaJjCpHsmLDMkYIV/6nlIgtgIfYOIHo0girCMgBFUjSuxAmUC CA+D+ZWj2l/PBMOuSS1EPXi6czqUggEWyKZCuB/3ahl789cIm/92g8/xgsXVzooeAvi4 /rJoixK8Z3gNeNUXlBIC+BGW7WAgW0Q/xuYU22lCE8Txk8YYAWg/90PdcKxfP6H3r9rS yyEoOEKs/39PqDY6lfkNVC/IxhaWwDIQGJcIyiBGzbvNy4+2gkSx4uyFQ2pExCEP1MV6 cXp85g83yqBNgt1cnRTQTaHaghSX7jzNzcioKoZ0qyqMScklJ0gDwxa3C2lpX5Sv7w2I B5yA== X-Gm-Message-State: ANoB5pl3YJm7QJrehjp1PRkIwVj0CtzVSplqWtqoVbuuKH14g9yXZyw6 /ImVN1/y0sOmFcNnEDCHuDdaOTYMrmvzlnj11PIgX2STprjiDffyDPmh7rIltbIUaD3/U+yHD6q 8Rxdc3Tw7kkzLF+pt9Y4k6g== X-Received: by 2002:a17:906:3101:b0:78d:6429:a806 with SMTP id 1-20020a170906310100b0078d6429a806mr17816764ejx.553.1668609715597; Wed, 16 Nov 2022 06:41:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf41utvqgRh9SVSrH3pTV3w5mIO+8w3GJClb9pHiTJC27w/usXwHe/Ga3TSf51KCKW0/JPus/Q== X-Received: by 2002:a17:906:3101:b0:78d:6429:a806 with SMTP id 1-20020a170906310100b0078d6429a806mr17816741ejx.553.1668609715319; Wed, 16 Nov 2022 06:41:55 -0800 (PST) Received: from [10.43.2.105] (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id g17-20020aa7c851000000b0046383354bf9sm7607711edt.40.2022.11.16.06.41.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 16 Nov 2022 06:41:54 -0800 (PST) Message-ID: <00ef5863-fcb6-9a56-2c80-b6a726904a30@redhat.com> Date: Wed, 16 Nov 2022 15:41:54 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH 2/6] gdb/testsuite: fix gdb.trace/unavailable-dwarf-piece.exp with Clang To: Andrew Burgess , gdb-patches@sourceware.org References: From: Bruno Larsen In-Reply-To: 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: 8bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00,BODY_8BITS,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP 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 11/11/2022 17:36, Andrew Burgess via Gdb-patches wrote: > I noticed that the test gdb.trace/unavailable-dwarf-piece.exp was > failing when run with Clang. Or rather, the test was not running as > the test executable failed to compile. > > The problem is that Clang was emitting this warning: > > warning: argument unused during compilation: '-fdiagnostics-color=never' [-Wunused-command-line-argument] > > This warning is emitted when compiling the assembler file generated > by the DWARF assembler. > > Most DWARF assembler tests generate the assembler file into a file > with the '.S' extension. However, this particular test uses a '.s' > extension. > > Now a .S file will be passed through the preprocessor, while a .s will > be sent straight to the assembler. My guess is that Clang doesn't > support the -fdiagnostics-color=never option for the assembler, but > does for the preprocessor. > > That's a little annoying, but easily worked around. We don't care if > our assembler file is passed through the preprocessor, so, in this > commit, I just change the file extension from .s to .S, and the > problem is fixed. > > Currently, the unavailable-dwarf-piece.exp script names the assembler > file using standard_output_file, in this commit I've switched to make > use of standard_testfile, as that seems to be the more common way of > doing this sort of thing. > > With these changes the test now passes with Clang 9.0.1 and 15.0.2, > and also still passes with gcc. > --- > gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp > index f80f8005fcf..13c6f38737c 100644 > --- a/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp > +++ b/gdb/testsuite/gdb.trace/unavailable-dwarf-piece.exp > @@ -20,9 +20,9 @@ if {![dwarf2_support]} { > return 0 > } > > -standard_testfile .c > +standard_testfile .c -dbg.S > > -set asm_file [standard_output_file "${testfile}-dbg.s"] > +set asm_file $srcfile2 > set opts {} > > if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \ I tried running this test with these changes using clang 14.0.5 and clang 16.0.0, and both times I got the following output: builtin_spawn -ignore SIGHUP clang-14 -fdiagnostics-color=never -Wno-unknown-warning-option -w -c -g -o /home/blarsen/Documents/fsf_build/gdb/testsuite/temp/1163842/is_ilp32_target-1163842.o /home/blarsen/Documents/fsf_build/gdb/testsuite/temp/1163842/is_ilp32_target-1163842.c /home/blarsen/Documents/fsf_build/gdb/testsuite/temp/1163842/is_ilp32_target-1163842.c:2:12: error: 'dummy' declared as an array with a negative size         int dummy[sizeof (int) == 4                   ^~~~~~~~~~~~~~~~~ 1 error generated. And I get an "unsupported" test. The error message says that the target doesn't support trace, but I'm not sure if it isn't related to the compilation failure. Do you see anything similar? -- Cheers, Bruno