1 /*
2  * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef MULTITHREAD_CONSTRUCTOR_H
17 #define MULTITHREAD_CONSTRUCTOR_H
18 
19 #define NOINLINE __attribute__((noinline))
20 
21 #define GEN_TEST_FUNCTION(FuncNumA, FuncNumB)          \
22     __attribute__((noinline)) int TestFunc##FuncNumA() \
23     {                                                  \
24         return TestFunc##FuncNumB();                   \
25     }
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 int MultiThreadConstructor(const int threadNum);
31 int MultiThreadConstructorForThreadCrash(const int threadNum);
32 #ifdef __cplusplus
33 }
34 #endif
35 
36 // test functions for callstack depth test
37 int TestFunc0(void);
38 int TestFunc1(void);
39 int TestFunc2(void);
40 int TestFunc3(void);
41 int TestFunc4(void);
42 int TestFunc5(void);
43 int TestFunc6(void);
44 int TestFunc7(void);
45 int TestFunc8(void);
46 int TestFunc9(void);
47 int TestFunc10(void);
48 int TestFunc11(void);
49 int TestFunc12(void);
50 int TestFunc13(void);
51 int TestFunc14(void);
52 int TestFunc15(void);
53 int TestFunc16(void);
54 int TestFunc17(void);
55 int TestFunc18(void);
56 int TestFunc19(void);
57 int TestFunc20(void);
58 int TestFunc21(void);
59 int TestFunc22(void);
60 int TestFunc23(void);
61 int TestFunc24(void);
62 int TestFunc25(void);
63 int TestFunc26(void);
64 int TestFunc27(void);
65 int TestFunc28(void);
66 int TestFunc29(void);
67 int TestFunc30(void);
68 int TestFunc31(void);
69 int TestFunc32(void);
70 int TestFunc33(void);
71 int TestFunc34(void);
72 int TestFunc35(void);
73 int TestFunc36(void);
74 int TestFunc37(void);
75 int TestFunc38(void);
76 int TestFunc39(void);
77 int TestFunc40(void);
78 int TestFunc41(void);
79 int TestFunc42(void);
80 int TestFunc43(void);
81 int TestFunc44(void);
82 int TestFunc45(void);
83 int TestFunc46(void);
84 int TestFunc47(void);
85 int TestFunc48(void);
86 int TestFunc49(void);
87 int TestFunc50(void);
88 int TestFunc51(void);
89 int TestFunc52(void);
90 int TestFunc53(void);
91 int TestFunc54(void);
92 int TestFunc55(void);
93 int TestFunc56(void);
94 int TestFunc57(void);
95 int TestFunc58(void);
96 int TestFunc59(void);
97 int TestFunc60(void);
98 int TestFunc61(void);
99 int TestFunc62(void);
100 int TestFunc63(void);
101 int TestFunc64(void);
102 int TestFunc65(void);
103 int TestFunc66(void);
104 int TestFunc67(void);
105 int TestFunc68(void);
106 int TestFunc69(void);
107 int TestFunc70(void);
108 
109 #endif // MULTITHREAD_CONSTRUCTOR_H
110