1 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-pseudoprobe.perfscript --binary=%S/Inputs/inline-cs-pseudoprobe.perfbin --output=%t --skip-symbolization --profile-summary-cold-count=0 --use-offset=0
2 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-UNWINDER
3 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-pseudoprobe.perfscript --binary=%S/Inputs/inline-cs-pseudoprobe.perfbin --output=%t --skip-symbolization --profile-summary-cold-count=0 --use-offset=1
4 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-UNWINDER-OFFSET
5 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-pseudoprobe.perfscript --binary=%S/Inputs/inline-cs-pseudoprobe.perfbin --output=%t --skip-symbolization --profile-summary-cold-count=0 --use-offset=1 --use-first-loadable-segment-as-base=1
6 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-UNWINDER-OFFSET2
7 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-cs-pseudoprobe.perfscript --binary=%S/Inputs/inline-cs-pseudoprobe.perfbin --output=%t --profile-summary-cold-count=0 --csspgo-preinliner=0 --gen-cs-nested-profile=0
8 ; RUN: FileCheck %s --input-file %t
10 ; CHECK: [main:2 @ foo]:74:0
18 ; CHECK-NEXT: 8: 14 bar:14
20 ; CHECK-NEXT: !CFGChecksum: 563088904013236
21 ; CHECK:[main:2 @ foo:8 @ bar]:28:14
24 ; CHECK-NEXT: !CFGChecksum: 72617220756
27 ; CHECK-UNWINDER-NEXT: 201800-201858:1
28 ; CHECK-UNWINDER-NEXT: 20180e-20182b:1
29 ; CHECK-UNWINDER-NEXT: 20180e-201858:13
30 ; CHECK-UNWINDER-NEXT: 2
31 ; CHECK-UNWINDER-NEXT: 20182b->201800:1
32 ; CHECK-UNWINDER-NEXT: 201858->20180e:15
35 ; CHECK-UNWINDER-OFFSET: 3
36 ; CHECK-UNWINDER-OFFSET-NEXT: 800-858:1
37 ; CHECK-UNWINDER-OFFSET-NEXT: 80e-82b:1
38 ; CHECK-UNWINDER-OFFSET-NEXT: 80e-858:13
39 ; CHECK-UNWINDER-OFFSET-NEXT: 2
40 ; CHECK-UNWINDER-OFFSET-NEXT: 82b->800:1
41 ; CHECK-UNWINDER-OFFSET-NEXT: 858->80e:15
43 ; CHECK-UNWINDER-OFFSET2: 3
44 ; CHECK-UNWINDER-OFFSET2-NEXT: 1800-1858:1
45 ; CHECK-UNWINDER-OFFSET2-NEXT: 180e-182b:1
46 ; CHECK-UNWINDER-OFFSET2-NEXT: 180e-1858:13
47 ; CHECK-UNWINDER-OFFSET2-NEXT: 2
48 ; CHECK-UNWINDER-OFFSET2-NEXT: 182b->1800:1
49 ; CHECK-UNWINDER-OFFSET2-NEXT: 1858->180e:15
51 ; clang -O3 -fuse-ld=lld -fpseudo-probe-for-profiling
52 ; -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Xclang -mdisable-tail-calls
57 int bar(int x, int y) {
66 while (i++ < 4000 * 4000)
67 if (i % 91) s = bar(i, s); else s += 30;
68 printf("sum is %d\n", s);