From 3d649e28ebbf48e6b8b6ea4f1be914427bab83ee Mon Sep 17 00:00:00 2001 From: Lukas Durfina Date: Tue, 4 Nov 2025 10:06:48 +0100 Subject: [PATCH] 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 --- gdb/testsuite/gdb.threads/tls-nodebug-pie.c | 2 +- gdb/testsuite/gdb.threads/tls-nodebug-pie.exp | 2 +- gdb/testsuite/gdb.threads/tls-nodebug.c | 2 +- gdb/testsuite/gdb.threads/tls-nodebug.exp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.threads/tls-nodebug-pie.c b/gdb/testsuite/gdb.threads/tls-nodebug-pie.c index c86a95aedc8..1e2c8c296a0 100644 --- a/gdb/testsuite/gdb.threads/tls-nodebug-pie.c +++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.c @@ -17,7 +17,7 @@ #include -__thread int thread_local = 42; +__thread int thread_local_var = 42; int main (void) diff --git a/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp index 44c12f5663d..87d682dda1b 100644 --- a/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp +++ b/gdb/testsuite/gdb.threads/tls-nodebug-pie.exp @@ -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" diff --git a/gdb/testsuite/gdb.threads/tls-nodebug.c b/gdb/testsuite/gdb.threads/tls-nodebug.c index d3b31b7609c..555980719c5 100644 --- a/gdb/testsuite/gdb.threads/tls-nodebug.c +++ b/gdb/testsuite/gdb.threads/tls-nodebug.c @@ -2,7 +2,7 @@ #include -__thread int thread_local = 42; +__thread int thread_local_var = 42; int main(void) { diff --git a/gdb/testsuite/gdb.threads/tls-nodebug.exp b/gdb/testsuite/gdb.threads/tls-nodebug.exp index 971f26c269c..9d9fe1a38b6 100644 --- a/gdb/testsuite/gdb.threads/tls-nodebug.exp +++ b/gdb/testsuite/gdb.threads/tls-nodebug.exp @@ -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! -- 2.47.3