Fix: change method used by _rcu_dereference to strip type constness
[urcu.git] / tests / unit / test_build.c
index 7f062f19a236d85f99e1a3402dec9ad467b34582..f6b667ce2b3d9ab08dc64704337f9960d923ab68 100644 (file)
@@ -115,6 +115,26 @@ void test_urcu_tls(void)
        URCU_TLS(my_tls_struct).void1 = NULL;
 }
 
+struct an_opaque_struct;
+struct a_clear_struct
+{
+       int x;
+};
+
+static
+void test_build_rcu_dereference(void)
+{
+       static struct an_opaque_struct *opaque = NULL;
+       static struct an_opaque_struct *const opaque_const = NULL;
+       static struct a_clear_struct *clear = NULL;
+       static struct a_clear_struct *const clear_const = NULL;
+
+       rcu_dereference(opaque);
+       rcu_dereference(opaque_const);
+       rcu_dereference(clear);
+       rcu_dereference(clear_const);
+}
+
 int main(void)
 {
        plan_tests(3);
@@ -124,6 +144,7 @@ int main(void)
        test_wfcqueue();
        test_build_cds_list_head_init();
        test_urcu_tls();
+       test_build_rcu_dereference();
 
        return exit_status();
 }
This page took 0.02377 seconds and 4 git commands to generate.