fix: use urcu-tls compat with c++ compiler
[userspace-rcu.git] / tests / unit / test_build.c
index b2786c55c00253d8d51ab6e1ae8ed90329755f85..7f062f19a236d85f99e1a3402dec9ad467b34582 100644 (file)
 
 #include "tap.h"
 
+struct my_tls_struct {
+       int int1;
+       char char1;
+       void *void1;
+};
+
+static DEFINE_URCU_TLS(int, my_tls_int);
+static DEFINE_URCU_TLS(struct my_tls_struct, my_tls_struct);
+
 static void test_lfstack(void)
 {
        struct cds_lfs_stack s;
@@ -97,6 +106,15 @@ void test_build_cds_list_head_init(void)
        };
 }
 
+static
+void test_urcu_tls(void)
+{
+       URCU_TLS(my_tls_int) = 1;
+       URCU_TLS(my_tls_struct).int1 = 1;
+       URCU_TLS(my_tls_struct).char1 = 'a';
+       URCU_TLS(my_tls_struct).void1 = NULL;
+}
+
 int main(void)
 {
        plan_tests(3);
@@ -105,6 +123,7 @@ int main(void)
        test_wfstack();
        test_wfcqueue();
        test_build_cds_list_head_init();
+       test_urcu_tls();
 
        return exit_status();
 }
This page took 0.023495 seconds and 4 git commands to generate.