crt: tests: split t_tls1 into t_tls_ansi and t_tls_c11 Rename `t_tls1.c` to `t_tls_c.c`. Both `t_tls_ansi.c` and `t_tls_c11.c` simply include `t_tls_c.c`, but compiled in a different way: - t_tls_ansi: compiled with `-std=c89`, which makes `t_tls_c.c` use gcc-specific `__thread` keyword to declare thread-local variable - t_tls_c11: compiled with `-std=c11`, which makes `t_tls_c.c` use standard `_Thread_local` keyword to declare thread-local variable This allows to test that both `__thread` and `_Thread_local` work as expected. Signed-off-by: Kirill Makurin <maiddaisuki@outlook.com> Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-crt/testcases/Makefile.am b/mingw-w64-crt/testcases/Makefile.am index 66136b8..c00111e 100644 --- a/mingw-w64-crt/testcases/Makefile.am +++ b/mingw-w64-crt/testcases/Makefile.am
@@ -85,7 +85,8 @@ t_swprintf0 \ t_swprintf1 \ t_time \ - t_tls1 \ + t_tls_ansi \ + t_tls_c11 \ t_tmpfile \ t_towctrans \ t_trycatch \ @@ -141,6 +142,12 @@ # Link t_safe_flush against libprocdetach.dll t_safe_flush_LDADD = libprocdetach.dll +# Compile t_tls_ansi in C89 mode +t_tls_ansi_CFLAGS = -std=c89 $(AM_CFLAGS) + +# Compile t_tls_c11 in C11 mode +t_tls_c11_CFLAGS = -std=c11 $(AM_CFLAGS) + if ENABLE_TESTS_UNICODE # The following tests require compiler support for -municode option testcase_progs += \
diff --git a/mingw-w64-crt/testcases/t_tls_ansi.c b/mingw-w64-crt/testcases/t_tls_ansi.c new file mode 100644 index 0000000..c8c5dbb --- /dev/null +++ b/mingw-w64-crt/testcases/t_tls_ansi.c
@@ -0,0 +1 @@ +#include "t_tls_c.c"
diff --git a/mingw-w64-crt/testcases/t_tls1.c b/mingw-w64-crt/testcases/t_tls_c.c similarity index 100% rename from mingw-w64-crt/testcases/t_tls1.c rename to mingw-w64-crt/testcases/t_tls_c.c
diff --git a/mingw-w64-crt/testcases/t_tls_c11.c b/mingw-w64-crt/testcases/t_tls_c11.c new file mode 100644 index 0000000..c8c5dbb --- /dev/null +++ b/mingw-w64-crt/testcases/t_tls_c11.c
@@ -0,0 +1 @@ +#include "t_tls_c.c"