blob: 65974a29772a6b48f7e5ddec721127b6110c0bc6 [file] [log] [blame]
Fariborz Jahanian53f867a2014-06-26 21:22:16 +00001// RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c -fobjc-arc %s 2>&1 | FileCheck %s
2// RUN: not %clang_cc1 -triple x86_64-apple-darwin10 -fdiagnostics-parseable-fixits -x objective-c++ -fobjc-arc %s 2>&1 | FileCheck %s
3// rdar://15932435
4
5typedef struct __attribute__((objc_bridge_related(UIColor,colorWithCGColor:,CGColor))) CGColor *CGColorRef;
6
7@interface UIColor
8+ (UIColor *)colorWithCGColor:(CGColorRef)cgColor;
9- (CGColorRef)CGColor;
10@end
11
12@interface UIButton
13@property(nonatomic,retain) UIColor *tintColor;
14@end
15
16void test(UIButton *myButton) {
17 CGColorRef cgColor = (CGColorRef)myButton.tintColor;
18 cgColor = myButton.tintColor;
19
20 cgColor = (CGColorRef)[myButton.tintColor CGColor];
21
22 cgColor = (CGColorRef)[myButton tintColor];
23}
24
25// CHECK: {17:36-17:36}:"["
26// CHECK: {17:54-17:54}:" CGColor]"
27
Ahmed Bougacha5a4aa422015-03-14 01:10:19 +000028// CHECK: {18:13-18:13}:"["
Fariborz Jahanian53f867a2014-06-26 21:22:16 +000029// CHECK: {18:31-18:31}:" CGColor]"
30
Ahmed Bougacha5a4aa422015-03-14 01:10:19 +000031// CHECK: {22:25-22:25}:"["
32// CHECK: {22:45-22:45}:" CGColor]"
Fariborz Jahanian53f867a2014-06-26 21:22:16 +000033
34@interface ImplicitPropertyTest
35- (UIColor *)tintColor;
36@end
37
38void test1(ImplicitPropertyTest *myImplicitPropertyTest) {
39 CGColorRef cgColor = (CGColorRef)[myImplicitPropertyTest tintColor];
40}
41
Ahmed Bougacha5a4aa422015-03-14 01:10:19 +000042// CHECK: {39:36-39:36}:"["
43// CHECK: {39:70-39:70}:" CGColor]"