Fix gdb.base/list.exp with Clang

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.

gdb/testsuite/ChangeLog:

	* gdb.base/list0.c (unused): Add __attribute__ ((used)).
	* gdb.base/list1.c (unused): Likewise.
This commit is contained in:
Gary Benson 2020-10-06 15:08:37 +01:00
parent ced4a4c1cc
commit 3089759191
3 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2020-10-06 Gary Benson <gbenson@redhat.com>
* gdb.base/list0.c (unused): Add __attribute__ ((used)).
* gdb.base/list1.c (unused): Likewise.
2020-10-06 Gary Benson <gbenson@redhat.com>
* gdb.base/list-ambiguous0.c (ambiguous_var): Add

View File

@ -36,7 +36,7 @@ int main ()
return 0;
}
static void
static void __attribute__ ((used))
unused ()
{
/* Not used for anything */

View File

@ -12,7 +12,7 @@ void bar (int x)
long_line ();
}
static void
static void __attribute__ ((used))
unused ()
{
/* Not used for anything */