[Heikki Kultala] This patch contains the ABI changes for the TCE target.
[clang.git] / test / CodeGenObjCXX / property-dot-reference.mm
blob6b53639f54cb583a1efcd1e597dae1ceda33f563
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -fobjc-nonfragile-abi -fexceptions -o - %s | FileCheck %s
2 // rdar://8409336
4 struct TFENode {
5 void GetURL() const;
6 };
8 @interface TNodeIconAndNameCell
9 - (const TFENode&) node;
10 @end
12 @implementation TNodeIconAndNameCell     
13 - (const TFENode&) node {
14 // CHECK: call %struct.TFENode* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
15 // CHECK-NEXT: call void @_ZNK7TFENode6GetURLEv(%struct.TFENode* %{{.*}})
16         self.node.GetURL();
17 }       // expected-warning {{control reaches end of non-void function}}
18 @end
20 // rdar://8437240
21 struct X {
22   int x;
25 void f0(const X &parent);
26 @interface A
27 - (const X&) target;
28 @end
29 void f1(A *a) {
30 // CHECK: [[PRP:%.*]] = call %struct.X* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
31 // CHECK-NEXT:call void @_Z2f0RK1X(%struct.X* [[PRP]])
32   f0(a.target);
34 // CHECK: [[MSG:%.*]] = call %struct.X* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend
35 // CHECK-NEXT:call void @_Z2f0RK1X(%struct.X* [[MSG]])
36   f0([a target]);
39 @interface Test2
40 @property (readonly) int myProperty;
41 - (int) myProperty;
42 - (double) myGetter;
43 @end
44 void test2() {
45     Test2 *obj;
46     (void) obj.myProperty; 
47     (void) obj.myGetter; 
48     static_cast<void>(obj.myProperty);
49     static_cast<void>(obj.myGetter);
50     void(obj.myProperty);
51     void(obj.myGetter);
53 // CHECK: define void @_Z5test2v()
54 // CHECK: call i32 bitcast
55 // CHECK: call double bitcast
56 // CHECK: call i32 bitcast
57 // CHECK: call double bitcast
58 // CHECK: call i32 bitcast
59 // CHECK: call double bitcast
61 // PR8751
62 int test3(Test2 *obj) { return obj.myProperty; }