llvm-profdata: Replace redundant tests with more targeted ones
[oota-llvm.git] / test / tools / llvm-profdata / raw-two-profiles.test
1 RUN: printf '\201rforpl\377' > %t-foo.profraw
2 RUN: printf '\1\0\0\0\0\0\0\0' >> %t-foo.profraw
3 RUN: printf '\1\0\0\0\0\0\0\0' >> %t-foo.profraw
4 RUN: printf '\1\0\0\0\0\0\0\0' >> %t-foo.profraw
5 RUN: printf '\3\0\0\0\0\0\0\0' >> %t-foo.profraw
6 RUN: printf '\0\0\4\0\1\0\0\0' >> %t-foo.profraw
7 RUN: printf '\0\0\4\0\2\0\0\0' >> %t-foo.profraw
8
9 RUN: printf '\3\0\0\0' >> %t-foo.profraw
10 RUN: printf '\1\0\0\0' >> %t-foo.profraw
11 RUN: printf '\1\0\0\0\0\0\0\0' >> %t-foo.profraw
12 RUN: printf '\0\0\4\0\2\0\0\0' >> %t-foo.profraw
13 RUN: printf '\0\0\4\0\1\0\0\0' >> %t-foo.profraw
14
15 RUN: printf '\023\0\0\0\0\0\0\0' >> %t-foo.profraw
16 RUN: printf 'foo' >> %t-foo.profraw
17
18 RUN: printf '\201rforpl\377' > %t-bar.profraw
19 RUN: printf '\1\0\0\0\0\0\0\0' >> %t-bar.profraw
20 RUN: printf '\1\0\0\0\0\0\0\0' >> %t-bar.profraw
21 RUN: printf '\2\0\0\0\0\0\0\0' >> %t-bar.profraw
22 RUN: printf '\3\0\0\0\0\0\0\0' >> %t-bar.profraw
23 RUN: printf '\0\0\6\0\1\0\0\0' >> %t-bar.profraw
24 RUN: printf '\0\0\6\0\2\0\0\0' >> %t-bar.profraw
25
26 RUN: printf '\3\0\0\0' >> %t-bar.profraw
27 RUN: printf '\2\0\0\0' >> %t-bar.profraw
28 RUN: printf '\2\0\0\0\0\0\0\0' >> %t-bar.profraw
29 RUN: printf '\0\0\6\0\2\0\0\0' >> %t-bar.profraw
30 RUN: printf '\0\0\6\0\1\0\0\0' >> %t-bar.profraw
31
32 RUN: printf '\067\0\0\0\0\0\0\0' >> %t-bar.profraw
33 RUN: printf '\101\0\0\0\0\0\0\0' >> %t-bar.profraw
34 RUN: printf 'bar' >> %t-bar.profraw
35
36 Versions of the profiles that are padded to eight byte alignment.
37 RUN: cat %t-foo.profraw > %t-foo-padded.profraw
38 RUN: printf '\0\0\0\0\0' >> %t-foo-padded.profraw
39 RUN: cat %t-bar.profraw > %t-bar-padded.profraw
40 RUN: printf '\0\0\0\0\0' >> %t-bar-padded.profraw
41
42 RUN: cat %t-foo.profraw %t-bar.profraw > %t-nopad.profraw
43 RUN: cat %t-foo-padded.profraw %t-bar.profraw > %t-pad-between.profraw
44 RUN: cat %t-foo-padded.profraw %t-bar-padded.profraw > %t-pad.profraw
45
46 RUN: llvm-profdata show %t-nopad.profraw -all-functions -counts | FileCheck %s
47 RUN: llvm-profdata show %t-pad-between.profraw -all-functions -counts | FileCheck %s
48 RUN: llvm-profdata show %t-pad.profraw -all-functions -counts | FileCheck %s
49
50 CHECK: Counters:
51 CHECK:   foo:
52 CHECK:     Hash: 0x0000000000000001
53 CHECK:     Counters: 1
54 CHECK:     Function count: 19
55 CHECK:     Block counts: []
56 CHECK:   bar:
57 CHECK:     Hash: 0x0000000000000002
58 CHECK:     Counters: 2
59 CHECK:     Function count: 55
60 CHECK:     Block counts: [65]
61 CHECK: Functions shown: 2
62 CHECK: Total functions: 2
63 CHECK: Maximum function count: 55
64 CHECK: Maximum internal block count: 65