public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Fix gdb.threads/access-mem-running-thread-exit.exp with clang
@ 2024-04-11 11:43 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2024-04-11 11:43 UTC (permalink / raw)
  To: gdb-cvs

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

commit 31c21e2c13d85793b525f74aa911eb28700ed89c
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Apr 11 13:43:52 2024 +0200

    [gdb/testsuite] Fix gdb.threads/access-mem-running-thread-exit.exp with clang
    
    When running test-case gdb.threads/access-mem-running-thread-exit.exp with
    clang, we run into:
    ...
    (gdb) print global_var = 555^M
    No symbol "global_var" in current context.^M
    (gdb) FAIL: gdb.threads/access-mem-running-thread-exit.exp: all-stop: \
      access mem (write to global_var, inf=2, iter=1)
    ...
    
    The problem is that clang removes the unused variable.
    
    Fix this in the same way as done in commit b4f767131f7
    ("Fix gdb.base/align-*.exp and Clang + LTO and AIX GCC"), by incrementing the
    variable.
    
    Tested on x86_64-linux with gcc and clang.

Diff:
---
 gdb/testsuite/gdb.threads/access-mem-running-thread-exit.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.c b/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.c
index 5902542ee5b..af05b13c763 100644
--- a/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.c
+++ b/gdb/testsuite/gdb.threads/access-mem-running-thread-exit.c
@@ -102,6 +102,8 @@ main (void)
 {
   int i;
 
+  global_var++;
+
   for (i = 0; i < 4; i++)
     {
       struct thread_arg *p;

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

only message in thread, other threads:[~2024-04-11 11:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-11 11:43 [binutils-gdb] [gdb/testsuite] Fix gdb.threads/access-mem-running-thread-exit.exp with clang Tom de Vries

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).