blob: 4a79fb1d6747b3c93f1bc7612045b259c9cc4785 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
2template<typename T, typename U>
3T* next(T* ptr, const U& diff);
4
5template<typename T, typename U>
6T* next(T* ptr, const U& diff) {
7 return ptr + diff;
8}
9
10void 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
18template<typename T, typename U>
19T* next(T* ptr, const U& diff);
20
21void test2(int *iptr, double *dptr, int diff) {
22 iptr = next(iptr, diff);
23
24 // CHECK: _Z4nextIdiEPT_S1_RKT0_
25 dptr = next(dptr, diff);
26}