2009-06-30 02:39:32 +04:00
|
|
|
// RUN: clang-cc -emit-llvm %s -o %t &&
|
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_"
|
|
|
|
// RUN: grep "_Z4nextIiiEPiPiRKi" %t &&
|
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_"
|
|
|
|
// RUN: grep "_Z4nextIfiEPfPfRKi" %t &&
|
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_"
|
|
|
|
// RUN: grep "_Z4nextIdiEPdPdRKi" %t
|
2009-06-30 00:59:39 +04:00
|
|
|
dptr = next(dptr, diff);
|
|
|
|
}
|