summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/function-template-specialization.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-06-29 20:59:39 +0000
committerDouglas Gregor <dgregor@apple.com>2009-06-29 20:59:39 +0000
commit8f5d4423ca126d66beddd0db69c384f6d07f1a93 (patch)
tree5835a0a7c5c6d546cae3a3f320d5ecd8f1f4ce39 /clang/test/CodeGenCXX/function-template-specialization.cpp
parent10de9e6602fcbe351aa20367c19a8cc39bb0c991 (diff)
downloadbcm5719-llvm-8f5d4423ca126d66beddd0db69c384f6d07f1a93.tar.gz
bcm5719-llvm-8f5d4423ca126d66beddd0db69c384f6d07f1a93.zip
Keep track of function template specializations, to eliminate
redundant, implicit instantiations of function templates and provide a place where we can hang function template specializations. llvm-svn: 74454
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