diff options
author | Gary Benson <gbenson@redhat.com> | 2020-10-06 15:08:37 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2020-10-06 15:08:37 +0100 |
commit | ced4a4c1ccfa637940fc17dd3160727793d8b8f2 (patch) | |
tree | dfa2ed5bb8811aba40ceac5f2de1e9f5b7a9bf6b /gdb | |
parent | 0ae9445d52b99182a541a6da7177665252f37af8 (diff) | |
download | gdb-ced4a4c1ccfa637940fc17dd3160727793d8b8f2.zip gdb-ced4a4c1ccfa637940fc17dd3160727793d8b8f2.tar.gz gdb-ced4a4c1ccfa637940fc17dd3160727793d8b8f2.tar.bz2 |
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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/list-ambiguous0.c | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/list-ambiguous1.c | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a6ac59d..f91c4dc 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -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, diff --git a/gdb/testsuite/gdb.base/list-ambiguous0.c b/gdb/testsuite/gdb.base/list-ambiguous0.c index c8519cf..0ad3f78 100644 --- a/gdb/testsuite/gdb.base/list-ambiguous0.c +++ b/gdb/testsuite/gdb.base/list-ambiguous0.c @@ -25,7 +25,7 @@ static void __attribute__ ((used)) ambiguous_fun (void) {} -static int ambiguous_var; +static int __attribute__ ((used)) ambiguous_var; diff --git a/gdb/testsuite/gdb.base/list-ambiguous1.c b/gdb/testsuite/gdb.base/list-ambiguous1.c index 19906b5..4de0f0e 100644 --- a/gdb/testsuite/gdb.base/list-ambiguous1.c +++ b/gdb/testsuite/gdb.base/list-ambiguous1.c @@ -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; |