summaryrefslogtreecommitdiffstats
path: root/test/Index/complete-synthesized.m
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-11-02 20:36:02 +0000
committerDouglas Gregor <dgregor@apple.com>2010-11-02 20:36:02 +0000
commitca45da0c6da20d9c0c903370f99af5e9a186e0da (patch)
tree5bb1d73472ed3cd5218d9f4bfb3862fd22aa1141 /test/Index/complete-synthesized.m
parent168943947a42d6819dce56b420dc5aef4d0831ce (diff)
Teach code completion to provide property results when the property
can be used to automatically synthesize an ivar. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118052 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/complete-synthesized.m')
-rw-r--r--test/Index/complete-synthesized.m56
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 0000000000..a97eeab8cb
--- /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-abi2 %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-abi2 %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-abi2 %s | FileCheck -check-prefix=CHECK-CC3 %s
+// CHECK-CC3: NotImplemented:{TypedText _Bool} (50)
+// CHECK-CC3: ObjCIvarDecl:{ResultType float}{TypedText _prop2} (35)
+// CHECK-CC3: ObjCIvarDecl:{ResultType double}{TypedText prop4}
+// CHECK-CC3-NOT: ObjCPropertyDecl:{ResultType double}{TypedText prop4} (35)
+// CHECK-CC1: restrict