]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/CodeGenObjCXX/arc-indirect.mm
Vendor import of clang trunk r306956:
[FreeBSD/FreeBSD.git] / test / CodeGenObjCXX / arc-indirect.mm
1 // RUN: %clang_cc1 -std=c++11 -triple i686-unknown-windows-msvc -fobjc-runtime=gnustep -fobjc-arc -Wno-objc-root-class -emit-llvm -o - %s | FileCheck -check-prefixes CHECK,CHECK-GNUSTEP %s
2 // RUN: %clang_cc1 -std=c++11 -triple i686-unknown-windows-msvc -fobjc-runtime=macosx -fobjc-arc -Wno-objc-root-class -emit-llvm -o - %s | FileCheck -check-prefixes CHECK,CHECK-DARWIN %s
3 // RUN: %clang_cc1 -std=c++11 -triple i686-unknown-windows-msvc -fobjc-runtime=ios -fobjc-arc -Wno-objc-root-class -emit-llvm -o - %s | FileCheck -check-prefixes CHECK,CHECK-DARWIN %s
4
5 // non trivially copyable, forces inalloca
6 struct S {
7   S(const S &s) {}
8 };
9
10 @interface C
11 @end
12
13 @implementation C
14 - (void)object:(id)obj struct:(S)s {
15 }
16 @end
17
18 // CHECK-GNUSTEP: define internal void @_i_C__object_struct_(<{ %0*, i8*, i8*, %struct.S, [3 x i8] }>* inalloca)
19 // CHECK-DARWIN: define internal void @"\01-[C object:struct:]"(<{ %0*, i8*, i8*, %struct.S, [3 x i8] }>* inalloca)
20 // CHECK: %obj = getelementptr inbounds <{ %0*, i8*, i8*, %struct.S, [3 x i8] }>, <{ %0*, i8*, i8*, %struct.S, [3 x i8] }>* %0, i32 0, i32 2
21 // CHECK: %[[INSTANCE:[0-9]+]] = load i8*, i8** %obj, align 4
22 // CHECK: call void @objc_storeStrong(i8** %obj, i8* %[[INSTANCE]])