From: Bruno Larsen Date: Wed, 20 Jul 2022 19:44:35 +0000 (-0300) Subject: gdb/testsuite: fix gdb.base/msym-bp-shl when running with Clang X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8d215439f665e51adc55dc2c4ba743ee576cb2fc;p=binutils-gdb.git gdb/testsuite: fix gdb.base/msym-bp-shl when running with Clang When trying to test gdb.base/msym-bp-shl.exp using clang, it would have many failures because one of the version of the foo function was being optimized away. Adding __attribute__ ((used)) to it fixed this. --- diff --git a/gdb/testsuite/gdb.base/msym-bp-shl-main-2.c b/gdb/testsuite/gdb.base/msym-bp-shl-main-2.c index e047ac1145a..009656fd9ea 100644 --- a/gdb/testsuite/gdb.base/msym-bp-shl-main-2.c +++ b/gdb/testsuite/gdb.base/msym-bp-shl-main-2.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -static void +static void __attribute__ ((used)) foo (void) { }