blob: c9d9831d513fd349f83937506ddfc199d2cbea82 [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fblocks -emit-pch -x objective-c %s -o %t.ast
Ted Kremenek0469b7e2009-11-18 02:02:52 +00002// 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 the @interface is implicitly defined.
6// See TestClassDecl.m for the corresponding test case. (<rdar://problem/7383421>)
7
8@class Foo;
9
10void function(Foo * arg)
11{
12 // nothing here.
13}
14
15// CHECK-scan: {start_line=1 start_col=1 end_line=7 end_col=1} Invalid Cursor => NoDeclFound
16// CHECK-scan: {start_line=8 start_col=1 end_line=8 end_col=7} Invalid Cursor => NotImplemented
17// CHECK-scan: {start_line=8 start_col=8 end_line=8 end_col=10} ObjCClassRef=Foo:8:1
18// CHECK-scan: {start_line=8 start_col=11 end_line=9 end_col=1} Invalid Cursor => NoDeclFound
Ted Kremenek9cec0002010-01-16 01:44:12 +000019// CHECK-scan: {start_line=10 start_col=1 end_line=10 end_col=4} FunctionDefn=function:10:6
Ted Kremenek0469b7e2009-11-18 02:02:52 +000020// CHECK-scan: {start_line=10 start_col=5 end_line=10 end_col=5} Invalid Cursor => NoDeclFound
Ted Kremenek9cec0002010-01-16 01:44:12 +000021// CHECK-scan: {start_line=10 start_col=6 end_line=10 end_col=14} FunctionDefn=function:10:6
Douglas Gregor46d66142010-01-16 17:14:40 +000022// CHECK-scan: {start_line=10 start_col=15 end_line=10 end_col=17} ObjCClassRef=Foo:8:1
Ted Kremenek9cec0002010-01-16 01:44:12 +000023// CHECK-scan: {start_line=10 start_col=18 end_line=10 end_col=18} FunctionDefn=function:10:6
Ted Kremenek0469b7e2009-11-18 02:02:52 +000024// CHECK-scan: {start_line=10 start_col=19 end_line=10 end_col=19} ParmDecl=arg:10:21
Ted Kremenek9cec0002010-01-16 01:44:12 +000025// CHECK-scan: {start_line=10 start_col=20 end_line=10 end_col=20} FunctionDefn=function:10:6
Ted Kremenek0469b7e2009-11-18 02:02:52 +000026// CHECK-scan: {start_line=10 start_col=21 end_line=10 end_col=23} ParmDecl=arg:10:21
Ted Kremenek9cec0002010-01-16 01:44:12 +000027// CHECK-scan: {start_line=10 start_col=24 end_line=13 end_col=1} FunctionDefn=function:10:6
Ted Kremenek0469b7e2009-11-18 02:02:52 +000028// CHECK-scan: {start_line=13 start_col=2 end_line=46 end_col=1} Invalid Cursor => NoDeclFound
29
Daniel Dunbar9b333522009-11-18 20:19:44 +000030
31
32
33
34
35
36
37
38
39
40
41
42
43
Ted Kremenek473c7a72010-01-18 20:23:29 +000044// CHECK-load: TestClassForwardDecl.m:10:6: FunctionDefn=function:10:6
45// CHECK-load: TestClassForwardDecl.m:10:21: ParmDecl=arg:10:21
Ted Kremenek0469b7e2009-11-18 02:02:52 +000046