blob: dbcc74e1284f992ffefba2e7d8b90de7da015ddd [file] [log] [blame]
Diego Novilloaae1ed82015-10-08 19:40:37 +00001The input gcov file has been generated on a little endian machine. Expect
2failures on big endian systems.
3
4XFAIL: powerpc64-, s390x, mips-, mips64-, sparc
5
6Tests for sample profiles encoded in GCC's gcov format.
7
81- Show all functions. This profile has a single main() function with several
9 inlined callees.
10RUN: llvm-profdata show --sample %p/Inputs/gcc-sample-profile.gcov | FileCheck %s --check-prefix=SHOW1
11SHOW1: Function: main: 364084, 0, 6 sampled lines
Diego Novillo8e415a82015-11-13 20:24:28 +000012SHOW1: 2.3: inlined callee: _Z3fool: 243786, 0, 3 sampled lines
13SHOW1: 1.3: inlined callee: _Z3bari: 0, 0, 2 sampled lines
Diego Novillo8e415a82015-11-13 20:24:28 +000014SHOW1: 1.7: inlined callee: _Z3bari: 98558, 0, 2 sampled lines
Diego Novilloef548d22015-11-19 15:33:08 +000015SHOW1: 1.8: inlined callee: _Z3bari: 0, 0, 2 sampled lines
Diego Novilloaae1ed82015-10-08 19:40:37 +000016
172- Convert the profile to text encoding and check that they are both
18 identical.
19RUN: llvm-profdata merge --sample %p/Inputs/gcc-sample-profile.gcov --text -o - | llvm-profdata show --sample - -o %t-text
20RUN: llvm-profdata show --sample %p/Inputs/gcc-sample-profile.gcov -o %t-gcov
21RUN: diff %t-text %t-gcov
22
234- Merge the gcov and text encodings of the profile and check that the
24 counters have doubled.
25RUN: llvm-profdata merge --sample --text %p/Inputs/gcc-sample-profile.gcov -o %t-gcov
26RUN: llvm-profdata merge --sample --text %p/Inputs/gcc-sample-profile.gcov %t-gcov -o - | FileCheck %s --check-prefix=MERGE1
27MERGE1: main:728168:0
28MERGE1: 2.3: 120298
29MERGE1: 2.3: _Z3fool:487572