llvm/test/tools/llvm-cov/showTemplateInstantiations.cpp
Vedant Kumar bdd649ed06 [llvm-cov] Change some FileCheck prefixes to make tests reusable (NFC)
I'm planning on extending these two tests with checks that validate
html coverage reports. Make it easier to extend them by not using a
prefix called "CHECK".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274143 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-29 17:47:08 +00:00

41 lines
2.5 KiB
C++

// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence %s | FileCheck -check-prefixes=SHARED,ALL %s
// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -filename-equivalence -name=_Z4funcIbEiT_ %s | FileCheck -check-prefixes=SHARED,FILTER %s
// before coverage // ALL: | [[@LINE]]|// before
// FILTER-NOT: | [[@LINE-1]]|// before
template<typename T> // ALL: | [[@LINE]]|template<typename T>
int func(T x) { // ALL-NEXT: 2| [[@LINE]]|int func(T x) {
if(x) // ALL-NEXT: 2| [[@LINE]]| if(x)
return 0; // ALL-NEXT: 1| [[@LINE]]| return 0;
else // ALL-NEXT: 2| [[@LINE]]| else
return 1; // ALL-NEXT: 1| [[@LINE]]| return 1;
int j = 1; // ALL-NEXT: 0| [[@LINE]]| int j = 1;
} // ALL-NEXT: 2| [[@LINE]]|}
// SHARED: {{^ *(\| )?}}_Z4funcIbEiT_:
// SHARED-NEXT: 1| [[@LINE-9]]|int func(T x) {
// SHARED-NEXT: 1| [[@LINE-9]]| if(x)
// SHARED-NEXT: 1| [[@LINE-9]]| return 0;
// SHARED-NEXT: 1| [[@LINE-9]]| else
// SHARED-NEXT: 0| [[@LINE-9]]| return 1;
// SHARED-NEXT: 0| [[@LINE-9]]| int j = 1;
// SHARED-NEXT: 1| [[@LINE-9]]|}
// ALL: {{^ *}}| _Z4funcIiEiT_:
// FILTER-NOT: {{^ *(\| )?}} _Z4funcIiEiT_:
// ALL-NEXT: 1| [[@LINE-19]]|int func(T x) {
// ALL-NEXT: 1| [[@LINE-19]]| if(x)
// ALL-NEXT: 0| [[@LINE-19]]| return 0;
// ALL-NEXT: 1| [[@LINE-19]]| else
// ALL-NEXT: 1| [[@LINE-19]]| return 1;
// ALL-NEXT: 0| [[@LINE-19]]| int j = 1;
// ALL-NEXT: 1| [[@LINE-19]]|}
int main() { // ALL: 1| [[@LINE]]|int main() {
func<int>(0); // ALL-NEXT: 1| [[@LINE]]| func<int>(0);
func<bool>(true); // ALL-NEXT: 1| [[@LINE]]| func<bool>(true);
return 0; // ALL-NEXT: 1| [[@LINE]]| return 0;
} // ALL-NEXT: 1| [[@LINE]]|}
// after coverage // ALL-NEXT: | [[@LINE]]|// after
// FILTER-NOT: | [[@LINE-1]]|// after