[cfe-commits] r106067 - in /cfe/trunk/test: CodeGenCXX/implicit-copy-assign-operator.mm CodeGenCXX/implicit-copy-constructor.mm CodeGenObjCXX/copyable-property-object.mm CodeGenObjCXX/implicit-copy-assign-operator.mm CodeGenObjCXX/implicit-copy-constructor.mm
Fariborz Jahanian
fjahanian at apple.com
Tue Jun 15 16:49:11 PDT 2010
Author: fjahanian
Date: Tue Jun 15 18:49:10 2010
New Revision: 106067
URL: http://llvm.org/viewvc/llvm-project?rev=106067&view=rev
Log:
Moved objective-c++ code gen. tests to their own directory and
added a new test case (related to radar 8070772).
Added:
cfe/trunk/test/CodeGenObjCXX/copyable-property-object.mm
cfe/trunk/test/CodeGenObjCXX/implicit-copy-assign-operator.mm
cfe/trunk/test/CodeGenObjCXX/implicit-copy-constructor.mm
Removed:
cfe/trunk/test/CodeGenCXX/implicit-copy-assign-operator.mm
cfe/trunk/test/CodeGenCXX/implicit-copy-constructor.mm
Removed: cfe/trunk/test/CodeGenCXX/implicit-copy-assign-operator.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/implicit-copy-assign-operator.mm?rev=106066&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/implicit-copy-assign-operator.mm (original)
+++ cfe/trunk/test/CodeGenCXX/implicit-copy-assign-operator.mm (removed)
@@ -1,57 +0,0 @@
-// RUN: %clang_cc1 -fobjc-gc -emit-llvm -triple x86_64-apple-darwin10.0.0 -o - %s | FileCheck %s
-struct A {
- A &operator=(const A&);
- A &operator=(A&);
-};
-
-struct B {
- B &operator=(B&);
-};
-
-struct C {
- virtual C& operator=(const C&);
-};
-
-struct POD {
- id myobjc;
- int array[3][4];
-};
-
-struct CopyByValue {
- CopyByValue(const CopyByValue&);
- CopyByValue &operator=(CopyByValue);
-};
-
-struct D : A, B, virtual C {
- int scalar;
- int scalar_array[2][3];
- B class_member;
- C class_member_array[2][3];
- POD pod_array[2][3];
-
- union {
- int x;
- float f[3];
- };
-
- CopyByValue by_value;
-};
-
-void test_D(D d1, D d2) {
- d1 = d2;
-}
-
-// CHECK: define linkonce_odr %struct.D* @_ZN1DaSERS_
-// CHECK: {{call.*_ZN1AaSERS_}}
-// CHECK: {{call.*_ZN1BaSERS_}}
-// CHECK: {{call.*_ZN1CaSERKS_}}
-// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 24}}
-// CHECK: {{call.*_ZN1BaSERS_}}
-// CHECK: br
-// CHECK: {{call.*_ZN1CaSERKS_}}
-// CHECK: {{call.*@objc_memmove_collectable}}
-// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 12}}
-// CHECK: call void @_ZN11CopyByValueC1ERKS_
-// CHECK: {{call.*_ZN11CopyByValueaSES_}}
-// CHECK: ret
-
Removed: cfe/trunk/test/CodeGenCXX/implicit-copy-constructor.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/implicit-copy-constructor.mm?rev=106066&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/implicit-copy-constructor.mm (original)
+++ cfe/trunk/test/CodeGenCXX/implicit-copy-constructor.mm (removed)
@@ -1,73 +0,0 @@
-// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
-
-struct A {
- A();
- A(const A&);
- A(A&);
- ~A();
-};
-
-struct B {
- B();
- B(B&);
-};
-
-struct C {
- C() {}
- C(C& other, A a = A());
- int i, j;
-};
-
-struct POD {
- id myobjc;
- int array[3][4];
-};
-
-struct D : A, B, virtual C {
- D();
- int scalar;
- int scalar_array[2][3];
- B class_member;
- C class_member_array[2][3];
- POD pod_array[2][3];
-
- union {
- int x;
- float f[3];
- };
-};
-
-void f(D d) {
- D d2(d);
-}
-
-// CHECK: define linkonce_odr void @_ZN1DC1ERS_
-// CHECK: call void @_ZN1AC1Ev
-// CHECK: call void @_ZN1CC2ERS_1A
-// CHECK: call void @_ZN1AD1Ev
-// CHECK: call void @_ZN1AC2ERS_
-// CHECK: call void @_ZN1BC2ERS_
-// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 24}}
-// CHECK: call void @_ZN1BC1ERS_
-// CHECK: br
-// CHECK: {{icmp ult.*, 2}}
-// CHECK: {{icmp ult.*, 3}}
-// CHECK: call void @_ZN1AC1Ev
-// CHECK: call void @_ZN1CC1ERS_1A
-// CHECK: call void @_ZN1AD1Ev
-// CHECK: {{call.*@objc_memmove_collectable}}
-// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 12}}
-// CHECK: ret void
-
-
-template<class T> struct X0 { void f0(T * ) { } };
-template <class > struct X1 { X1( X1& , int = 0 ) { } };
-struct X2 { X1<int> result; };
-void test_X2()
-{
- typedef X2 impl;
- typedef X0<impl> pimpl;
- impl* i;
- pimpl pdata;
- pdata.f0( new impl(*i));
-}
Added: cfe/trunk/test/CodeGenObjCXX/copyable-property-object.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/copyable-property-object.mm?rev=106067&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/copyable-property-object.mm (added)
+++ cfe/trunk/test/CodeGenObjCXX/copyable-property-object.mm Tue Jun 15 18:49:10 2010
@@ -0,0 +1,28 @@
+// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
+
+struct POD {
+ int array[3][4];
+ id objc_obj;
+};
+
+struct D {
+ POD pod_array[2][3];
+};
+
+ at interface I
+{
+ D Property1;
+}
+ at property D Property1;
+- (D) val;
+- (void) set : (D) d1;
+ at end
+
+ at implementation I
+ at synthesize Property1;
+- (D) val { return Property1; }
+- (void) set : (D) d1 { Property1 = d1; }
+ at end
+// CHECK: {{call.*@objc_memmove_collectable}}
+// CHECK: {{call.*@objc_memmove_collectable}}
+
Added: cfe/trunk/test/CodeGenObjCXX/implicit-copy-assign-operator.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/implicit-copy-assign-operator.mm?rev=106067&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/implicit-copy-assign-operator.mm (added)
+++ cfe/trunk/test/CodeGenObjCXX/implicit-copy-assign-operator.mm Tue Jun 15 18:49:10 2010
@@ -0,0 +1,57 @@
+// RUN: %clang_cc1 -fobjc-gc -emit-llvm -triple x86_64-apple-darwin10.0.0 -o - %s | FileCheck %s
+struct A {
+ A &operator=(const A&);
+ A &operator=(A&);
+};
+
+struct B {
+ B &operator=(B&);
+};
+
+struct C {
+ virtual C& operator=(const C&);
+};
+
+struct POD {
+ id myobjc;
+ int array[3][4];
+};
+
+struct CopyByValue {
+ CopyByValue(const CopyByValue&);
+ CopyByValue &operator=(CopyByValue);
+};
+
+struct D : A, B, virtual C {
+ int scalar;
+ int scalar_array[2][3];
+ B class_member;
+ C class_member_array[2][3];
+ POD pod_array[2][3];
+
+ union {
+ int x;
+ float f[3];
+ };
+
+ CopyByValue by_value;
+};
+
+void test_D(D d1, D d2) {
+ d1 = d2;
+}
+
+// CHECK: define linkonce_odr %struct.D* @_ZN1DaSERS_
+// CHECK: {{call.*_ZN1AaSERS_}}
+// CHECK: {{call.*_ZN1BaSERS_}}
+// CHECK: {{call.*_ZN1CaSERKS_}}
+// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 24}}
+// CHECK: {{call.*_ZN1BaSERS_}}
+// CHECK: br
+// CHECK: {{call.*_ZN1CaSERKS_}}
+// CHECK: {{call.*@objc_memmove_collectable}}
+// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 12}}
+// CHECK: call void @_ZN11CopyByValueC1ERKS_
+// CHECK: {{call.*_ZN11CopyByValueaSES_}}
+// CHECK: ret
+
Added: cfe/trunk/test/CodeGenObjCXX/implicit-copy-constructor.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenObjCXX/implicit-copy-constructor.mm?rev=106067&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenObjCXX/implicit-copy-constructor.mm (added)
+++ cfe/trunk/test/CodeGenObjCXX/implicit-copy-constructor.mm Tue Jun 15 18:49:10 2010
@@ -0,0 +1,73 @@
+// RUN: %clang_cc1 -fobjc-gc -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
+
+struct A {
+ A();
+ A(const A&);
+ A(A&);
+ ~A();
+};
+
+struct B {
+ B();
+ B(B&);
+};
+
+struct C {
+ C() {}
+ C(C& other, A a = A());
+ int i, j;
+};
+
+struct POD {
+ id myobjc;
+ int array[3][4];
+};
+
+struct D : A, B, virtual C {
+ D();
+ int scalar;
+ int scalar_array[2][3];
+ B class_member;
+ C class_member_array[2][3];
+ POD pod_array[2][3];
+
+ union {
+ int x;
+ float f[3];
+ };
+};
+
+void f(D d) {
+ D d2(d);
+}
+
+// CHECK: define linkonce_odr void @_ZN1DC1ERS_
+// CHECK: call void @_ZN1AC1Ev
+// CHECK: call void @_ZN1CC2ERS_1A
+// CHECK: call void @_ZN1AD1Ev
+// CHECK: call void @_ZN1AC2ERS_
+// CHECK: call void @_ZN1BC2ERS_
+// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 24}}
+// CHECK: call void @_ZN1BC1ERS_
+// CHECK: br
+// CHECK: {{icmp ult.*, 2}}
+// CHECK: {{icmp ult.*, 3}}
+// CHECK: call void @_ZN1AC1Ev
+// CHECK: call void @_ZN1CC1ERS_1A
+// CHECK: call void @_ZN1AD1Ev
+// CHECK: {{call.*@objc_memmove_collectable}}
+// CHECK: {{call void @llvm.memcpy.p0i8.p0i8.i64.*i64 12}}
+// CHECK: ret void
+
+
+template<class T> struct X0 { void f0(T * ) { } };
+template <class > struct X1 { X1( X1& , int = 0 ) { } };
+struct X2 { X1<int> result; };
+void test_X2()
+{
+ typedef X2 impl;
+ typedef X0<impl> pimpl;
+ impl* i;
+ pimpl pdata;
+ pdata.f0( new impl(*i));
+}
More information about the cfe-commits
mailing list