blob: 53aece1810f7dd5783bb222af048466581f21606 [file] [log] [blame]
lh9ed821d2023-04-07 01:36:19 -07001#include <stdio.h>
2#include <stdlib.h>
3#include <tls.h>
4
5#define TLS_VAR_INIT_VALUE 99
6
7#ifdef USE_TLS
8extern __thread int tls_var;
9#endif
10
11int main(void)
12{
13 int ret = EXIT_SUCCESS;
14#ifdef USE_TLS
15 if (tls_var != TLS_VAR_INIT_VALUE) {
16 printf("tls_var = %d - Expected value = %d\n", tls_var, TLS_VAR_INIT_VALUE);
17 ret = EXIT_FAILURE;
18 }
19#endif
20 return ret;
21}