1; RUN: llvm-profgen --format=text --ignore-stack-samples --use-dwarf-correlation --perfscript=%S/Inputs/inline-cs-pseudoprobe.perfscript --binary=%S/Inputs/inline-cs-pseudoprobe.perfbin --output=%t --profile-summary-cold-count=0
2; RUN: FileCheck %s --input-file %t
3
4; CHECK:     main:1109:0
5; CHECK-NEXT: 0: 0
6; CHECK-NEXT: 2: 0
7; CHECK-NEXT: 1: foo:1109
8; CHECK-NEXT:  2: 14
9; CHECK-NEXT:  3: 15
10; CHECK-NEXT:  4: 0
11; CHECK-NEXT:  65526: 14
12; CHECK-NEXT:  3: bar:224
13; CHECK-NEXT:   1: 14
14; CHECK-NEXT:   65533: 14
15
16
17; clang -O3 -fuse-ld=lld -fpseudo-probe-for-profiling
18; -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Xclang -mdisable-tail-calls
19; -g test.c  -o a.out
20
21#include <stdio.h>
22
23int bar(int x, int y) {
24  if (x % 3) {
25    return x - y;
26  }
27  return x + y;
28}
29
30void foo() {
31  int s, i = 0;
32  while (i++ < 4000 * 4000)
33    if (i % 91) s = bar(i, s); else s += 30;
34  printf("sum is %d\n", s);
35}
36
37int main() {
38  foo();
39  return 0;
40}
41