Douglas Gregor | 322328b | 2009-11-18 22:32:06 +0000 | [diff] [blame] | 1 | /* Note: the RUN lines are near the end of the file, since line/column |
| 2 | matter for this test. */ |
Douglas Gregor | d98abd8 | 2011-02-16 01:39:26 +0000 | [diff] [blame] | 3 | @class MyClass; |
Douglas Gregor | 322328b | 2009-11-18 22:32:06 +0000 | [diff] [blame] | 4 | @interface I1 |
| 5 | { |
| 6 | id StoredProp3; |
| 7 | int RandomIVar; |
| 8 | } |
Douglas Gregor | 424b2a5 | 2009-11-18 22:56:13 +0000 | [diff] [blame] | 9 | @property int Prop0; |
Douglas Gregor | 322328b | 2009-11-18 22:32:06 +0000 | [diff] [blame] | 10 | @property int Prop1; |
| 11 | @property float Prop2; |
| 12 | @end |
| 13 | |
| 14 | @interface I2 : I1 |
| 15 | @property id Prop3; |
Douglas Gregor | 424b2a5 | 2009-11-18 22:56:13 +0000 | [diff] [blame] | 16 | @property id Prop4; |
Douglas Gregor | 322328b | 2009-11-18 22:32:06 +0000 | [diff] [blame] | 17 | @end |
| 18 | |
| 19 | @implementation I2 |
| 20 | @synthesize Prop2, Prop1, Prop3 = StoredProp3; |
Douglas Gregor | 424b2a5 | 2009-11-18 22:56:13 +0000 | [diff] [blame] | 21 | @dynamic Prop4; |
Douglas Gregor | 322328b | 2009-11-18 22:32:06 +0000 | [diff] [blame] | 22 | @end |
| 23 | |
Douglas Gregor | 7344921 | 2010-12-09 23:01:55 +0000 | [diff] [blame] | 24 | @interface I3 : I2 |
| 25 | @property id Prop3; |
| 26 | @end |
| 27 | |
| 28 | id test(I3 *i3) { |
| 29 | return i3.Prop3; |
| 30 | } |
| 31 | |
Douglas Gregor | e842605 | 2011-04-18 14:40:46 +0000 | [diff] [blame] | 32 | @interface I4 |
| 33 | @property id Prop2; |
| 34 | @end |
| 35 | |
| 36 | @interface I4 () { |
| 37 | I4 *Prop1; |
| 38 | } |
| 39 | @end |
| 40 | |
| 41 | @implementation I4 { |
| 42 | id Prop2_; |
| 43 | } |
| 44 | |
| 45 | @synthesize Prop2 = Prop2_; |
| 46 | @end |
| 47 | |
Douglas Gregor | 424b2a5 | 2009-11-18 22:56:13 +0000 | [diff] [blame] | 48 | // RUN: c-index-test -code-completion-at=%s:20:13 %s | FileCheck -check-prefix=CHECK-CC1 %s |
Douglas Gregor | ff5ce6e | 2009-12-18 18:53:37 +0000 | [diff] [blame] | 49 | // CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} |
| 50 | // CHECK-CC1: ObjCPropertyDecl:{ResultType int}{TypedText Prop1} |
| 51 | // CHECK-CC1: ObjCPropertyDecl:{ResultType float}{TypedText Prop2} |
| 52 | // CHECK-CC1: ObjCPropertyDecl:{ResultType id}{TypedText Prop3} |
| 53 | // CHECK-CC1: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} |
Douglas Gregor | 424b2a5 | 2009-11-18 22:56:13 +0000 | [diff] [blame] | 54 | // RUN: c-index-test -code-completion-at=%s:20:20 %s | FileCheck -check-prefix=CHECK-CC2 %s |
Douglas Gregor | ff5ce6e | 2009-12-18 18:53:37 +0000 | [diff] [blame] | 55 | // CHECK-CC2: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} |
| 56 | // CHECK-CC2: ObjCPropertyDecl:{ResultType int}{TypedText Prop1} |
| 57 | // CHECK-CC2-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop3} |
| 58 | // CHECK-CC2: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} |
Douglas Gregor | 424b2a5 | 2009-11-18 22:56:13 +0000 | [diff] [blame] | 59 | // RUN: c-index-test -code-completion-at=%s:20:35 %s | FileCheck -check-prefix=CHECK-CC3 %s |
Douglas Gregor | e842605 | 2011-04-18 14:40:46 +0000 | [diff] [blame] | 60 | // CHECK-CC3: ObjCIvarDecl:{ResultType id}{TypedText _Prop3} (36) |
Douglas Gregor | aa490cb | 2011-04-18 14:13:53 +0000 | [diff] [blame] | 61 | // CHECK-CC3: ObjCIvarDecl:{ResultType int}{TypedText RandomIVar} (35) |
Douglas Gregor | e842605 | 2011-04-18 14:40:46 +0000 | [diff] [blame] | 62 | // CHECK-CC3: ObjCIvarDecl:{ResultType id}{TypedText StoredProp3} (8) |
Douglas Gregor | aa490cb | 2011-04-18 14:13:53 +0000 | [diff] [blame] | 63 | |
Douglas Gregor | 424b2a5 | 2009-11-18 22:56:13 +0000 | [diff] [blame] | 64 | // RUN: c-index-test -code-completion-at=%s:21:10 %s | FileCheck -check-prefix=CHECK-CC4 %s |
Douglas Gregor | ff5ce6e | 2009-12-18 18:53:37 +0000 | [diff] [blame] | 65 | // CHECK-CC4: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} |
| 66 | // CHECK-CC4-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} |
Douglas Gregor | 7344921 | 2010-12-09 23:01:55 +0000 | [diff] [blame] | 67 | |
| 68 | // RUN: c-index-test -code-completion-at=%s:29:13 %s | FileCheck -check-prefix=CHECK-CC5 %s |
| 69 | // CHECK-CC5: ObjCPropertyDecl:{ResultType int}{TypedText Prop0} (35) |
| 70 | // CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType int}{TypedText Prop1} (35) |
| 71 | // CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType float}{TypedText Prop2} (35) |
| 72 | // CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop3} (35) |
| 73 | // CHECK-CC5-NEXT: ObjCPropertyDecl:{ResultType id}{TypedText Prop4} (35) |
| 74 | |
Douglas Gregor | d98abd8 | 2011-02-16 01:39:26 +0000 | [diff] [blame] | 75 | // RUN: c-index-test -code-completion-at=%s:9:11 %s | FileCheck -check-prefix=CHECK-CC6 %s |
| 76 | // CHECK-CC6: ObjCInterfaceDecl:{TypedText MyClass} (50) |
| 77 | |
Douglas Gregor | e842605 | 2011-04-18 14:40:46 +0000 | [diff] [blame] | 78 | |
| 79 | // RUN: c-index-test -code-completion-at=%s:45:21 -fobjc-nonfragile-abi %s | FileCheck -check-prefix=CHECK-CC7 %s |
| 80 | // CHECK-CC7-NOT: ObjCIvarDecl:{ResultType id}{TypedText _Prop2} |
| 81 | // CHECK-CC7: ObjCIvarDecl:{ResultType I4 *}{TypedText Prop1} (17) |
| 82 | // CHECK-CC7: ObjCIvarDecl:{ResultType id}{TypedText Prop2_} (7) |