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 | 308975919152fbf301861d88e2da9b522e3cf112 (patch) | |
tree | 07dc6d7b19049a35febae66fe3e8caee3867b0d8 /gdb/testsuite | |
parent | ced4a4c1ccfa637940fc17dd3160727793d8b8f2 (diff) | |
download | gdb-308975919152fbf301861d88e2da9b522e3cf112.zip gdb-308975919152fbf301861d88e2da9b522e3cf112.tar.gz gdb-308975919152fbf301861d88e2da9b522e3cf112.tar.bz2 |
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.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/list0.c | 2 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/list1.c | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f91c4dc..7484d6e 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,10 @@ 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 __attribute__ ((used)). * gdb.base/list-ambiguous1.c (ambiguous_var): Likewise. diff --git a/gdb/testsuite/gdb.base/list0.c b/gdb/testsuite/gdb.base/list0.c index 0255cf3..1e5b7c1 100644 --- a/gdb/testsuite/gdb.base/list0.c +++ b/gdb/testsuite/gdb.base/list0.c @@ -36,7 +36,7 @@ int main () return 0; } -static void +static void __attribute__ ((used)) unused () { /* Not used for anything */ diff --git a/gdb/testsuite/gdb.base/list1.c b/gdb/testsuite/gdb.base/list1.c index a9f614f..d694495 100644 --- a/gdb/testsuite/gdb.base/list1.c +++ b/gdb/testsuite/gdb.base/list1.c @@ -12,7 +12,7 @@ void bar (int x) long_line (); } -static void +static void __attribute__ ((used)) unused () { /* Not used for anything */ |