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>
#include <pthread.h>
-__thread int thread_local = 42;
+__thread int thread_local_var = 42;
int
main (void)
}
# 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"
#include <pthread.h>
-__thread int thread_local = 42;
+__thread int thread_local_var = 42;
int main(void)
{
}
# 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!