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

Hi all,

Two subtests of gdb.base/list.exp failed when built with Clang
because the unused function "unused" 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/list0.c (unused): Add __attribute__ ((used)).
	* gdb.base/list1.c (unused): Likewise.
---
 gdb/testsuite/ChangeLog        | 5 +++++
 gdb/testsuite/gdb.base/list0.c | 2 +-
 gdb/testsuite/gdb.base/list1.c | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/list0.c b/gdb/testsuite/gdb.base/list0.c
index 0255cf3..1e5b7c1 100644
--- a/gdb/testsuite/gdb.base/list0.c
+++ b/gdb/testsuite/gdb.base/list0.c
@@ -36,7 +36,7 @@ int main ()
     return 0;
 }
 
-static void
+static void __attribute__ ((used))
 unused ()
 {
     /* Not used for anything */
diff --git a/gdb/testsuite/gdb.base/list1.c b/gdb/testsuite/gdb.base/list1.c
index a9f614f..d694495 100644
--- a/gdb/testsuite/gdb.base/list1.c
+++ b/gdb/testsuite/gdb.base/list1.c
@@ -12,7 +12,7 @@ void bar (int x)
     long_line ();
 }
 
-static void
+static void __attribute__ ((used))
 unused ()
 {
     /* Not used for anything */
-- 
1.8.3.1


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

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

On 10/5/20 2:44 PM, Gary Benson via Gdb-patches wrote:
> Hi all,
> 
> Two subtests of gdb.base/list.exp failed when built with Clang
> because the unused function "unused" 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.exp with Clang
  2020-10-06 11:43 ` Pedro Alves
@ 2020-10-06 14:13   ` Gary Benson
  0 siblings, 0 replies; 3+ messages in thread
From: Gary Benson @ 2020-10-06 14:13 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Pedro Alves wrote:
> On 10/5/20 2:44 PM, Gary Benson via Gdb-patches wrote:
> > Hi all,
> > 
> > Two subtests of gdb.base/list.exp failed when built with Clang
> > because the unused function "unused" 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 one now too.

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:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-05 13:44 [PATCH] Fix gdb.base/list.exp with Clang Gary Benson
2020-10-06 11:43 ` Pedro Alves
2020-10-06 14:13   ` 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).