1 // RUN: %clang_cc1 -triple %itanium_abi_triple -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only -main-file-name classtemplate.cpp %s > %tmapping 2 // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-CONSTRUCTOR 3 // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-GETTER 4 // RUN: FileCheck -input-file %tmapping %s --check-prefix=CHECK-SETTER 5 6 template<class TT> 7 class Test { 8 public: 9 enum BaseType { 10 A, C, G, T, Invalid 11 }; 12 const static int BaseCount = 4; 13 double bases[BaseCount]; 14 15 // CHECK-CONSTRUCTOR: Test 16 Test() { } // CHECK-CONSTRUCTOR: File 0, [[@LINE]]:10 -> [[@LINE]]:13 = #0 (HasCodeBefore = 0) 17 // CHECK-GETTER: get 18 double get(TT position) const { // CHECK-GETTER: File 0, [[@LINE]]:33 -> [[@LINE+2]]:4 = 0 (HasCodeBefore = 0) 19 return bases[position]; 20 } 21 // CHECK-SETTER: set 22 void set(TT position, double value) { // CHECK-SETTER: File 0, [[@LINE]]:39 -> [[@LINE+2]]:4 = #0 (HasCodeBefore = 0) 23 bases[position] = value; 24 } 25 }; 26 27 int main() { 28 Test<unsigned> t; 29 t.set(Test<unsigned>::A, 5.5); 30 t.set(Test<unsigned>::T, 5.6); 31 t.set(Test<unsigned>::G, 5.7); 32 t.set(Test<unsigned>::C, 5.8); 33 return 0; 34 } 35