1 ;; The test fails on Windows. Fix it before removing the following requirement.
2 ; REQUIRES: x86_64-linux
3 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-tailcall-probe.perfscript --binary=%S/Inputs/noinline-tailcall-probe.perfbin --output=%t --profile-summary-hot-count=0 --csspgo-preinliner=0 --gen-cs-nested-profile=0 --infer-missing-frames=0
4 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-NOINFER
5 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-tailcall-probe.perfscript --binary=%S/Inputs/noinline-tailcall-probe.perfbin --output=%t --profile-summary-hot-count=0 --csspgo-preinliner=0 --gen-cs-nested-profile=0 --infer-missing-frames=1
6 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-INFER
9 ; CHECK-NOINFER: [main:5 @ foo]:48:1
10 ; CHECK-NOINFER-NEXT: 1: 1
11 ; CHECK-NOINFER-NEXT: 2: 10
12 ; CHECK-NOINFER-NEXT: 3: 9
13 ; CHECK-NOINFER-NEXT: 4: 9
14 ; CHECK-NOINFER-NEXT: 5: 0
15 ; CHECK-NOINFER-NEXT: 6: 9
16 ; CHECK-NOINFER-NEXT: 7: 1
17 ; CHECK-NOINFER-NEXT: 8: 9 bar:9
18 ; CHECK-NOINFER-NEXT: !CFGChecksum: 281613927302580
19 ; CHECK-NOINFER-NEXT:[main:5 @ foo:8 @ bar]:18:9
20 ; CHECK-NOINFER-NEXT: 1: 9
21 ; CHECK-NOINFER-NEXT: 4: 9
22 ; CHECK-NOINFER-NEXT: !CFGChecksum: 72617220756
23 ; CHECK-NOINFER-NEXT:[main]:3:0
24 ; CHECK-NOINFER-NEXT: 1: 0
25 ; CHECK-NOINFER-NEXT: 2: 1
26 ; CHECK-NOINFER-NEXT: 3: 1
27 ; CHECK-NOINFER-NEXT: 4: 0
28 ; CHECK-NOINFER-NEXT: 5: 1 go:1
29 ; CHECK-NOINFER-NEXT: 6: 0
30 ; CHECK-NOINFER-NEXT: !CFGChecksum: 563022115997000
31 ; CHECK-NOINFER-NEXT:[main:5 @ go]:2:1
32 ; CHECK-NOINFER-NEXT: 1: 1
33 ; CHECK-NOINFER-NEXT: 2: 1 foo:1
34 ; CHECK-NOINFER-NEXT: !CFGChecksum: 281479271677951
36 ; CHECK-INFER: [main:5 @ go:2 @ foo]:48:1
37 ; CHECK-INFER-NEXT: 1: 1
38 ; CHECK-INFER-NEXT: 2: 10
39 ; CHECK-INFER-NEXT: 3: 9
40 ; CHECK-INFER-NEXT: 4: 9
41 ; CHECK-INFER-NEXT: 5: 0
42 ; CHECK-INFER-NEXT: 6: 9
43 ; CHECK-INFER-NEXT: 7: 1
44 ; CHECK-INFER-NEXT: 8: 9 bar:9
45 ; CHECK-INFER-NEXT: !CFGChecksum: 281613927302580
46 ; CHECK-INFER-NEXT:[main:5 @ go:2 @ foo:8 @ bar]:18:9
47 ; CHECK-INFER-NEXT: 1: 9
48 ; CHECK-INFER-NEXT: 4: 9
49 ; CHECK-INFER-NEXT: !CFGChecksum: 72617220756
50 ; CHECK-INFER-NEXT:[main]:3:0
51 ; CHECK-INFER-NEXT: 1: 0
52 ; CHECK-INFER-NEXT: 2: 1
53 ; CHECK-INFER-NEXT: 3: 1
54 ; CHECK-INFER-NEXT: 4: 0
55 ; CHECK-INFER-NEXT: 5: 1 go:1
56 ; CHECK-INFER-NEXT: 6: 0
57 ; CHECK-INFER-NEXT: !CFGChecksum: 563022115997000
58 ; CHECK-INFER-NEXT:[main:5 @ go]:2:1
59 ; CHECK-INFER-NEXT: 1: 1
60 ; CHECK-INFER-NEXT: 2: 1 foo:1
61 ; CHECK-INFER-NEXT: !CFGChecksum: 281479271677951
64 ; clang -O3 -fexperimental-new-pass-manager -fuse-ld=lld -fpseudo-probe-for-profiling
65 ; -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g test.c -o a.out
70 int bar(int x, int y) {
80 if (i % 91) s = bar(i, s); else s += 30;
92 printf("sum is %d\n", s);