From: Gary Benson Date: Tue, 6 Oct 2020 14:08:37 +0000 (+0100) Subject: Fix gdb.base/list.exp with Clang X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=308975919152fbf301861d88e2da9b522e3cf112;p=binutils-gdb.git 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. --- diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f91c4dcbbf3..7484d6e3e65 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-10-06 Gary Benson + + * gdb.base/list0.c (unused): Add __attribute__ ((used)). + * gdb.base/list1.c (unused): Likewise. + 2020-10-06 Gary Benson * gdb.base/list-ambiguous0.c (ambiguous_var): Add diff --git a/gdb/testsuite/gdb.base/list0.c b/gdb/testsuite/gdb.base/list0.c index 0255cf37e02..1e5b7c18ae2 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 a9f614f2f64..d694495c3fb 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 */