From: Bruno Larsen Date: Wed, 20 Jul 2022 19:44:32 +0000 (-0300) Subject: fix gdb.base/access-mem-running.exp for clang testing X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=96ca89d245e262578ef565247c1d68dff493d8a3;p=binutils-gdb.git fix gdb.base/access-mem-running.exp for clang testing Clang was optimizing global_var away because it was not being used anywhere. this commit fixes that by adding the attribute used it. --- diff --git a/gdb/testsuite/gdb.base/access-mem-running.c b/gdb/testsuite/gdb.base/access-mem-running.c index 6335f1bf199..cff6f0da820 100644 --- a/gdb/testsuite/gdb.base/access-mem-running.c +++ b/gdb/testsuite/gdb.base/access-mem-running.c @@ -19,7 +19,7 @@ static unsigned int global_counter = 1; -static volatile unsigned int global_var = 123; +static volatile unsigned int __attribute__((used)) global_var = 123; static void maybe_stop_here ()