Douglas Gregor | 8f51a4f | 2010-03-13 18:23:07 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -emit-llvm -triple i686-pc-linux-gnu -o - %s | FileCheck %s |
Douglas Gregor | aba43bb | 2009-05-26 20:50:29 +0000 | [diff] [blame] | 2 | |
| 3 | template<typename T, typename U, typename Result> |
| 4 | struct plus { |
Douglas Gregor | d0e3daf | 2009-09-04 22:48:11 +0000 | [diff] [blame] | 5 | Result operator()(const T& t, const U& u) const; |
Douglas Gregor | aba43bb | 2009-05-26 20:50:29 +0000 | [diff] [blame] | 6 | }; |
| 7 | |
Douglas Gregor | d0e3daf | 2009-09-04 22:48:11 +0000 | [diff] [blame] | 8 | template<typename T, typename U, typename Result> |
| 9 | Result plus<T, U, Result>::operator()(const T& t, const U& u) const { |
| 10 | return t + u; |
| 11 | } |
| 12 | |
Douglas Gregor | 8f51a4f | 2010-03-13 18:23:07 +0000 | [diff] [blame] | 13 | // CHECK: define weak_odr i32 @_ZNK4plusIillEclERKiRKl |
Douglas Gregor | aba43bb | 2009-05-26 20:50:29 +0000 | [diff] [blame] | 14 | template struct plus<int, long, long>; |