Fix gdb.base/list-ambiguous.exp with Clang
authorGary Benson <gbenson@redhat.com>
Tue, 6 Oct 2020 14:08:37 +0000 (15:08 +0100)
committerGary Benson <gbenson@redhat.com>
Tue, 6 Oct 2020 14:08:37 +0000 (15:08 +0100)
commitced4a4c1ccfa637940fc17dd3160727793d8b8f2
treedfa2ed5bb8811aba40ceac5f2de1e9f5b7a9bf6b
parent0ae9445d52b99182a541a6da7177665252f37af8
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.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/list-ambiguous0.c
gdb/testsuite/gdb.base/list-ambiguous1.c