xref: /minix3/external/bsd/llvm/dist/clang/test/Index/TestClassForwardDecl.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -o %t.ast
2*f4a2713aSLionel Sambuc// RUN: c-index-test -test-file-scan %t.ast %s | FileCheck -check-prefix=CHECK-scan %s
3*f4a2713aSLionel Sambuc// RUN: c-index-test -test-load-tu %t.ast local | FileCheck -check-prefix=CHECK-load %s
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc// This test checks how the @class resolves as a cursor when the @interface is implicitly defined.
6*f4a2713aSLionel Sambuc// See TestClassDecl.m for the corresponding test case. (<rdar://problem/7383421>)
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambuc@class Foo;
9*f4a2713aSLionel Sambuc
10*f4a2713aSLionel Sambucvoid function(Foo * arg)
11*f4a2713aSLionel Sambuc{
12*f4a2713aSLionel Sambuc    // nothing here.
13*f4a2713aSLionel Sambuc}
14*f4a2713aSLionel Sambuc
15*f4a2713aSLionel Sambuc// CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound
16*f4a2713aSLionel Sambuc// CHECK-scan: [8:1 - 8:8] ObjCInterfaceDecl=Foo:8:8
17*f4a2713aSLionel Sambuc// CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:8:8
18*f4a2713aSLionel Sambuc// CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound
19*f4a2713aSLionel Sambuc// CHECK-scan: [10:1 - 10:15] FunctionDecl=function:10:6 (Definition)
20*f4a2713aSLionel Sambuc// CHECK-scan: [10:15 - 10:18] ObjCClassRef=Foo:8:8
21*f4a2713aSLionel Sambuc// CHECK-scan: [10:18 - 10:24] ParmDecl=arg:10:21 (Definition)
22*f4a2713aSLionel Sambuc// CHECK-scan: [10:24 - 11:1] FunctionDecl=function:10:6 (Definition)
23*f4a2713aSLionel Sambuc// CHECK: [11:1 - 13:2] CompundStmt=
24*f4a2713aSLionel Sambuc
25*f4a2713aSLionel Sambuc
26*f4a2713aSLionel Sambuc
27*f4a2713aSLionel Sambuc
28*f4a2713aSLionel Sambuc
29*f4a2713aSLionel Sambuc
30*f4a2713aSLionel Sambuc
31*f4a2713aSLionel Sambuc
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambuc
34*f4a2713aSLionel Sambuc
35*f4a2713aSLionel Sambuc
36*f4a2713aSLionel Sambuc
37*f4a2713aSLionel Sambuc
38*f4a2713aSLionel Sambuc
39*f4a2713aSLionel Sambuc// CHECK-load: TestClassForwardDecl.m:10:6: FunctionDecl=function:10:6 (Definition)
40*f4a2713aSLionel Sambuc// CHECK-load: TestClassForwardDecl.m:10:21: ParmDecl=arg:10:21
41*f4a2713aSLionel Sambuc
42