blob: 899765eb0a2df48d6b18cc728e09fd90e113e8ed [file] [log] [blame]
Douglas Gregor7ae2faa2010-08-13 05:36:37 +00001// RUN: c-index-test -write-pch %t.ast -fobjc-nonfragile-abi -fblocks -x objective-c %s
Tim Northover931a4fe2013-08-12 12:51:05 +00002// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=CHECK-scan %s
3// RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=CHECK-load %s
Ted Kremenek1d5fdf32009-11-18 02:02:52 +00004
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
13void function(Foo * arg)
14{
15 // nothing here.
16}
17
Daniel Dunbar8f0bf812010-02-14 08:32:51 +000018// CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound
Argyrios Kyrtzidisc15707d2012-01-24 21:39:26 +000019// CHECK-scan: [8:1 - 8:8] ObjCInterfaceDecl=Foo:8:8
Douglas Gregordeacbdc2010-08-11 12:19:30 +000020// CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:10:12
Daniel Dunbar8f0bf812010-02-14 08:32:51 +000021// CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound
22// CHECK-scan: [10:1 - 11:5] ObjCInterfaceDecl=Foo:10:12
Douglas Gregor66537982010-11-17 17:14:07 +000023// CHECK-scan: [11:5 - 13:1] Invalid Cursor => NoDeclFound
24// CHECK-scan: [13:1 - 13:15] FunctionDecl=function:13:6 (Definition)
Daniel Dunbar8f0bf812010-02-14 08:32:51 +000025// 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)
Douglas Gregor42b29842011-10-05 19:00:14 +000028// CHECK-scan: [14:1 - 16:2] CompoundStmt=
Ted Kremenek1d5fdf32009-11-18 02:02:52 +000029
Daniel Dunbar8f0bf812010-02-14 08:32:51 +000030// CHECK-load: TestClassDecl.m:10:12: ObjCInterfaceDecl=Foo:10:12 Extent=[10:1 - 11:5]
Abramo Bagnaraff676cb2011-03-08 08:55:46 +000031// CHECK-load: TestClassDecl.m:13:6: FunctionDecl=function:13:6 (Definition) Extent=[13:1 - 16:2]
Daniel Dunbar8f0bf812010-02-14 08:32:51 +000032// CHECK-load: TestClassDecl.m:13:21: ParmDecl=arg:13:21 (Definition) Extent=[13:15 - 13:24]
Ted Kremenek1d5fdf32009-11-18 02:02:52 +000033