xref: /minix3/external/bsd/llvm/dist/clang/test/FixIt/fixit-objc-bridge-related.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc// RUN: not %clang_cc1 -triple x86_64-apple-darwin10  -fdiagnostics-parseable-fixits -x objective-c -fobjc-arc %s 2>&1 | FileCheck %s
2*0a6a1f1dSLionel Sambuc// RUN: not %clang_cc1 -triple x86_64-apple-darwin10  -fdiagnostics-parseable-fixits -x objective-c++ -fobjc-arc %s 2>&1 | FileCheck %s
3*0a6a1f1dSLionel Sambuc// rdar://15932435
4*0a6a1f1dSLionel Sambuc
5*0a6a1f1dSLionel Sambuctypedef struct __attribute__((objc_bridge_related(UIColor,colorWithCGColor:,CGColor))) CGColor *CGColorRef;
6*0a6a1f1dSLionel Sambuc
7*0a6a1f1dSLionel Sambuc@interface UIColor
8*0a6a1f1dSLionel Sambuc+ (UIColor *)colorWithCGColor:(CGColorRef)cgColor;
9*0a6a1f1dSLionel Sambuc- (CGColorRef)CGColor;
10*0a6a1f1dSLionel Sambuc@end
11*0a6a1f1dSLionel Sambuc
12*0a6a1f1dSLionel Sambuc@interface UIButton
13*0a6a1f1dSLionel Sambuc@property(nonatomic,retain) UIColor *tintColor;
14*0a6a1f1dSLionel Sambuc@end
15*0a6a1f1dSLionel Sambuc
16*0a6a1f1dSLionel Sambucvoid test(UIButton *myButton) {
17*0a6a1f1dSLionel Sambuc  CGColorRef cgColor = (CGColorRef)myButton.tintColor;
18*0a6a1f1dSLionel Sambuc  cgColor = myButton.tintColor;
19*0a6a1f1dSLionel Sambuc
20*0a6a1f1dSLionel Sambuc  cgColor = (CGColorRef)[myButton.tintColor CGColor];
21*0a6a1f1dSLionel Sambuc
22*0a6a1f1dSLionel Sambuc  cgColor = (CGColorRef)[myButton tintColor];
23*0a6a1f1dSLionel Sambuc}
24*0a6a1f1dSLionel Sambuc
25*0a6a1f1dSLionel Sambuc// CHECK: {17:36-17:36}:"["
26*0a6a1f1dSLionel Sambuc// CHECK: {17:54-17:54}:" CGColor]"
27*0a6a1f1dSLionel Sambuc
28*0a6a1f1dSLionel Sambuc// CHECK :{18:13-18:13}:"["
29*0a6a1f1dSLionel Sambuc// CHECK: {18:31-18:31}:" CGColor]"
30*0a6a1f1dSLionel Sambuc
31*0a6a1f1dSLionel Sambuc// CHECK :{22:25-22:25}:"["
32*0a6a1f1dSLionel Sambuc// CHECK :{22:45-22:45}:" CGColor]"
33*0a6a1f1dSLionel Sambuc
34*0a6a1f1dSLionel Sambuc@interface ImplicitPropertyTest
35*0a6a1f1dSLionel Sambuc- (UIColor *)tintColor;
36*0a6a1f1dSLionel Sambuc@end
37*0a6a1f1dSLionel Sambuc
38*0a6a1f1dSLionel Sambucvoid test1(ImplicitPropertyTest *myImplicitPropertyTest) {
39*0a6a1f1dSLionel Sambuc  CGColorRef cgColor = (CGColorRef)[myImplicitPropertyTest tintColor];
40*0a6a1f1dSLionel Sambuc}
41*0a6a1f1dSLionel Sambuc
42*0a6a1f1dSLionel Sambuc// CHECK :{39:36-39:36}:"["
43*0a6a1f1dSLionel Sambuc// CHECK :{39:70-39:70}:" CGColor]"
44