blob: 07941f9bb497a86c776f7fb2ded0668d425333c4 [file] [log] [blame]
Xinliang David Lib4fc4cb2016-01-21 02:35:59 +00001template <class T> class FOO {
2public:
3 FOO() : t(0) {}
4
5 T DoIt(T ti);
6
7private:
8 T t;
9};
10
Ying Yi6b1f5f82016-08-09 19:53:35 +000011template <class T> T FOO<T>::DoIt(T ti) { // HEADER: [[@LINE]]| 2|template
12 for (T I = 0; I < ti; I++) { // HEADER: [[@LINE]]| 22| for (T
13 t += I; // HEADER: [[@LINE]]| 20| t += I;
14 if (I > ti / 2) // HEADER: [[@LINE]]| 20| if (I > ti
Vedant Kumar43247f02017-11-09 02:33:43 +000015 t -= 1; // HEADER: [[@LINE]]| 20| t -= 1;
Ying Yi6b1f5f82016-08-09 19:53:35 +000016 } // HEADER: [[@LINE]]| 20| }
17 // HEADER: [[@LINE]]| 2|
18 return t; // HEADER: [[@LINE]]| 2| return t;
Xinliang David Lib4fc4cb2016-01-21 02:35:59 +000019}
Vedant Kumar86705ba2016-03-28 21:06:42 +000020
Vedant Kumar86705ba2016-03-28 21:06:42 +000021// To generate the binaries which correspond to this file, you must first
22// compile a program with two calls to Foo<int>::DoIt(10) for each desired
23// architecture. Collect a raw profile from any one of these binaries, index
24// it, and check it in along with the executables.
Vedant Kumar43247f02017-11-09 02:33:43 +000025
26// Note:
27// The line execution count on line 14 is incorrect because of a bug in the
28// checked-in coverage mappings, which has subsequently been fixed in clang.