xref: /llvm-project/clang/test/CodeGenObjCXX/copy.mm (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
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.
4namespace 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
24namespace test1 {
25template<typename T> struct RetainPtr {
26  RetainPtr() {}
27};
28
29
30RetainPtr<id<bork> > x;
31RetainPtr<id> y;
32
33}
34