Index: test/profile/Inputs/extern_template.h =================================================================== --- test/profile/Inputs/extern_template.h +++ test/profile/Inputs/extern_template.h @@ -1,10 +1,10 @@ template struct Test { Test() : M(10) {} - void doIt(int N) { // CHECK: 2| [[@LINE]]| void doIt - if (N > 10) { // CHECK: 2| [[@LINE]]| if (N > 10) { - M += 2; // CHECK: 1| [[@LINE]]| M += 2; - } else // CHECK: 1| [[@LINE]]| } else - M -= 2; // CHECK: 1| [[@LINE]]| M -= 2; + void doIt(int N) { // CHECK: [[@LINE]]| 2| void doIt + if (N > 10) { // CHECK: [[@LINE]]| 2| if (N > 10) { + M += 2; // CHECK: [[@LINE]]| 1| M += 2; + } else // CHECK: [[@LINE]]| 1| } else + M -= 2; // CHECK: [[@LINE]]| 1| M -= 2; } T M; }; Index: test/profile/Inputs/instrprof-comdat.h =================================================================== --- test/profile/Inputs/instrprof-comdat.h +++ test/profile/Inputs/instrprof-comdat.h @@ -12,12 +12,12 @@ T t; }; -template T FOO::DoIt(T ti) { // HEADER: 2| [[@LINE]]|template - for (T I = 0; I < ti; I++) { // HEADER: 22| [[@LINE]]| for (T - t += I; // HEADER: 20| [[@LINE]]| t += I; - if (I > ti / 2) // HEADER: 20| [[@LINE]]| if (I > ti - t -= 1; // HEADER: 8| [[@LINE]]| t -= 1; - } // HEADER: 10| [[@LINE]]| } - // HEADER: 1| [[@LINE]]| - return t; // HEADER: 1| [[@LINE]]| return t; +template T FOO::DoIt(T ti) { // HEADER: [[@LINE]]| 2|template + for (T I = 0; I < ti; I++) { // HEADER: [[@LINE]]| 22| for (T + t += I; // HEADER: [[@LINE]]| 20| t += I; + if (I > ti / 2) // HEADER: [[@LINE]]| 20| if (I > ti + t -= 1; // HEADER: [[@LINE]]| 8| t -= 1; + } // HEADER: [[@LINE]]| 10| } + // HEADER: [[@LINE]]| 1| + return t; // HEADER: [[@LINE]]| 1| return t; } Index: test/profile/Inputs/instrprof-dynamic-a.cpp =================================================================== --- test/profile/Inputs/instrprof-dynamic-a.cpp +++ test/profile/Inputs/instrprof-dynamic-a.cpp @@ -1,7 +1,7 @@ #include "instrprof-dynamic-header.h" -void a() { // COV: 1| [[@LINE]]|void a - if (true) { // COV: 1| [[@LINE]]| if - bar(1); // COV: 1| [[@LINE]]| bar - bar(1); // COV: 1| [[@LINE]]| bar - } // COV: 1| [[@LINE]]| } +void a() { // COV: [[@LINE]]| 1|void a + if (true) { // COV: [[@LINE]]| 1| if + bar(1); // COV: [[@LINE]]| 1| bar + bar(1); // COV: [[@LINE]]| 1| bar + } // COV: [[@LINE]]| 1| } } Index: test/profile/Linux/coverage_ctors.cpp =================================================================== --- test/profile/Linux/coverage_ctors.cpp +++ test/profile/Linux/coverage_ctors.cpp @@ -15,9 +15,9 @@ }; struct Derived : public Base { - Derived(const Derived &) = default; // CHECK: 2| [[@LINE]]| Derived(const Derived &) = default; - Derived(Derived &&) = default; // CHECK: 1| [[@LINE]]| Derived(Derived &&) = default; - Derived() = default; // CHECK: 1| [[@LINE]]| Derived() = default + Derived(const Derived &) = default; // CHECK: [[@LINE]]| 2| Derived(const Derived &) = default; + Derived(Derived &&) = default; // CHECK: [[@LINE]]| 1| Derived(Derived &&) = default; + Derived() = default; // CHECK: [[@LINE]]| 1| Derived() = default }; Derived dd; @@ -27,6 +27,6 @@ Derived dd4(static_cast(dd3)); if (dd.B != 0 || dd2.B != 5 || dd3.B != 10 || dd4.B != 20) - return 1; // CHECK: 0| [[@LINE]]| return 1; + return 1; // CHECK: [[@LINE]]| 0| return 1; return 0; } Index: test/profile/Linux/coverage_dtor.cpp =================================================================== --- test/profile/Linux/coverage_dtor.cpp +++ test/profile/Linux/coverage_dtor.cpp @@ -12,7 +12,7 @@ struct Derived : public Base { Derived(int K) : Base(K) {} - ~Derived() = default; // CHECK: 2| [[@LINE]]| ~Derived() = default; + ~Derived() = default; // CHECK: [[@LINE]]| 2| ~Derived() = default; }; int main() { @@ -21,6 +21,6 @@ Derived dd2(90); } if (g != 0) - return 1; // CHECK: 0| [[@LINE]]| return 1; + return 1; // CHECK: [[@LINE]]| 0| return 1; return 0; } Index: test/profile/Linux/coverage_test.cpp =================================================================== --- test/profile/Linux/coverage_test.cpp +++ test/profile/Linux/coverage_test.cpp @@ -17,19 +17,19 @@ // RUN: llvm-profdata merge -o %t.pie.profdata %t.pie.profraw // RUN: llvm-cov show %t.pie -instr-profile %t.pie.profdata -filename-equivalence 2>&1 | FileCheck %s -void foo(bool cond) { // CHECK: 1| [[@LINE]]|void foo( - if (cond) { // CHECK: 1| [[@LINE]]| if (cond) { - } // CHECK: 0| [[@LINE]]| } -} // CHECK: 1| [[@LINE]]|} -void bar() { // CHECK: 1| [[@LINE]]|void bar() { -} // CHECK: 1| [[@LINE]]|} -void func() { // CHECK: 0| [[@LINE]]|void func( -} // CHECK: 0| [[@LINE]]|} -int main() { // CHECK: 1| [[@LINE]]|int main( - foo(false); // CHECK: 1| [[@LINE]]| foo( - bar(); // CHECK: 1| [[@LINE]]| bar( - return 0; // CHECK: 1| [[@LINE]]| return -} // CHECK: 1| [[@LINE]]|} +void foo(bool cond) { // CHECK: [[@LINE]]| 1|void foo( + if (cond) { // CHECK: [[@LINE]]| 1| if (cond) { + } // CHECK: [[@LINE]]| 0| } +} // CHECK: [[@LINE]]| 1|} +void bar() { // CHECK: [[@LINE]]| 1|void bar() { +} // CHECK: [[@LINE]]| 1|} +void func() { // CHECK: [[@LINE]]| 0|void func( +} // CHECK: [[@LINE]]| 0|} +int main() { // CHECK: [[@LINE]]| 1|int main( + foo(false); // CHECK: [[@LINE]]| 1| foo( + bar(); // CHECK: [[@LINE]]| 1| bar( + return 0; // CHECK: [[@LINE]]| 1| return +} // CHECK: [[@LINE]]| 1|} // COVMAP: __llvm_covmap {{.*}}