public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [committed][gdb/testsuite] Update psym-external-decl.exp for gcc-10/clang
@ 2020-05-02  7:51 Tom de Vries
  2020-06-17 12:24 ` Gary Benson
  0 siblings, 1 reply; 16+ messages in thread
From: Tom de Vries @ 2020-05-02  7:51 UTC (permalink / raw)
  To: gdb-patches

Hi,

When running test-case gdb.base/psym-external-decl.exp with gcc-10, we have:
...
(gdb) print aaa^M
'aaa' has unknown type; cast it to its declared type^M
(gdb) FAIL: gdb.base/psym-external-decl.exp: print aaa
...

With an an earlier version, gcc still emits the debug info for the
declaration of aaa:
...
 <0><d2>: Abbrev Number: 1 (DW_TAG_compile_unit)
    <d8>   DW_AT_name        : psym-external-decl.c
 <1><f4>: Abbrev Number: 2 (DW_TAG_variable)
    <f5>   DW_AT_name        : aaa
    <ff>   DW_AT_external    : 1
    <ff>   DW_AT_declaration : 1
...
but with gcc-10 that's no longer the case.

Fix the test-case by adding a use of aaa in psym-external-decl.c.

That still doesn't work for clang, so skip test in that case.

Tested with x86_64-linux, with gcc 7.5.0, gcc 10.0.0 and clang 5.0.2.

Also tested by reverting corresponding fix and ensuring test-case still
fails.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Update psym-external-decl.exp for gcc-10/clang

gdb/testsuite/ChangeLog:

2020-05-02  Tom de Vries  <tdevries@suse.de>

	* gdb.base/psym-external-decl.c (main): Add use of variable aaa.

---
 gdb/testsuite/gdb.base/psym-external-decl.c   | 2 +-
 gdb/testsuite/gdb.base/psym-external-decl.exp | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.base/psym-external-decl.c b/gdb/testsuite/gdb.base/psym-external-decl.c
index 7a4b1077741..e2374327bde 100644
--- a/gdb/testsuite/gdb.base/psym-external-decl.c
+++ b/gdb/testsuite/gdb.base/psym-external-decl.c
@@ -20,6 +20,6 @@ extern int aaa;
 int
 main (void)
 {
-  return 0;
+  return aaa;
 }
 
diff --git a/gdb/testsuite/gdb.base/psym-external-decl.exp b/gdb/testsuite/gdb.base/psym-external-decl.exp
index bbcc2745755..d0388d5655e 100644
--- a/gdb/testsuite/gdb.base/psym-external-decl.exp
+++ b/gdb/testsuite/gdb.base/psym-external-decl.exp
@@ -15,6 +15,11 @@
 
 standard_testfile .c psym-external-decl-2.c
 
+get_compiler_info
+if { [test_compiler_info "clang-*"] } {
+    return -1
+}
+
 set srcfiles [list $srcfile $srcfile2]
 
 if { [build_executable_from_specs \

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-07-03 12:51 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-02  7:51 [committed][gdb/testsuite] Update psym-external-decl.exp for gcc-10/clang Tom de Vries
2020-06-17 12:24 ` Gary Benson
2020-06-17 13:56   ` Tom de Vries
2020-06-18 16:10     ` Gary Benson
2020-06-18 16:27       ` Tom de Vries
2020-06-19 14:00         ` Gary Benson
2020-06-19 14:06           ` Tom de Vries
2020-06-26  9:37             ` Gary Benson
2020-06-28 10:50               ` Tom de Vries
2020-06-29 12:32                 ` Pedro Alves
2020-06-30  8:14                   ` Tom de Vries
2020-07-03  9:21                     ` Gary Benson
2020-07-03 11:20                       ` Pedro Alves
2020-07-03 11:24                         ` Tom de Vries
2020-07-03 11:32                           ` Pedro Alves
2020-07-03 12:50                             ` Tom de Vries

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).