public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] fix gdb.base/access-mem-running.exp for clang testing
@ 2022-09-12 12:18 Bruno Larsen
  0 siblings, 0 replies; only message in thread
From: Bruno Larsen @ 2022-09-12 12:18 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=96ca89d245e262578ef565247c1d68dff493d8a3

commit 96ca89d245e262578ef565247c1d68dff493d8a3
Author: Bruno Larsen <blarsen@redhat.com>
Date:   Wed Jul 20 16:44:32 2022 -0300

    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:
---
 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 ()

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-12 12:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 12:18 [binutils-gdb] fix gdb.base/access-mem-running.exp for clang testing Bruno Larsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).