1 // RUN: %clang -O2 -c -o %t.0.o %S/../Inputs/extern_template.cpp 2 // RUN: %clang_profgen -O2 -c -o %t.o %S/../Inputs/extern_template.cpp 3 // RUN: %clang_profgen -O2 -fcoverage-mapping %S/../Inputs/extern_template1.cpp %S/../Inputs/extern_template2.cpp %t.o -o %t 4 // RUN: env LLVM_PROFILE_FILE=%t.profraw %t 5 // RUN: llvm-profdata show --all-functions %t.profraw | FileCheck %s 6 // RUN: llvm-profdata merge -o %t.profdata %t.profraw 7 // RUN: llvm-cov show -instr-profile=%t.profdata %t | FileCheck %S/../Inputs/extern_template.h 8 // RUN: %clang_profgen -O2 -fcoverage-mapping %S/../Inputs/extern_template1.cpp %S/../Inputs/extern_template2.cpp %t.0.o -o %t.0 9 // RUN: env LLVM_PROFILE_FILE=%t.0.profraw %t.0 10 // RUN: llvm-profdata show --all-functions %t.0.profraw | FileCheck %s 11 // RUN: llvm-profdata merge -o %t.0.profdata %t.0.profraw 12 // RUN: llvm-cov show -instr-profile=%t.0.profdata %t.0 | FileCheck %S/../Inputs/extern_template.h 13 #define DEF 14 #include "extern_template.h" 15 #undef DEF 16 extern int bar(); 17 extern int foo(); 18 extern Test<int> TO; 19 int main() { 20 foo(); 21 int R = bar(); 22 23 if (R != 10) 24 return 1; 25 return 0; 26 } 27 // No duplicate entries 28 // CHECK: _ZN4TestIiE4doItEi: 29 // CHECK-NOT: _ZN4TestIiE4doItEi: 30