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-cs-noprobe.perfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t --skip-symbolization --profile-summary-cold-count=0
4 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-UNWINDER
5 ; RUN: llvm-profgen --format=text --unsymbolized-profile=%t --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t1 --profile-summary-cold-count=0 --csspgo-preinliner=0 --gen-cs-nested-profile=0
6 ; RUN: FileCheck %s --input-file %t1
7 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-cs-noprobe.perfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t --profile-summary-cold-count=0 --ignore-stack-samples --csspgo-preinliner=0 --gen-cs-nested-profile=0
8 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-STRIP-CTX
9 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-cs-noprobe.aggperfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t --skip-symbolization --profile-summary-cold-count=0
10 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-AGG-UNWINDER
11 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-cs-noprobe.aggperfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t --profile-summary-cold-count=0 --csspgo-preinliner=0 --gen-cs-nested-profile=0
12 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-AGG
14 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-cs-noprobe.perfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t1 --profile-summary-cold-count=0
15 ; RUN: llvm-profgen --format=extbinary --perfscript=%S/Inputs/noinline-cs-noprobe.perfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t2 --profile-summary-cold-count=0 -use-md5
16 ; RUN: llvm-profdata show --sample -show-sec-info-only %t2 | FileCheck %s --check-prefix=CHECK-MD5
17 ; RUN: llvm-profdata show --sample -detailed-summary --function=dummy %t1 > %t.summary
18 ; RUN: llvm-profdata show --sample -detailed-summary --function=dummy %t2 > %t2.summary
19 ; RUN: diff -b %t.summary %t2.summary
22 ; CHECK-AGG:[main:1 @ foo]:108:0
24 ; CHECK-AGG: 3: 6 bar:6
25 ; CHECK-AGG:[main:1 @ foo:3 @ bar]:100:6
32 ; CHECK-AGG-UNWINDER: [main:1 @ foo]
33 ; CHECK-AGG-UNWINDER-NEXT: 3
34 ; CHECK-AGG-UNWINDER-NEXT: 5ff-62f:6
35 ; CHECK-AGG-UNWINDER-NEXT: 634-637:6
36 ; CHECK-AGG-UNWINDER-NEXT: 645-645:6
37 ; CHECK-AGG-UNWINDER-NEXT: 3
38 ; CHECK-AGG-UNWINDER-NEXT: 62f->5b0:6
39 ; CHECK-AGG-UNWINDER-NEXT: 637->645:6
40 ; CHECK-AGG-UNWINDER-NEXT: 645->5ff:6
41 ; CHECK-AGG-UNWINDER-NEXT: [main:1 @ foo:3 @ bar]
42 ; CHECK-AGG-UNWINDER-NEXT: 4
43 ; CHECK-AGG-UNWINDER-NEXT: 5b0-5c8:2
44 ; CHECK-AGG-UNWINDER-NEXT: 5b0-5d7:4
45 ; CHECK-AGG-UNWINDER-NEXT: 5dc-5e9:2
46 ; CHECK-AGG-UNWINDER-NEXT: 5e5-5e9:4
47 ; CHECK-AGG-UNWINDER-NEXT: 3
48 ; CHECK-AGG-UNWINDER-NEXT: 5c8->5dc:4
49 ; CHECK-AGG-UNWINDER-NEXT: 5d7->5e5:4
50 ; CHECK-AGG-UNWINDER-NEXT: 5e9->634:6
53 ; CHECK:[main:1 @ foo]:54:0
56 ; CHECK:[main:1 @ foo:3 @ bar]:50:3
63 ; CHECK-STRIP-CTX: foo:198:0
64 ; CHECK-STRIP-CTX: 0: 0
65 ; CHECK-STRIP-CTX: 1: 0
66 ; CHECK-STRIP-CTX: 2: 3
67 ; CHECK-STRIP-CTX: 3: 3 bar:3
68 ; CHECK-STRIP-CTX: 4: 0
69 ; CHECK-STRIP-CTX: 5: 0
70 ; CHECK-STRIP-CTX: bar:142:3
71 ; CHECK-STRIP-CTX: 0: 3
72 ; CHECK-STRIP-CTX: 1: 3
73 ; CHECK-STRIP-CTX: 2: 2
74 ; CHECK-STRIP-CTX: 4: 1
75 ; CHECK-STRIP-CTX: 5: 3
77 ; CHECK-UNWINDER: [main:1 @ foo]
78 ; CHECK-UNWINDER-NEXT: 3
79 ; CHECK-UNWINDER-NEXT: 5ff-62f:3
80 ; CHECK-UNWINDER-NEXT: 634-637:3
81 ; CHECK-UNWINDER-NEXT: 645-645:3
82 ; CHECK-UNWINDER-NEXT: 3
83 ; CHECK-UNWINDER-NEXT: 62f->5b0:3
84 ; CHECK-UNWINDER-NEXT: 637->645:3
85 ; CHECK-UNWINDER-NEXT: 645->5ff:3
86 ; CHECK-UNWINDER-NEXT: [main:1 @ foo:3 @ bar]
87 ; CHECK-UNWINDER-NEXT: 4
88 ; CHECK-UNWINDER-NEXT: 5b0-5c8:1
89 ; CHECK-UNWINDER-NEXT: 5b0-5d7:2
90 ; CHECK-UNWINDER-NEXT: 5dc-5e9:1
91 ; CHECK-UNWINDER-NEXT: 5e5-5e9:2
92 ; CHECK-UNWINDER-NEXT: 3
93 ; CHECK-UNWINDER-NEXT: 5c8->5dc:2
94 ; CHECK-UNWINDER-NEXT: 5d7->5e5:2
95 ; CHECK-UNWINDER-NEXT: 5e9->634:3
97 ; CHECK-MD5: NameTableSection {{.*}} {fixlenmd5}
104 ; clang -O0 -g test.c -o a.out
107 int bar(int x, int y) {
116 while (i++ < 4000 * 4000)
117 if (i % 91) s = bar(i, s); else s += 30;
118 printf("sum is %d\n", s);