summaryrefslogtreecommitdiff
path: root/simpleperf/runtest/two_functions.cpp
blob: 1d3e3893fc7aac3063cc8c5e4ba5b462bd178df9 (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
#include <stdlib.h>

constexpr int LOOP_COUNT = 100000000;

volatile int a[2];
void Function1() {
  volatile int* p = a + atoi("0");
  for (int i = 0; i < LOOP_COUNT; ++i) {
    *p = i;
  }
}

void Function2() {
  volatile int* p = a + atoi("1");
  for (int i = 0; i < LOOP_COUNT; ++i) {
    *p = i;
  }
}

int main() {
  Function1();
  Function2();
  return 0;
}