gdb/testsuite: rename thread_local variables

C standard gnu23 introduces a new keyword 'thread_local'.
So, this variables must be renamed to avoid build errors.

Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
Lukas Durfina
2025-11-04 10:06:48 +01:00
committed by Tom Tromey
parent c1011a70b0
commit 3d649e28eb
4 changed files with 5 additions and 5 deletions

View File

@@ -17,7 +17,7 @@
#include <pthread.h>
__thread int thread_local = 42;
__thread int thread_local_var = 42;
int
main (void)

View File

@@ -26,4 +26,4 @@ if {![runto_main]} {
}
# Formerly: Cannot access memory at address 0xffffef7c0698
gdb_test "p (int) thread_local" " = 42" "thread local storage"
gdb_test "p (int) thread_local_var" " = 42" "thread local storage"

View File

@@ -2,7 +2,7 @@
#include <pthread.h>
__thread int thread_local = 42;
__thread int thread_local_var = 42;
int main(void)
{

View File

@@ -32,9 +32,9 @@ if {![runto_main]} {
}
# Formerly: Cannot access memory at address 0x0
gdb_test "p thread_local" "'thread_local' has unknown type; cast it to its declared type" \
gdb_test "p thread_local_var" "'thread_local_var' has unknown type; cast it to its declared type" \
"thread local storage, unknown type"
gdb_test "p (int) thread_local" "= 42" \
gdb_test "p (int) thread_local_var" "= 42" \
"thread local storage, cast"
# Done!