aboutsummaryrefslogtreecommitdiff
path: root/test/Index/TestClassDecl.m
blob: b55c8623a514bccb5b96db3f5e930fb9eaf1e4ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -emit-pch -x objective-c %s -o %t.ast
// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=scan %s
// RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=load %s

// This test checks how the @class resolves as a cursor when there is a real definition
// that follows. <rdar://problem/7383421>

@class Foo;

@interface Foo
@end

void function(Foo * arg)
{
    // nothing here.
}

// CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound
// CHECK-scan: [8:1 - 8:8] UnexposedDecl=:8:1
// CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:10:12
// CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound
// CHECK-scan: [10:1 - 11:5] ObjCInterfaceDecl=Foo:10:12
// CHECK-scan: [11:5 - 13:6] Invalid Cursor => NoDeclFound
// CHECK-scan: [13:6 - 13:15] FunctionDecl=function:13:6 (Definition)
// CHECK-scan: [13:15 - 13:18] ObjCClassRef=Foo:10:12
// CHECK-scan: [13:18 - 13:24] ParmDecl=arg:13:21 (Definition)
// CHECK-scan: [13:24 - 14:1] FunctionDecl=function:13:6 (Definition)
// CHECK-scan: [14:1 - 16:2] UnexposedStmt=

// CHECK-load: TestClassDecl.m:10:12: ObjCInterfaceDecl=Foo:10:12 Extent=[10:1 - 11:5]
// CHECK-load: TestClassDecl.m:13:6: FunctionDecl=function:13:6 (Definition) Extent=[13:6 - 16:2]
// CHECK-load: TestClassDecl.m:13:21: ParmDecl=arg:13:21 (Definition) Extent=[13:15 - 13:24]