xref: /llvm-project/llvm/test/tools/llvm-cov/gcov/tmpl.test (revision 1c99f650a7ac90c80ffd4830e05cd3408e64f42c)
1# Check that the coverage statistics for template functions are calculated as expected.
2
3RUN: rm -rf %t
4RUN: mkdir %t
5RUN: cd %t
6RUN: cp %p/Inputs/tmpl* .
7
8RUN: llvm-cov gcov tmpl.cpp -f | FileCheck %s --check-prefix=F
9RUN: llvm-cov gcov tmpl.cpp -t | FileCheck %s --check-prefix=T
10
11F:      Function '_Z4testILi1EEiv'
12F-NEXT: Lines executed:100.00% of 1
13F:      Function '_Z4testILi2EEiv'
14F-NEXT: Lines executed:100.00% of 1
15
16T:      -: 1:template <int N>
17T-NEXT: 2: 2:int test() { return N; }
18T-NEXT: -: 3:
19T-NEXT: 1: 4:int main() { return test<1>() + test<2>(); }
20