public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb/testsuite: fix gdb.trace/unavailable-dwarf-piece.exp with Clang
@ 2022-11-18 11:46 Andrew Burgess
  0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2022-11-18 11:46 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=33c1395cf5e9deec7733691ba32c450e5c27f757

commit 33c1395cf5e9deec7733691ba32c450e5c27f757
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Fri Nov 11 15:26:46 2022 +0000

    gdb/testsuite: fix gdb.trace/unavailable-dwarf-piece.exp with Clang
    
    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.
    
    Reviewed-By: Lancelot SIX <lancelot.six@amd.com>

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/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 \

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-18 11:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-18 11:46 [binutils-gdb] gdb/testsuite: fix gdb.trace/unavailable-dwarf-piece.exp with Clang Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).