blob: 6371fcf1768456873fa0d8dbe7819faeef4ecf38 [file] [log] [blame]
Ilya Leoshkevich90c53182022-01-19 19:26:38 +01001/* SPDX-License-Identifier: GPL-2.0+ */
2#ifndef TEST_MODULES_H
3#define TEST_MODULES_H
4
5#define __REPEAT_10000_3(f, x) \
6 f(x ## 0); \
7 f(x ## 1); \
8 f(x ## 2); \
9 f(x ## 3); \
10 f(x ## 4); \
11 f(x ## 5); \
12 f(x ## 6); \
13 f(x ## 7); \
14 f(x ## 8); \
15 f(x ## 9)
16#define __REPEAT_10000_2(f, x) \
17 __REPEAT_10000_3(f, x ## 0); \
18 __REPEAT_10000_3(f, x ## 1); \
19 __REPEAT_10000_3(f, x ## 2); \
20 __REPEAT_10000_3(f, x ## 3); \
21 __REPEAT_10000_3(f, x ## 4); \
22 __REPEAT_10000_3(f, x ## 5); \
23 __REPEAT_10000_3(f, x ## 6); \
24 __REPEAT_10000_3(f, x ## 7); \
25 __REPEAT_10000_3(f, x ## 8); \
26 __REPEAT_10000_3(f, x ## 9)
27#define __REPEAT_10000_1(f, x) \
28 __REPEAT_10000_2(f, x ## 0); \
29 __REPEAT_10000_2(f, x ## 1); \
30 __REPEAT_10000_2(f, x ## 2); \
31 __REPEAT_10000_2(f, x ## 3); \
32 __REPEAT_10000_2(f, x ## 4); \
33 __REPEAT_10000_2(f, x ## 5); \
34 __REPEAT_10000_2(f, x ## 6); \
35 __REPEAT_10000_2(f, x ## 7); \
36 __REPEAT_10000_2(f, x ## 8); \
37 __REPEAT_10000_2(f, x ## 9)
38#define REPEAT_10000(f) \
39 __REPEAT_10000_1(f, 0); \
40 __REPEAT_10000_1(f, 1); \
41 __REPEAT_10000_1(f, 2); \
42 __REPEAT_10000_1(f, 3); \
43 __REPEAT_10000_1(f, 4); \
44 __REPEAT_10000_1(f, 5); \
45 __REPEAT_10000_1(f, 6); \
46 __REPEAT_10000_1(f, 7); \
47 __REPEAT_10000_1(f, 8); \
48 __REPEAT_10000_1(f, 9)
49
Ilya Leoshkeviche286f232022-01-31 14:17:11 +010050#define DECLARE_RETURN(i) int test_modules_return_ ## i(void)
51REPEAT_10000(DECLARE_RETURN);
52
Ilya Leoshkevich90c53182022-01-19 19:26:38 +010053#endif