2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
|
2009-06-30 00:59:39 +04:00
|
|
|
template<typename T, typename U>
|
|
|
|
T* next(T* ptr, const U& diff);
|
|
|
|
|
|
|
|
template<typename T, typename U>
|
|
|
|
T* next(T* ptr, const U& diff) {
|
|
|
|
return ptr + diff;
|
|
|
|
}
|
|
|
|
|
|
|
|
void test(int *iptr, float *fptr, int diff) {
|
2009-09-17 08:02:31 +04:00
|
|
|
// CHECK: _Z4nextIiiEPT_S1_RKT0_
|
2009-06-30 00:59:39 +04:00
|
|
|
iptr = next(iptr, diff);
|
2009-09-17 08:02:31 +04:00
|
|
|
|
|
|
|
// CHECK: _Z4nextIfiEPT_S1_RKT0_
|
2009-06-30 00:59:39 +04:00
|
|
|
fptr = next(fptr, diff);
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T, typename U>
|
|
|
|
T* next(T* ptr, const U& diff);
|
|
|
|
|
|
|
|
void test2(int *iptr, double *dptr, int diff) {
|
|
|
|
iptr = next(iptr, diff);
|
2009-09-17 08:02:31 +04:00
|
|
|
|
|
|
|
// CHECK: _Z4nextIdiEPT_S1_RKT0_
|
2009-06-30 00:59:39 +04:00
|
|
|
dptr = next(dptr, diff);
|
2009-07-28 01:00:51 +04:00
|
|
|
}
|