summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/implicit-instantiation-1.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-06-22 23:06:13 +0000
committerDouglas Gregor <dgregor@apple.com>2009-06-22 23:06:13 +0000
commit77b50e1126b8699a170c48cef8a91f80a1127f25 (patch)
tree66b6ef20a5e2bec188090bbaefd368b2494ebac6 /clang/test/CodeGenCXX/implicit-instantiation-1.cpp
parent6589a2e1db7f4efbea903c2c9ad3c89c014f6902 (diff)
downloadbcm5719-llvm-77b50e1126b8699a170c48cef8a91f80a1127f25.tar.gz
bcm5719-llvm-77b50e1126b8699a170c48cef8a91f80a1127f25.zip
Implement implicit instantiation of the member functions of a class template
specialization. At present, all implicit instantiations occur at the end of the translation unit. llvm-svn: 73915
Diffstat (limited to 'clang/test/CodeGenCXX/implicit-instantiation-1.cpp')
-rw-r--r--clang/test/CodeGenCXX/implicit-instantiation-1.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/implicit-instantiation-1.cpp b/clang/test/CodeGenCXX/implicit-instantiation-1.cpp
new file mode 100644
index 00000000000..f6c6114d20c
--- /dev/null
+++ b/clang/test/CodeGenCXX/implicit-instantiation-1.cpp
@@ -0,0 +1,29 @@
+// RUN: clang-cc -emit-llvm %s -o %t &&
+
+template<typename T>
+struct X {
+ void f(T) { }
+ void f(char) { }
+
+ void g(T) { }
+
+ void h(T) { }
+};
+
+void foo(X<int> &xi, X<float> *xfp, int i, float f) {
+ // RUN: grep "linkonce_odr.*_ZN1XIiE1fEi" %t | count 1 &&
+ xi.f(i);
+
+ // RUN: grep "linkonce_odr.*_ZN1XIiE1gEi" %t | count 1 &&
+ xi.g(f);
+
+ // RUN: grep "linkonce_odr.*_ZN1XIfE1fEf" %t | count 1 &&
+ xfp->f(f);
+
+ // RUN: grep "linkonce_odr.*_ZN1XIfE1hEf" %t | count 0 &&
+
+ // RUN: true
+}
+
+
+
OpenPOWER on IntegriCloud