Debian Codegraph @

clang/test/CodeGenObjCXX/copy.mm

raw
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-runtime=macosx-fragile-10.5 -emit-llvm -o - %s | FileCheck %s
2
3 // This should not use a memmove_collectable in non-GC mode.
4 namespace test0 {
5 struct A {
6 id x;
7 };
8
9 // CHECK: define{{.*}} ptr @_ZN5test04testENS_1AE(
10 // CHECK: alloca
11 // CHECK-NEXT: getelementptr
12 // CHECK-NEXT: store
13 // CHECK-NEXT: [[CALL:%.*]] = call noalias noundef nonnull ptr @_Znwm(
14 // CHECK-NEXT: call void @llvm.memcpy.p0.p0.i64(
15 // CHECK-NEXT: ret
16 A *test(A a) {
17 return new A(a);
18 }
19 }
20
21 @protocol bork
22 @end
23
24 namespace test1 {
25 template<typename T> struct RetainPtr {
26 RetainPtr() {}
27 };
28
29
30 RetainPtr<id<bork> > x;
31 RetainPtr<id> y;
32
33 }