1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * xarray.c: Userspace shim for XArray test-suite
4  * Copyright (c) 2018 Matthew Wilcox <willy@infradead.org>
5  */
6 
7 #define XA_DEBUG
8 #include "test.h"
9 
10 #define module_init(x)
11 #define module_exit(x)
12 #define MODULE_AUTHOR(x)
13 #define MODULE_LICENSE(x)
14 #define dump_stack()	assert(0)
15 
16 #include "../../../lib/xarray.c"
17 #undef XA_DEBUG
18 #include "../../../lib/test_xarray.c"
19 
xarray_tests(void)20 void xarray_tests(void)
21 {
22 	xarray_checks();
23 	xarray_exit();
24 }
25 
main(void)26 int __weak main(void)
27 {
28 	radix_tree_init();
29 	xarray_tests();
30 	radix_tree_cpu_dead(1);
31 	rcu_barrier();
32 	if (nr_allocated)
33 		printf("nr_allocated = %d\n", nr_allocated);
34 	return 0;
35 }
36