1 /* 2 * Copyright (c) 2021 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 DUMP_CATCHER_DEMO_H 17 #define DUMP_CATCHER_DEMO_H 18 19 #define NOINLINE __attribute__((noinline)) 20 21 #define GEN_TEST_FUNCTION(FuncNumA, FuncNumB) \ 22 __attribute__((optnone)) int TestFunc##FuncNumA() \ 23 { \ 24 return TestFunc##FuncNumB(); \ 25 } 26 27 // test functions for callstack depth test 28 int TestFunc0(void); 29 int TestFunc1(void); 30 int TestFunc2(void); 31 int TestFunc3(void); 32 int TestFunc4(void); 33 int TestFunc5(void); 34 int TestFunc6(void); 35 int TestFunc7(void); 36 int TestFunc8(void); 37 int TestFunc9(void); 38 39 GEN_TEST_FUNCTION(0, 1) 40 GEN_TEST_FUNCTION(1, 2) 41 GEN_TEST_FUNCTION(2, 3) 42 GEN_TEST_FUNCTION(3, 4) 43 GEN_TEST_FUNCTION(4, 5) 44 GEN_TEST_FUNCTION(5, 6) 45 GEN_TEST_FUNCTION(6, 7) 46 GEN_TEST_FUNCTION(7, 8) 47 GEN_TEST_FUNCTION(8, 9) 48 49 #endif // DUMP_CATCHER_DEMO_H 50