summaryrefslogtreecommitdiffstats
path: root/test/Index
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-06-09 01:20:48 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2017-06-09 01:20:48 +0000
commit4ed69c25ab95ef923b9917a3c3599665ca7bbda7 (patch)
tree952df9ebbe1e305b9f001b390ed07bf9f6a91b1a /test/Index
parent12bfbed8ef5bd7575f1880c93e50d9a1bee5ee8e (diff)
[libclang] Introduce a new parsing option 'CXTranslationUnit_SingleFileParse' that puts preprocessor in a mode for parsing a single file only.
This is useful for parsing a single file, as a fast/inaccurate 'mode' that can still provide declarations from the file, like the classes and their methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305044 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index')
-rw-r--r--test/Index/singe-file-parse.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Index/singe-file-parse.m b/test/Index/singe-file-parse.m
new file mode 100644
index 0000000000..d13915b30c
--- /dev/null
+++ b/test/Index/singe-file-parse.m
@@ -0,0 +1,11 @@
+// RUN: c-index-test -single-file-parse %s | FileCheck %s
+
+#include <stdint.h>
+
+// CHECK-NOT: TypedefDecl=intptr_t
+
+// CHECK: [[@LINE+1]]:12: ObjCInterfaceDecl=MyCls
+@interface MyCls
+// CHECK: [[@LINE+1]]:8: ObjCInstanceMethodDecl=some_meth
+-(void)some_meth;
+@end