xref: /llvm-project/llvm/test/tools/llvm-cov/cov-comdat.test (revision e181a6aeddc26ef0512b2dba94db6360ba32f2ff)
1# The binary contains two (merged) covmap sections which
2# have duplicate CovMapRecords from comdat (template instantiation).
3# This test makes sure the reader reads it properly. It also
4# tests that the coverage data from different instantiations
5# of the same template function are properly merged in show
6# output.
7
8// RUN: llvm-cov show %S/Inputs/binary-formats.v1.linux64l -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/tmp,%S/Inputs %S/Inputs/instrprof-comdat.h -dump 2> %t.err | FileCheck --check-prefix=HEADER %S/Inputs/instrprof-comdat.h
9// RUN: FileCheck --check-prefix=ERROR -input-file %t.err %s
10// ERROR: hash-mismatch: No profile record found for 'main' with hash = 0xa
11
12// RUN: llvm-cov show %S/Inputs/binary-formats.v2.linux64l -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/root/llvm/test/tools,%S/.. %S/Inputs/instrprof-comdat.h | FileCheck --check-prefix=HEADER %S/Inputs/instrprof-comdat.h
13// RUN: llvm-cov show %S/Inputs/binary-formats.v2.linux32l -instr-profile %S/Inputs/elf_binary_comdat.profdata -path-equivalence=/root/llvm/R/../test/tools,%S/.. %S/Inputs/instrprof-comdat.h | FileCheck --check-prefix=HEADER %S/Inputs/instrprof-comdat.h
14