summaryrefslogtreecommitdiff
path: root/simpleperf/runtest/function_indirect_recursive.cpp
blob: 5e70fd322d7a43b85dac2291fb10abbd3545a781 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
constexpr int LOOP_COUNT = 5000000;

void FunctionRecursiveTwo(int loop);

void FunctionRecursiveOne(int loop) {
  for (volatile int i = 0; i < LOOP_COUNT; ++i) {
  }
  if (loop >= 0) {
    FunctionRecursiveTwo(loop);
  }
}

void FunctionRecursiveTwo(int loop) {
  for (volatile int i = 0; i < LOOP_COUNT; ++i) {
  }
  if (loop > 0) {
    FunctionRecursiveOne(loop - 1);
  }
}

int main() {
  FunctionRecursiveOne(10);
  return 0;
}