]> granicus.if.org Git - clang/commitdiff
Add test case for PR6141, which was fixed a few days ago
authorDouglas Gregor <dgregor@apple.com>
Wed, 24 Feb 2010 21:54:27 +0000 (21:54 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 24 Feb 2010 21:54:27 +0000 (21:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97063 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/special/class.copy/p3.cpp [new file with mode: 0644]

diff --git a/test/CXX/special/class.copy/p3.cpp b/test/CXX/special/class.copy/p3.cpp
new file mode 100644 (file)
index 0000000..3d87266
--- /dev/null
@@ -0,0 +1,27 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
+
+// PR6141
+template<typename T>
+struct X {
+  X();
+  template<typename U> X(X<U>);
+  X(const X<T>&);
+};
+
+void f(X<int>) { }
+
+struct Y : X<int> { };
+struct Z : X<float> { };
+
+// CHECK: define i32 @main()
+int main() {
+  // CHECK: call void @_ZN1YC1Ev
+  // CHECK: call void @_ZN1XIiEC1ERKS0_
+  // CHECK: call void @_Z1f1XIiE
+  f(Y());
+  // CHECK: call void @_ZN1ZC1Ev
+  // CHECK: call void @_ZN1XIfEC1ERKS0_
+  // CHECK: call void @_ZN1XIiEC1IfEES_IT_E
+  // CHECK: call void @_Z1f1XIiE
+  f(Z());
+}