diff options
Diffstat (limited to 'test/Index/complete-synthesized.m')
-rw-r--r-- | test/Index/complete-synthesized.m | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/Index/complete-synthesized.m b/test/Index/complete-synthesized.m new file mode 100644 index 000000000000..1a4858449f42 --- /dev/null +++ b/test/Index/complete-synthesized.m @@ -0,0 +1,56 @@ +// Note: this test is line- and column-sensitive. Test commands are at +// the end. + + +@interface A +@property int prop1; +@end + +@interface B : A { + float _prop2; +} +@property float prop2; +@property short prop3; +@end + +@interface B () +@property double prop4; +@end + +@implementation B +@synthesize prop2 = _prop2; + +- (int)method { + return _prop2; +} + +@dynamic prop3; + +- (short)method2 { + return prop4; +} + +- (short)method3 { + return prop3; +} +@end + +// RUN: c-index-test -code-completion-at=%s:24:1 -Xclang -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC1 %s +// CHECK-CC1: NotImplemented:{TypedText _Bool} (50) +// CHECK-CC1: ObjCIvarDecl:{ResultType float}{TypedText _prop2} (35) +// CHECK-CC1-NOT: prop2 +// CHECK-CC1: ObjCPropertyDecl:{ResultType short}{TypedText prop3} (35) +// CHECK-CC1: ObjCPropertyDecl:{ResultType double}{TypedText prop4} (35) + +// RUN: c-index-test -code-completion-at=%s:30:2 -Xclang -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC2 %s +// CHECK-CC2: NotImplemented:{TypedText _Bool} (50) +// CHECK-CC2: ObjCIvarDecl:{ResultType float}{TypedText _prop2} (35) +// CHECK-CC2-NOT: prop3 +// CHECK-CC2: ObjCPropertyDecl:{ResultType double}{TypedText prop4} (35) + +// RUN: c-index-test -code-completion-at=%s:34:2 -Xclang -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: NotImplemented:{TypedText _Bool} (50) +// CHECK-CC3: ObjCIvarDecl:{ResultType float}{TypedText _prop2} (35) +// CHECK-CC3: ObjCPropertyDecl:{ResultType double}{TypedText prop4} +// CHECK-CC3-NOT: ObjCPropertyDecl:{ResultType double}{TypedText prop4} (35) +// CHECK-CC1: restrict |