1 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-cs-noprobe.perfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t --show-unwinder-output --profile-summary-cold-count=0 | FileCheck %s --check-prefix=CHECK-UNWINDER
2 ; RUN: FileCheck %s --input-file %t
3 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/noinline-cs-noprobe.aggperfscript --binary=%S/Inputs/noinline-cs-noprobe.perfbin --output=%t --show-unwinder-output --profile-summary-cold-count=0 | FileCheck %s --check-prefix=CHECK-AGG-UNWINDER
4 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-AGG
6 ; CHECK-AGG:[main:1 @ foo]:108:0
8 ; CHECK-AGG: 3: 6 bar:6
9 ; CHECK-AGG:[main:1 @ foo:3 @ bar]:100:6
16 ; CHECK-AGG-UNWINDER: Binary(noinline-cs-noprobe.perfbin)'s Range Counter:
17 ; CHECK-AGG-UNWINDER: main:1 @ foo
18 ; CHECK-AGG-UNWINDER: (5ff, 62f): 6
19 ; CHECK-AGG-UNWINDER: (634, 637): 6
20 ; CHECK-AGG-UNWINDER: (645, 645): 6
21 ; CHECK-AGG-UNWINDER: main:1 @ foo:3 @ bar
22 ; CHECK-AGG-UNWINDER: (5b0, 5c8): 2
23 ; CHECK-AGG-UNWINDER: (5b0, 5d7): 4
24 ; CHECK-AGG-UNWINDER: (5dc, 5e9): 2
25 ; CHECK-AGG-UNWINDER: (5e5, 5e9): 4
27 ; CHECK-AGG-UNWINDER: Binary(noinline-cs-noprobe.perfbin)'s Branch Counter:
28 ; CHECK-AGG-UNWINDER: main:1 @ foo
29 ; CHECK-AGG-UNWINDER: (62f, 5b0): 6
30 ; CHECK-AGG-UNWINDER: (637, 645): 6
31 ; CHECK-AGG-UNWINDER: (645, 5ff): 6
32 ; CHECK-AGG-UNWINDER: main:1 @ foo:3 @ bar
33 ; CHECK-AGG-UNWINDER: (5c8, 5dc): 4
34 ; CHECK-AGG-UNWINDER: (5d7, 5e5): 4
35 ; CHECK-AGG-UNWINDER: (5e9, 634): 6
39 ; CHECK:[main:1 @ foo]:54:0
42 ; CHECK:[main:1 @ foo:3 @ bar]:50:3
49 ; CHECK-UNWINDER: Binary(noinline-cs-noprobe.perfbin)'s Range Counter:
50 ; CHECK-UNWINDER: main:1 @ foo
51 ; CHECK-UNWINDER: (5ff, 62f): 3
52 ; CHECK-UNWINDER: (634, 637): 3
53 ; CHECK-UNWINDER: (645, 645): 3
54 ; CHECK-UNWINDER: main:1 @ foo:3 @ bar
55 ; CHECK-UNWINDER: (5b0, 5c8): 1
56 ; CHECK-UNWINDER: (5b0, 5d7): 2
57 ; CHECK-UNWINDER: (5dc, 5e9): 1
58 ; CHECK-UNWINDER: (5e5, 5e9): 2
60 ; CHECK-UNWINDER: Binary(noinline-cs-noprobe.perfbin)'s Branch Counter:
61 ; CHECK-UNWINDER: main:1 @ foo
62 ; CHECK-UNWINDER: (62f, 5b0): 3
63 ; CHECK-UNWINDER: (637, 645): 3
64 ; CHECK-UNWINDER: (645, 5ff): 3
65 ; CHECK-UNWINDER: main:1 @ foo:3 @ bar
66 ; CHECK-UNWINDER: (5c8, 5dc): 2
67 ; CHECK-UNWINDER: (5d7, 5e5): 2
68 ; CHECK-UNWINDER: (5e9, 634): 3
76 ; clang -O0 -g test.c -o a.out
79 int bar(int x, int y) {
88 while (i++ < 4000 * 4000)
89 if (i % 91) s = bar(i, s); else s += 30;
90 printf("sum is %d\n", s);