blob: 9696a280661dfaecca76b585175312ea6958fd05 [file] [log] [blame]
John McCall9b0a7ce2011-10-02 01:16:38 +00001// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fblocks -emit-pch -x objective-c %s -o %t.ast
Tim Northover19ae1172013-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 Kremenek0469b7e2009-11-18 02:02:52 +00004
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
Daniel Dunbar6092d502010-02-14 08:32:51 +000015// CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound
Argyrios Kyrtzidis3698cef2012-01-24 21:39:26 +000016// CHECK-scan: [8:1 - 8:8] ObjCInterfaceDecl=Foo:8:8
Daniel Dunbar6092d502010-02-14 08:32:51 +000017// CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:8:8
Douglas Gregor29ee4222010-11-17 17:14:07 +000018// CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound
19// CHECK-scan: [10:1 - 10:15] FunctionDecl=function:10:6 (Definition)
Daniel Dunbar6092d502010-02-14 08:32:51 +000020// CHECK-scan: [10:15 - 10:18] ObjCClassRef=Foo:8:8
21// CHECK-scan: [10:18 - 10:24] ParmDecl=arg:10:21 (Definition)
22// CHECK-scan: [10:24 - 11:1] FunctionDecl=function:10:6 (Definition)
Douglas Gregor4c362d52011-10-05 19:00:14 +000023// CHECK: [11:1 - 13:2] CompundStmt=
Ted Kremenek0469b7e2009-11-18 02:02:52 +000024
Daniel Dunbar9b333522009-11-18 20:19:44 +000025
26
27
28
29
30
31
32
33
34
35
36
37
38
Douglas Gregor6b8232f2010-01-19 19:34:47 +000039// CHECK-load: TestClassForwardDecl.m:10:6: FunctionDecl=function:10:6 (Definition)
Ted Kremenek473c7a72010-01-18 20:23:29 +000040// CHECK-load: TestClassForwardDecl.m:10:21: ParmDecl=arg:10:21
Ted Kremenek0469b7e2009-11-18 02:02:52 +000041