summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/function-template-specialization.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenCXX/function-template-specialization.cpp')
-rw-r--r--clang/test/CodeGenCXX/function-template-specialization.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/function-template-specialization.cpp b/clang/test/CodeGenCXX/function-template-specialization.cpp
new file mode 100644
index 00000000000..685306f8bed
--- /dev/null
+++ b/clang/test/CodeGenCXX/function-template-specialization.cpp
@@ -0,0 +1,21 @@
+// RUN: clang-cc -emit-llvm %s -o -
+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) {
+ iptr = next(iptr, diff);
+ 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);
+ dptr = next(dptr, diff);
+} \ No newline at end of file
OpenPOWER on IntegriCloud