summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/profile/Inputs/instrprof-order-file.c
blob: 9251a8e25524240e36c657629f176a648f7a5c68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void __llvm_profile_initialize_file(void);
int __llvm_orderfile_dump(void);

__attribute__((noinline)) int f(int a);

__attribute__((noinline)) int g(int a);

int main(int argc, const char *argv[]) {
  int a = f(argc);
  int t = 0;
  for (int i = 0; i < argc; i++)
    t += g(a);
  f(t);
  __llvm_profile_initialize_file();
  __llvm_orderfile_dump();
  return 0;
}
OpenPOWER on IntegriCloud