• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple %s -o - | FileCheck %s
2 template<typename T, typename U>
3 T* next(T* ptr, const U& diff);
4 
5 template<typename T, typename U>
next(T * ptr,const U & diff)6 T* next(T* ptr, const U& diff) {
7   return ptr + diff;
8 }
9 
test(int * iptr,float * fptr,int diff)10 void test(int *iptr, float *fptr, int diff) {
11   // CHECK: _Z4nextIiiEPT_S1_RKT0_
12   iptr = next(iptr, diff);
13 
14   // CHECK: _Z4nextIfiEPT_S1_RKT0_
15   fptr = next(fptr, diff);
16 }
17 
18 template<typename T, typename U>
19 T* next(T* ptr, const U& diff);
20 
test2(int * iptr,double * dptr,int diff)21 void test2(int *iptr, double *dptr, int diff) {
22   iptr = next(iptr, diff);
23 
24   // CHECK: _Z4nextIdiEPT_S1_RKT0_
25   dptr = next(dptr, diff);
26 }
27