summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/copy-constructor-synthesis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/copy-constructor-synthesis.cpp')
-rw-r--r--test/CodeGenCXX/copy-constructor-synthesis.cpp54
1 files changed, 44 insertions, 10 deletions
diff --git a/test/CodeGenCXX/copy-constructor-synthesis.cpp b/test/CodeGenCXX/copy-constructor-synthesis.cpp
index ae8eefa..9cafd0a 100644
--- a/test/CodeGenCXX/copy-constructor-synthesis.cpp
+++ b/test/CodeGenCXX/copy-constructor-synthesis.cpp
@@ -1,7 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -S %s -o %t-64.s
-// RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s
-// RUN: %clang_cc1 -triple i386-apple-darwin -S %s -o %t-32.s
-// RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
extern "C" int printf(...);
@@ -24,6 +21,7 @@ struct P {
};
+// CHECK: define linkonce_odr void @_ZN1XC1ERKS_
struct X : M, N, P { // ...
X() : f1(1.0), d1(2.0), i1(3), name("HELLO"), bf1(0xff), bf2(0xabcd),
au_i1(1234), au1_4("MASKED") {}
@@ -113,10 +111,46 @@ void f(const B &b1) {
B b2(b1);
}
-// CHECK-LP64: .globl __ZN1XC1ERKS_
-// CHECK-LP64: .weak_definition __ZN1XC1ERKS_
-// CHECK-LP64: __ZN1XC1ERKS_:
+// PR6628
+namespace PR6628 {
+
+struct T {
+ T();
+ ~T();
+
+ double d;
+};
+
+struct A {
+ A(const A &other, const T &t = T(), const T& t2 = T());
+};
+
+struct B : A {
+ A a1;
+ A a2;
+ A a[10];
+};
+
+// Force the copy constructor to be synthesized.
+void f(B b1) {
+ B b2 = b1;
+}
+
+// CHECK: define linkonce_odr void @_ZN6PR66281BC2ERKS0_
+// CHECK: call void @_ZN6PR66281TC1Ev
+// CHECK: call void @_ZN6PR66281TC1Ev
+// CHECK: call void @_ZN6PR66281AC2ERKS0_RKNS_1TES5_
+// CHECK: call void @_ZN6PR66281TD1Ev
+// CHECK: call void @_ZN6PR66281TD1Ev
+// CHECK: call void @_ZN6PR66281TC1Ev
+// CHECK: call void @_ZN6PR66281TC1Ev
+// CHECK: call void @_ZN6PR66281AC1ERKS0_RKNS_1TES5_
+// CHECK: call void @_ZN6PR66281TD1Ev
+// CHECK: call void @_ZN6PR66281TD1Ev
+// CHECK: call void @_ZN6PR66281TC1Ev
+// CHECK: call void @_ZN6PR66281TC1Ev
+// CHECK: call void @_ZN6PR66281AC1ERKS0_RKNS_1TES5_
+// CHECK: call void @_ZN6PR66281TD1Ev
+// CHECK: call void @_ZN6PR66281TD1Ev
+}
-// CHECK-LP32: .globl __ZN1XC1ERKS_
-// CHECK-LP32: .weak_definition __ZN1XC1ERKS_
-// CHECK-LP32: __ZN1XC1ERKS_:
OpenPOWER on IntegriCloud