blob: 9e41bf026a767872d22f4b5722b54ae99dc447a6 [file] [log] [blame]
John McCall260611a2012-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 McCallf85e1932011-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
14 // CHECK-NEXT: call noalias i8* @_Znwm(
15 // CHECK-NEXT: bitcast
16 // CHECK-NEXT: bitcast
John McCallf85e1932011-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 Lattnerb13eab92011-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}