blob: aaa3ea19818370dd0818b21c7095a9b636eed6c4 [file] [log] [blame]
Fariborz Jahanianed6de562014-10-09 18:30:56 +00001// RUN: rm -rf %t
Fariborz Jahaniana6556f72014-10-31 21:19:45 +00002// RUN: %clang_cc1 -objcmt-migrate-property-dot-syntax -mt-migrate-directory %t %s -x objective-c -fobjc-runtime-has-weak -fobjc-arc -triple x86_64-apple-darwin11
Fariborz Jahanianed6de562014-10-09 18:30:56 +00003// RUN: c-arcmt-test -mt-migrate-directory %t | arcmt-test -verify-transformed-files %s.result
4// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -fsyntax-only -x objective-c -fobjc-runtime-has-weak -fobjc-arc %s.result
5
6// rdar://18498572
7@interface NSObject @end
8
9@interface P : NSObject
10{
11 P* obj;
12 int i1, i2, i3;
13}
14@property int count;
15@property (copy) P* PropertyReturnsPObj;
16- (P*) MethodReturnsPObj;
17@end
18
19P* fun();
20
21@implementation P
22- (int) Meth : (P*)array {
23 [obj setCount : 100];
24
25 [(P*)0 setCount : [array count]];
26
27 [[obj PropertyReturnsPObj] setCount : [array count]];
28
29 [obj setCount : (i1+i2*i3 - 100)];
30
31 return [obj count] -
32 [(P*)0 count] + [array count] +
33 [fun() count] -
34 [[obj PropertyReturnsPObj] count] +
35 [self->obj count];
36}
37
38- (P*) MethodReturnsPObj { return 0; }
39@end
Fariborz Jahaniandf833a42014-12-09 22:36:47 +000040
41// rdar://19140267
42@interface Sub : P
43@end
44
45@implementation Sub
46- (int) Meth : (P*)array {
47 [super setCount : 100];
48
49 [super setCount : [array count]];
50
51 [[super PropertyReturnsPObj] setCount : [array count]];
52
53 [super setCount : (i1+i2*i3 - 100)];
54
55 return [super count] -
56 [(P*)0 count] + [array count] +
57 [fun() count] -
58 [[super PropertyReturnsPObj] count] +
59 [self->obj count];
60}
61@end
Jordan Rose16ba5532015-01-16 23:04:26 +000062
63
64@interface Rdar19038838
65@property id newItem; // should be marked objc_method_family(none), but isn't.
66@end
67
68id testRdar19038838(Rdar19038838 *obj) {
69 return [obj newItem];
70}