From 96ca89d245e262578ef565247c1d68dff493d8a3 Mon Sep 17 00:00:00 2001 From: Bruno Larsen Date: Wed, 20 Jul 2022 16:44:32 -0300 Subject: [PATCH] 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. --- gdb/testsuite/gdb.base/access-mem-running.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 () -- 2.30.2