public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix gdb.base/list-ambiguous.exp with Clang
@ 2020-10-05 11:17 Gary Benson
  2020-10-06 11:42 ` Pedro Alves
  0 siblings, 1 reply; 3+ messages in thread
From: Gary Benson @ 2020-10-05 11:17 UTC (permalink / raw)
  To: gdb-patches

Hi all,

The ambiguous variable parts of gdb.base/list-ambiguous.exp failed
when built with Clang because the variable in question was unused
and was optimized out.  This commit adds __attribute__ ((used)) to
both definitions.

Checked on Fedora 32 x86_64, with GCC and Clang.  Ok to commit?

Cheers,
Gary

---
gdb/testsuite/ChangeLog:

	* gdb.base/list-ambiguous0.c (ambiguous_var): Add
	__attribute__ ((used)).
	* gdb.base/list-ambiguous1.c (ambiguous_var): Likewise.
---
 gdb/testsuite/ChangeLog                  | 6 ++++++
 gdb/testsuite/gdb.base/list-ambiguous0.c | 2 +-
 gdb/testsuite/gdb.base/list-ambiguous1.c | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/list-ambiguous0.c b/gdb/testsuite/gdb.base/list-ambiguous0.c
index c8519cf..0ad3f78 100644
--- a/gdb/testsuite/gdb.base/list-ambiguous0.c
+++ b/gdb/testsuite/gdb.base/list-ambiguous0.c
@@ -25,7 +25,7 @@
 
 static void __attribute__ ((used)) ambiguous_fun (void) {}
 
-static int ambiguous_var;
+static int __attribute__ ((used)) ambiguous_var;
 
 
 
diff --git a/gdb/testsuite/gdb.base/list-ambiguous1.c b/gdb/testsuite/gdb.base/list-ambiguous1.c
index 19906b5..4de0f0e 100644
--- a/gdb/testsuite/gdb.base/list-ambiguous1.c
+++ b/gdb/testsuite/gdb.base/list-ambiguous1.c
@@ -28,7 +28,7 @@
    "list"'s behavior with ambiguous linespecs.  */
 static void __attribute__ ((used)) ambiguous_fun (void) {}
 
-static int ambiguous_var;
+static int __attribute__ ((used)) ambiguous_var;
 
 
 
-- 
1.8.3.1


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

* Re: [PATCH] Fix gdb.base/list-ambiguous.exp with Clang
  2020-10-05 11:17 [PATCH] Fix gdb.base/list-ambiguous.exp with Clang Gary Benson
@ 2020-10-06 11:42 ` Pedro Alves
  2020-10-06 14:12   ` Gary Benson
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2020-10-06 11:42 UTC (permalink / raw)
  To: Gary Benson, gdb-patches

On 10/5/20 12:17 PM, Gary Benson via Gdb-patches wrote:
> Hi all,
> 
> The ambiguous variable parts of gdb.base/list-ambiguous.exp failed
> when built with Clang because the variable in question was unused
> and was optimized out.  This commit adds __attribute__ ((used)) to
> both definitions.
> 
> Checked on Fedora 32 x86_64, with GCC and Clang.  Ok to commit?

OK.

Thanks,
Pedro Alves

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

* Re: [PATCH] Fix gdb.base/list-ambiguous.exp with Clang
  2020-10-06 11:42 ` Pedro Alves
@ 2020-10-06 14:12   ` Gary Benson
  0 siblings, 0 replies; 3+ messages in thread
From: Gary Benson @ 2020-10-06 14:12 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Pedro Alves wrote:
> On 10/5/20 12:17 PM, Gary Benson via Gdb-patches wrote:
> > The ambiguous variable parts of gdb.base/list-ambiguous.exp failed
> > when built with Clang because the variable in question was unused
> > and was optimized out.  This commit adds __attribute__ ((used)) to
> > both definitions.
> > 
> > Checked on Fedora 32 x86_64, with GCC and Clang.  Ok to commit?
> 
> OK.

Thanks Pedro, I've pushed this now.

Cheers,
Gary

-- 
Gary Benson - he / him / his
Principal Software Engineer, Red Hat


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

end of thread, other threads:[~2020-10-06 14:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05 11:17 [PATCH] Fix gdb.base/list-ambiguous.exp with Clang Gary Benson
2020-10-06 11:42 ` Pedro Alves
2020-10-06 14:12   ` Gary Benson

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