Debian Codegraph @

simpleperf/runtest/function_indirect_recursive.cpp

raw
1 constexpr int LOOP_COUNT = 5000000;
2
3 void FunctionRecursiveTwo(int loop);
4
5 void FunctionRecursiveOne(int loop) {
6 for (volatile int i = 0; i < LOOP_COUNT; ++i) {
7 }
8 if (loop >= 0) {
9 FunctionRecursiveTwo(loop);
10 }
11 }
12
13 void FunctionRecursiveTwo(int loop) {
14 for (volatile int i = 0; i < LOOP_COUNT; ++i) {
15 }
16 if (loop > 0) {
17 FunctionRecursiveOne(loop - 1);
18 }
19 }
20
21 int main() {
22 while (true) {
23 FunctionRecursiveOne(10);
24 }
25 return 0;
26 }