summaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/cxx11-special-members.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
committerDimitry Andric <dim@FreeBSD.org>2012-12-02 13:20:44 +0000
commit13cc256e404620c1de0cbcc4e43ce1e2dbbc4898 (patch)
tree2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /test/CodeGenCXX/cxx11-special-members.cpp
parent657bc3d9848e3be92029b2416031340988cd0111 (diff)
Notes
Diffstat (limited to 'test/CodeGenCXX/cxx11-special-members.cpp')
-rw-r--r--test/CodeGenCXX/cxx11-special-members.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGenCXX/cxx11-special-members.cpp b/test/CodeGenCXX/cxx11-special-members.cpp
new file mode 100644
index 0000000000000..59461f9e2f4bd
--- /dev/null
+++ b/test/CodeGenCXX/cxx11-special-members.cpp
@@ -0,0 +1,32 @@
+// RUN: %clang_cc1 %s -std=c++11 -emit-llvm -o - -triple=i686-linux-gnu | FileCheck %s
+
+struct A {
+ A(const A&);
+ A &operator=(const A&);
+};
+
+struct B {
+ A a;
+ B(B&&) = default;
+ B &operator=(B&&) = default;
+};
+
+// CHECK: define {{.*}} @_Z2f1
+void f1(B &x) {
+ // CHECK-NOT: memcpy
+ // CHECK: call {{.*}} @_ZN1BC1EOS_(
+ B b(static_cast<B&&>(x));
+}
+
+// CHECK: define {{.*}} @_Z2f2
+void f2(B &x, B &y) {
+ // CHECK-NOT: memcpy
+ // CHECK: call {{.*}} @_ZN1BaSEOS_(
+ x = static_cast<B&&>(y);
+}
+
+// CHECK: define {{.*}} @_ZN1BaSEOS_(
+// CHECK: call {{.*}} @_ZN1AaSERKS_(
+
+// CHECK: define {{.*}} @_ZN1BC2EOS_(
+// CHECK: call {{.*}} @_ZN1AC1ERKS_(