binutils-gdb/gdb/testsuite/gdb.base/list0.c
Gary Benson 3089759191 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.
2020-10-06 15:08:37 +01:00

44 lines
591 B
C

#include "list0.h"
int main ()
{
int x;
x = 0;
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
foo (x++);
return 0;
}
static void __attribute__ ((used))
unused ()
{
/* Not used for anything */
} /* last line */