fix: handle EINTR correctly in get_cpu_mask_from_sysfs
[urcu.git] / tests / unit / test_build.c
index 7f062f19a236d85f99e1a3402dec9ad467b34582..99ddbcdd2ac4b9dfa3f84a563e5fa3eb90c0cdea 100644 (file)
@@ -1,20 +1,6 @@
-/*
- * Copyright 2021 Simon Marchi <simon.marchi@efficios.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- */
+// SPDX-FileCopyrightText: 2021 Simon Marchi <simon.marchi@efficios.com>
+//
+// SPDX-License-Identifier: GPL-2.0-or-later
 
 /*
  * This file is meant to verify that headers are compatible with both C and
@@ -52,7 +38,6 @@
 #include <urcu/urcu-mb.h>
 #include <urcu/urcu-memb.h>
 #include <urcu/urcu-qsbr.h>
-#include <urcu/urcu-signal.h>
 #include <urcu/wfcqueue.h>
 #include <urcu/wfqueue.h>
 #include <urcu/wfstack.h>
@@ -115,6 +100,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;
+
+       (void) rcu_dereference(opaque);
+       (void) rcu_dereference(opaque_const);
+       (void) rcu_dereference(clear);
+       (void) rcu_dereference(clear_const);
+}
+
 int main(void)
 {
        plan_tests(3);
@@ -124,6 +129,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.028105 seconds and 4 git commands to generate.