diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 17:10:06 +1100 |
commit | be1de4be954c80875ad4108e0a33e8e131b2f2c0 (patch) | |
tree | 1fbbecf276bf7c7bdcbb4dd446099d6d90eaa516 /clang/test/Index/TestClassForwardDecl.m | |
parent | c4626a62754862d20b41e8a46a3574264ea80e6d (diff) | |
parent | f1bd2e48c5324d3f7cda4090c87f8a5b6f463ce2 (diff) |
Merge branch 'master' of ssh://bitbucket.org/czan/honours
Diffstat (limited to 'clang/test/Index/TestClassForwardDecl.m')
-rw-r--r-- | clang/test/Index/TestClassForwardDecl.m | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/clang/test/Index/TestClassForwardDecl.m b/clang/test/Index/TestClassForwardDecl.m new file mode 100644 index 0000000..2f32d33 --- /dev/null +++ b/clang/test/Index/TestClassForwardDecl.m @@ -0,0 +1,41 @@ +// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -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 the @interface is implicitly defined. +// See TestClassDecl.m for the corresponding test case. (<rdar://problem/7383421>) + +@class Foo; + +void function(Foo * arg) +{ + // nothing here. +} + +// CHECK-scan: [1:1 - 8:1] Invalid Cursor => NoDeclFound +// CHECK-scan: [8:1 - 8:8] ObjCInterfaceDecl=Foo:8:8 +// CHECK-scan: [8:8 - 8:11] ObjCClassRef=Foo:8:8 +// CHECK-scan: [8:11 - 10:1] Invalid Cursor => NoDeclFound +// CHECK-scan: [10:1 - 10:15] FunctionDecl=function:10:6 (Definition) +// CHECK-scan: [10:15 - 10:18] ObjCClassRef=Foo:8:8 +// CHECK-scan: [10:18 - 10:24] ParmDecl=arg:10:21 (Definition) +// CHECK-scan: [10:24 - 11:1] FunctionDecl=function:10:6 (Definition) +// CHECK: [11:1 - 13:2] CompundStmt= + + + + + + + + + + + + + + + +// CHECK-load: TestClassForwardDecl.m:10:6: FunctionDecl=function:10:6 (Definition) +// CHECK-load: TestClassForwardDecl.m:10:21: ParmDecl=arg:10:21 + |