From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 607BA384F6FF; Fri, 18 Nov 2022 11:46:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 607BA384F6FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668771987; bh=/5EleDoxZifEK9MkuOySVIFhKx8MV3zvSD3OU9l3KZU=; h=From:To:Subject:Date:From; b=dDw9Umh9PGFe5RNTqPp5hYIRsJWTK22v0CFS4PB0oy8sGSnvUb3zmOBw+eYWdkhKL 7XmxHj8k+CbQm8BoCWBa2SVyGjRMA6aaXNUJIzsat0YkVePBFMAHwrhW+AfjRV5tTx j20R/fnegjrLqgwsgRX/rJwo5iPAp0Msi9g0PzE8= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite: fix gdb.trace/unavailable-dwarf-piece.exp with Clang X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: 6911239bbaa7b4365d3d0ff7b6cb296cfe43480c X-Git-Newrev: 33c1395cf5e9deec7733691ba32c450e5c27f757 Message-Id: <20221118114627.607BA384F6FF@sourceware.org> Date: Fri, 18 Nov 2022 11:46:27 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D33c1395cf5e9= deec7733691ba32c450e5c27f757 commit 33c1395cf5e9deec7733691ba32c450e5c27f757 Author: Andrew Burgess Date: Fri Nov 11 15:26:46 2022 +0000 gdb/testsuite: fix gdb.trace/unavailable-dwarf-piece.exp with Clang =20 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. =20 The problem is that Clang was emitting this warning: =20 warning: argument unused during compilation: '-fdiagnostics-color=3Dn= ever' [-Wunused-command-line-argument] =20 This warning is emitted when compiling the assembler file generated by the DWARF assembler. =20 Most DWARF assembler tests generate the assembler file into a file with the '.S' extension. However, this particular test uses a '.s' extension. =20 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=3Dnever option for the assembler, but does for the preprocessor. =20 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. =20 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. =20 With these changes the test now passes with Clang 9.0.1 and 15.0.2, and also still passes with gcc. =20 Reviewed-By: Lancelot SIX Diff: --- 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/test= suite/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 } =20 -standard_testfile .c +standard_testfile .c -dbg.S =20 -set asm_file [standard_output_file "${testfile}-dbg.s"] +set asm_file $srcfile2 set opts {} =20 if { [gdb_compile ${srcdir}/${subdir}/${srcfile} ${binfile}1.o \