mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-05 23:23:09 +00:00
[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 b4f767131f
("Fix gdb.base/align-*.exp and Clang + LTO and AIX GCC"), by incrementing the
variable.
Tested on x86_64-linux with gcc and clang.
This commit is contained in:
@@ -102,6 +102,8 @@ main (void)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
global_var++;
|
||||||
|
|
||||||
for (i = 0; i < 4; i++)
|
for (i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
struct thread_arg *p;
|
struct thread_arg *p;
|
||||||
|
|||||||
Reference in New Issue
Block a user