From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2205) id 6C8693858C39; Thu, 11 Apr 2024 11:43:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6C8693858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1712835833; bh=zj78qFUSMvnSpRmEo2GCN5/Z4JdQO9pzpvPvKiMBgHU=; h=From:To:Subject:Date:From; b=GPwrO8190U6aAA7ah8uio/EFm39732jEsH7B+uGzlzxJEtG5bWkrbAs2sJa5Fgh7e f0BSUjL1jDDwsF6YH1Y02g/u0ChhTTLeqmnh8XdSswQtfvecSpomtR3oWTLPyiIFGq w7xxS0MrzV5h7584HzJpIrK1Ai8C+RiWr/fwchb0= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom de Vries To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [gdb/testsuite] Fix gdb.threads/access-mem-running-thread-exit.exp with clang X-Act-Checkin: binutils-gdb X-Git-Author: Tom de Vries X-Git-Refname: refs/heads/master X-Git-Oldrev: cafca5eaa068eaaa3e3a2ffab356efb4714c2968 X-Git-Newrev: 31c21e2c13d85793b525f74aa911eb28700ed89c Message-Id: <20240411114353.6C8693858C39@sourceware.org> Date: Thu, 11 Apr 2024 11:43:53 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D31c21e2c13d8= 5793b525f74aa911eb28700ed89c commit 31c21e2c13d85793b525f74aa911eb28700ed89c Author: Tom de Vries Date: Thu Apr 11 13:43:52 2024 +0200 [gdb/testsuite] Fix gdb.threads/access-mem-running-thread-exit.exp with= clang =20 When running test-case gdb.threads/access-mem-running-thread-exit.exp w= ith clang, we run into: ... (gdb) print global_var =3D 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=3D2, iter=3D1) ... =20 The problem is that clang removes the unused variable. =20 Fix this in the same way as done in commit b4f767131f7 ("Fix gdb.base/align-*.exp and Clang + LTO and AIX GCC"), by incrementi= ng the variable. =20 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/g= db/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; =20 + global_var++; + for (i =3D 0; i < 4; i++) { struct thread_arg *p;