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

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