1// Template instantiations are placed into comdat sections. Check that
2// coverage data from different instantiations are mapped back to the correct
3// source regions.
4
5template <class T> class FOO {
6public:
7 FOO() : t(0) {}
8
9 T DoIt(T ti);
10
11private:
12 T t;
13};
14
15template <class T> T FOO<T>::DoIt(T ti) { // HEADER: [[@LINE]]| 2|template
16 for (T I = 0; I < ti; I++) { // HEADER: [[@LINE]]| 22| for (T
17 t += I; // HEADER: [[@LINE]]| 20| t += I;
18 if (I > ti / 2) // HEADER: [[@LINE]]| 20| if (I > ti
19 t -= 1; // HEADER: [[@LINE]]| 8| t -= 1;
20 } // HEADER: [[@LINE]]| 10| }
21 // HEADER: [[@LINE]]| |
22 return t; // HEADER: [[@LINE]]| 1| return t;
23}
24

source code of compiler-rt/test/profile/Inputs/instrprof-comdat.h