Fix gdb.base/list-ambiguous.exp with Clang

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.

gdb/testsuite/ChangeLog:

	* gdb.base/list-ambiguous0.c (ambiguous_var): Add
	__attribute__ ((used)).
	* gdb.base/list-ambiguous1.c (ambiguous_var): Likewise.
This commit is contained in:
Gary Benson 2020-10-06 15:08:37 +01:00
parent 0ae9445d52
commit ced4a4c1cc
3 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2020-10-06 Gary Benson <gbenson@redhat.com>
* gdb.base/list-ambiguous0.c (ambiguous_var): Add
__attribute__ ((used)).
* gdb.base/list-ambiguous1.c (ambiguous_var): Likewise.
2020-10-06 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.base/m32r.ld: Remove SEARCH_DIR line. Add MEMORY regions,

View File

@ -25,7 +25,7 @@
static void __attribute__ ((used)) ambiguous_fun (void) {}
static int ambiguous_var;
static int __attribute__ ((used)) ambiguous_var;

View File

@ -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;