29 lines · c
1template <class T> class FOO {2public:3 FOO() : t(0) {}4 5 T DoIt(T ti);6 7private:8 T t;9};10 11template <class T> T FOO<T>::DoIt(T ti) { // HEADER: [[@LINE]]| 2|template12 for (T I = 0; I < ti; I++) { // HEADER: [[@LINE]]| 22| for (T13 t += I; // HEADER: [[@LINE]]| 20| t += I;14 if (I > ti / 2) // HEADER: [[@LINE]]| 20| if (I > ti15 t -= 1; // HEADER: [[@LINE]]| 20| t -= 1;16 } // HEADER: [[@LINE]]| 20| }17 // HEADER: [[@LINE]]| 2|18 return t; // HEADER: [[@LINE]]| 2| return t;19}20 21// To generate the binaries which correspond to this file, you must first22// compile a program with two calls to Foo<int>::DoIt(10) for each desired23// architecture. Collect a raw profile from any one of these binaries, index24// it, and check it in along with the executables.25 26// Note:27// The line execution count on line 14 is incorrect because of a bug in the28// checked-in coverage mappings, which has subsequently been fixed in clang.29