Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -emit-pch -x objective-c %s -o %t.ast |
Ted Kremenek | 1d5fdf3 | 2009-11-18 02:02:52 +0000 | [diff] [blame] | 2 | // RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=scan %s |
| 3 | // RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=load %s |
| 4 | |
| 5 | // This test checks how the @class resolves as a cursor when there is a real definition |
| 6 | // that follows. <rdar://problem/7383421> |
| 7 | |
| 8 | @class Foo; |
| 9 | |
| 10 | @interface Foo |
| 11 | @end |
| 12 | |
| 13 | void function(Foo * arg) |
| 14 | { |
| 15 | // nothing here. |
| 16 | } |
| 17 | |
Daniel Dunbar | 8f0bf81 | 2010-02-14 08:32:51 +0000 | [diff] [blame] | 18 | // CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound |
| 19 | // CHECK-scan: [8:1 - 8:8] UnexposedDecl=:8:1 |
| 20 | // CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:10:12 |
| 21 | // CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound |
| 22 | // CHECK-scan: [10:1 - 11:5] ObjCInterfaceDecl=Foo:10:12 |
| 23 | // CHECK-scan: [11:5 - 13:6] Invalid Cursor => NoDeclFound |
| 24 | // CHECK-scan: [13:6 - 13:15] FunctionDecl=function:13:6 (Definition) |
| 25 | // CHECK-scan: [13:15 - 13:18] ObjCClassRef=Foo:10:12 |
| 26 | // CHECK-scan: [13:18 - 13:24] ParmDecl=arg:13:21 (Definition) |
| 27 | // CHECK-scan: [13:24 - 14:1] FunctionDecl=function:13:6 (Definition) |
| 28 | // CHECK-scan: [14:1 - 16:2] UnexposedStmt= |
Ted Kremenek | 1d5fdf3 | 2009-11-18 02:02:52 +0000 | [diff] [blame] | 29 | |
Daniel Dunbar | 8f0bf81 | 2010-02-14 08:32:51 +0000 | [diff] [blame] | 30 | // CHECK-load: TestClassDecl.m:10:12: ObjCInterfaceDecl=Foo:10:12 Extent=[10:1 - 11:5] |
| 31 | // CHECK-load: TestClassDecl.m:13:6: FunctionDecl=function:13:6 (Definition) Extent=[13:6 - 16:2] |
| 32 | // CHECK-load: TestClassDecl.m:13:21: ParmDecl=arg:13:21 (Definition) Extent=[13:15 - 13:24] |
Ted Kremenek | 1d5fdf3 | 2009-11-18 02:02:52 +0000 | [diff] [blame] | 33 | |