2009-09-17 07:48:45 +04:00
|
|
|
// RUN: clang-cc -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-06-30 02:39:32 +04:00
|
|
|
// FIXME: should be "_Z4nextIiiEPT_S1_RKT0_"
|
2009-09-17 07:46:43 +04:00
|
|
|
// CHECK: _Z4nextIiiEPT_S0_RKT0_
|
2009-06-30 00:59:39 +04:00
|
|
|
iptr = next(iptr, diff);
|
2009-06-30 02:39:32 +04:00
|
|
|
// FIXME: should be "_Z4nextIfiEPT_S1_RKT0_"
|
2009-09-17 07:46:43 +04:00
|
|
|
// CHECK: _Z4nextIfiEPT_S0_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-06-30 02:39:32 +04:00
|
|
|
// FIXME: should be "_Z4nextIdiEPT_S1_RKT0_"
|
2009-09-17 07:48:45 +04:00
|
|
|
// CHECK: _Z4nextIiiEPT_S0_RKT0_
|
2009-06-30 00:59:39 +04:00
|
|
|
dptr = next(dptr, diff);
|
2009-07-28 01:00:51 +04:00
|
|
|
}
|