summaryrefslogtreecommitdiffstats
path: root/test/CodeGenObjCXX/property-reference.mm
blob: 7c235cb9b4ef7cb07f4b2a868922a92abf0d966a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
// rdar://9208606

struct MyStruct
{
	int x;
	int y;
	int z;
};

@interface MyClass
{
	MyStruct _foo;
}

@property (assign, readwrite) const MyStruct& foo;

- (const MyStruct&) foo;
- (void) setFoo:(const MyStruct&)inFoo;
@end

int main()
{
	MyClass* myClass;
	MyStruct myStruct;

	myClass.foo = myStruct;

	const MyStruct& currentMyStruct = myClass.foo;   
	return 0;
}

// CHECK: [[C:%.*]] = call %struct.MyStruct* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
// CHECK:   store %struct.MyStruct* [[C]], %struct.MyStruct** [[D:%.*]]
OpenPOWER on IntegriCloud