Xinliang David Li | b4fc4cb | 2016-01-21 02:35:59 +0000 | [diff] [blame] | 1 | template <class T> class FOO { |
| 2 | public: |
| 3 | FOO() : t(0) {} |
| 4 | |
| 5 | T DoIt(T ti); |
| 6 | |
| 7 | private: |
| 8 | T t; |
| 9 | }; |
| 10 | |
| 11 | template <class T> T FOO<T>::DoIt(T ti) { // HEADER: 2| [[@LINE]]|template |
| 12 | for (T I = 0; I < ti; I++) { // HEADER: 22| [[@LINE]]| for (T |
| 13 | t += I; // HEADER: 20| [[@LINE]]| t += I; |
| 14 | if (I > ti / 2) // HEADER: 20| [[@LINE]]| if (I > ti |
| 15 | t -= 1; // HEADER: 8| [[@LINE]]| t -= 1; |
Vedant Kumar | 32ca438 | 2016-03-28 22:10:40 +0000 | [diff] [blame] | 16 | } // HEADER: 20| [[@LINE]]| } |
| 17 | // HEADER: 2| [[@LINE]]| |
| 18 | return t; // HEADER: 2| [[@LINE]]| return t; |
Xinliang David Li | b4fc4cb | 2016-01-21 02:35:59 +0000 | [diff] [blame] | 19 | } |
Vedant Kumar | 86705ba | 2016-03-28 21:06:42 +0000 | [diff] [blame] | 20 | |
Vedant Kumar | 86705ba | 2016-03-28 21:06:42 +0000 | [diff] [blame] | 21 | // 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. |