X-Git-Url: https://git.liburcu.org/?p=urcu.git;a=blobdiff_plain;f=tests%2Funit%2Ftest_arch.c;fp=tests%2Funit%2Ftest_arch.c;h=fb447d6ce8bd4159c76867017192637ca9dcfc4c;hp=0000000000000000000000000000000000000000;hb=bbc9abdcfe7d034965894d6cffc94c74478e4f59;hpb=86e8ab17bc98f890f7da1aa5af6ad9038820c618 diff --git a/tests/unit/test_arch.c b/tests/unit/test_arch.c new file mode 100644 index 0000000..fb447d6 --- /dev/null +++ b/tests/unit/test_arch.c @@ -0,0 +1,52 @@ +/* + * test_arch.c + * + * Userspace RCU library - test arch headers + * + * Copyright February 2021 Michael Jeanson + * + * 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. + */ + +#include +#include + +#include "tap.h" + +#define NR_TESTS 1 + + +/* + * This is only to make sure the static inline caa_get_cycles() in the public + * headers builds properly. + */ +static +void test_caa_get_cycles(void) { + caa_cycles_t cycles = 0; + + + cycles = caa_get_cycles(); + + ok(cycles != 0, "caa_get_cycles works"); +} + +int main(void) +{ + plan_tests(NR_TESTS); + + test_caa_get_cycles(); + + return exit_status(); +}