Argyrios Kyrtzidis | 9a0b6b4 | 2012-03-12 18:34:26 +0000 | [diff] [blame] | 1 | #ifndef HEADER |
| 2 | #define HEADER |
| 3 | |
| 4 | @interface I(cat) |
| 5 | -(void)meth; |
| 6 | @end |
| 7 | |
| 8 | @interface I2 |
| 9 | -(void)meth; |
| 10 | @end |
| 11 | |
Argyrios Kyrtzidis | 51e75ae | 2013-08-07 21:17:33 +0000 | [diff] [blame] | 12 | struct FFF1 |
| 13 | extern I2 *somevar1; |
| 14 | |
| 15 | enum FFF2 |
| 16 | extern I2 *somevar2; |
| 17 | |
Argyrios Kyrtzidis | 9a0b6b4 | 2012-03-12 18:34:26 +0000 | [diff] [blame] | 18 | #else |
| 19 | |
| 20 | void foo(I2 *i) { |
| 21 | [i meth]; |
| 22 | } |
| 23 | |
| 24 | #endif |
| 25 | |
| 26 | // RUN: c-index-test -write-pch %t.h.pch %s -Xclang -detailed-preprocessing-record |
| 27 | // RUN: c-index-test -test-load-source local %s -include %t.h -Xclang -detailed-preprocessing-record | FileCheck -check-prefix=CHECK-PARSE %s |
| 28 | // RUN: c-index-test -index-file %s -include %t.h -Xclang -detailed-preprocessing-record | FileCheck -check-prefix=CHECK-INDEX %s |
| 29 | |
| 30 | // CHECK-PARSE: pch-with-errors.m:{{.*}} FunctionDecl=foo |
| 31 | // CHECK-PARSE: pch-with-errors.m:{{.*}} ObjCMessageExpr=meth |
| 32 | |
| 33 | // CHECK-INDEX: [indexDeclaration]: kind: function | name: foo |
| 34 | // CHECK-INDEX: [indexEntityReference]: kind: objc-instance-method | name: meth |