blob: c96fb5a0206bb68f7409f4df38a55f9e7a92c4c2 [file] [log] [blame]
Daniel Dunbara5728872009-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 Kremenek1d5fdf32009-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
Douglas Gregor30122132010-01-19 22:07:56 +000016// CHECK-scan: {start_line=8 start_col=1 end_line=8 end_col=7} UnexposedDecl=:8:1
Douglas Gregorc5d1e932010-01-19 01:20:04 +000017// CHECK-scan: {start_line=8 start_col=8 end_line=8 end_col=10} ObjCClassRef=Foo:8:8
Douglas Gregor33e9abd2010-01-22 19:49:59 +000018// CHECK-scan: {start_line=8 start_col=11 end_line=10 end_col=5} Invalid Cursor => NoDeclFound
Douglas Gregorb6998662010-01-19 19:34:47 +000019// CHECK-scan: {start_line=10 start_col=6 end_line=10 end_col=14} FunctionDecl=function:10:6 (Definition)
Douglas Gregorc5d1e932010-01-19 01:20:04 +000020// CHECK-scan: {start_line=10 start_col=15 end_line=10 end_col=17} ObjCClassRef=Foo:8:8
Douglas Gregor33e9abd2010-01-22 19:49:59 +000021// CHECK-scan: {start_line=10 start_col=18 end_line=10 end_col=23} ParmDecl=arg:10:21 (Definition)
22// CHECK-scan: {start_line=10 start_col=24 end_line=10 end_col=25} FunctionDecl=function:10:6 (Definition)
Douglas Gregor60cbfac2010-01-25 16:56:17 +000023// CHECK-scan: {start_line=11 start_col=1 end_line=13 end_col=1} UnexposedStmt=
Ted Kremenek1d5fdf32009-11-18 02:02:52 +000024
Daniel Dunbar2f43b212009-11-18 20:19:44 +000025
26
27
28
29
30
31
32
33
34
35
36
37
38
Douglas Gregorb6998662010-01-19 19:34:47 +000039// CHECK-load: TestClassForwardDecl.m:10:6: FunctionDecl=function:10:6 (Definition)
Ted Kremenekcf84aa42010-01-18 20:23:29 +000040// CHECK-load: TestClassForwardDecl.m:10:21: ParmDecl=arg:10:21
Ted Kremenek1d5fdf32009-11-18 02:02:52 +000041