1 ; RUN: llvm-profgen --format=text --perfscript=%S/Inputs/inline-noprobe.perfscript --binary=%S/Inputs/inline-noprobe.perfbin --output=%t --skip-symbolization
2 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-RAW-PROFILE
3 ; RUN: llvm-profgen --format=text --use-dwarf-correlation --perfscript=%S/Inputs/inline-noprobe.perfscript --binary=%S/Inputs/inline-noprobe.perfbin --output=%t --skip-symbolization
4 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK-RAW-PROFILE
5 ; RUN: llvm-profgen --format=text --unsymbolized-profile=%t --binary=%S/Inputs/inline-noprobe.perfbin --output=%t1
6 ; RUN: FileCheck %s --input-file %t1 --check-prefix=CHECK
7 ; RUN: llvm-profgen --format=text --unsymbolized-profile=%t --binary=%S/Inputs/inline-noprobe.perfbin --output=%t1 --update-total-samples
8 ; RUN: FileCheck %s --input-file %t1 --check-prefix=CHECK-UPDATE-TOTAL-SAMPLE
9 ; RUN: llvm-profgen --format=text --use-dwarf-correlation --perfscript=%S/Inputs/inline-noprobe.perfscript --binary=%S/Inputs/inline-noprobe.perfbin --output=%t
10 ; RUN: FileCheck %s --input-file %t --check-prefix=CHECK
11 ; RUN: echo -e "0\n0" > %t
12 ; RUN: llvm-profgen --format=text --unsymbolized-profile=%t --binary=%S/Inputs/inline-noprobe.perfbin --output=%t1 --fill-zero-for-all-funcs
13 ; RUN: FileCheck %s --input-file %t1 --check-prefix=CHECK-ALL-ZERO
14 ; RUN: llvm-profgen --format=text --unsymbolized-profile=%S/Inputs/out-of-bounds.raw.prof --binary=%S/Inputs/inline-noprobe.perfbin --output=%t1
15 ; RUN: FileCheck %s --input-file %t1 --check-prefix=CHECK-OB
32 CHECK-UPDATE-TOTAL-SAMPLE: main:292:0
33 CHECK-UPDATE-TOTAL-SAMPLE: 0: 0
34 CHECK-UPDATE-TOTAL-SAMPLE: 2: 0
35 CHECK-UPDATE-TOTAL-SAMPLE: 1: foo:292
36 CHECK-UPDATE-TOTAL-SAMPLE: 2.1: 42
37 CHECK-UPDATE-TOTAL-SAMPLE: 3: 62
38 CHECK-UPDATE-TOTAL-SAMPLE: 3.2: 21
39 CHECK-UPDATE-TOTAL-SAMPLE: 4: 0
40 CHECK-UPDATE-TOTAL-SAMPLE: 65526: 62
41 CHECK-UPDATE-TOTAL-SAMPLE: 3.1: bar:84
42 CHECK-UPDATE-TOTAL-SAMPLE: 1: 42
43 CHECK-UPDATE-TOTAL-SAMPLE: 65533: 42
44 CHECK-UPDATE-TOTAL-SAMPLE: 3.2: bar:21
45 CHECK-UPDATE-TOTAL-SAMPLE: 1: 21
47 CHECK-ALL-ZERO: bar:0:0
50 CHECK-ALL-ZERO: foo:0:0
52 CHECK-ALL-ZERO: 2.1: 0
54 CHECK-ALL-ZERO: 3.2: 0
56 CHECK-ALL-ZERO: 3.1: bar:0
58 CHECK-ALL-ZERO: 3.2: bar:0
61 CHECK-ALL-ZERO: main:0:0
64 CHECK-ALL-ZERO: 1: foo:0
65 CHECK-ALL-ZERO: 2.1: 0
67 CHECK-ALL-ZERO: 3.2: 0
69 CHECK-ALL-ZERO: 3.1: bar:0
71 CHECK-ALL-ZERO: 3.2: bar:0
75 CHECK-RAW-PROFILE-NEXT: 650-691:21
76 CHECK-RAW-PROFILE-NEXT: 669-677:20
77 CHECK-RAW-PROFILE-NEXT: 669-691:21
78 CHECK-RAW-PROFILE-NEXT: 2
79 CHECK-RAW-PROFILE-NEXT: 677->650:21
80 CHECK-RAW-PROFILE-NEXT: 691->669:43
88 ;CHECK-OB: 3.1: bar:13
91 ;CHECK-OB: 3.2: bar:24
103 ;CHECK-OB: 3.1: bar:13
106 ;CHECK-OB: 3.2: bar:9
113 ; clang -O3 -g -fdebug-info-for-profiling test.c -o a.out
116 int bar(int x, int y) {
125 while (i++ < 4000 * 4000)
126 if (i % 3) s = bar(i, s); else s += bar(s, i);
127 printf("sum is %d\n", s);