blob: 7783137dc0912139c0e7941041811fa33e7c008b [file] [log] [blame]
John McCall5fb5df92012-06-20 06:18:46 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s
John McCall31168b02011-06-15 23:02:42 +00002
3// rdar://problem/9158302
4// This should not use a memmove_collectable in non-GC mode.
5namespace test0 {
6 struct A {
7 id x;
8 };
9
10 // CHECK: define [[A:%.*]]* @_ZN5test04testENS_1AE(
11 // CHECK: alloca
12 // CHECK-NEXT: getelementptr
13 // CHECK-NEXT: store
Richard Smith351241c2016-04-07 21:46:12 +000014 // CHECK-NEXT: call i8* @_Znwm(
John McCall31168b02011-06-15 23:02:42 +000015 // CHECK-NEXT: bitcast
16 // CHECK-NEXT: bitcast
John McCall31168b02011-06-15 23:02:42 +000017 // CHECK-NEXT: bitcast
18 // CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(
19 // CHECK-NEXT: ret
20 A *test(A a) {
21 return new A(a);
22 }
23}
24
Chris Lattner7369c142011-07-20 06:29:00 +000025
26// rdar://9780211
27@protocol bork
28@end
29
30namespace test1 {
31template<typename T> struct RetainPtr {
32 RetainPtr() {}
33};
34
35
36RetainPtr<id<bork> > x;
37RetainPtr<id> y;
38
39}