summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/annotate-tokens-preamble.c
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-26 08:01:41 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-26 08:01:41 +0000
commit4cdfcae75d7d9eddef079ceff7e6f53a35a89948 (patch)
treea593c66584b28fa9d4272118966b92bfde395559 /clang/test/Index/annotate-tokens-preamble.c
parent8f7180b11e024406e50ed53e27c95af461e6ec4d (diff)
downloadbcm5719-llvm-4cdfcae75d7d9eddef079ceff7e6f53a35a89948.tar.gz
bcm5719-llvm-4cdfcae75d7d9eddef079ceff7e6f53a35a89948.zip
Don't map a file:line:col triplet that is inside the preamble range to
a "loaded" location of the precompiled preamble. Instead, handle specially locations of preprocessed entities: -When looking up for preprocessed entities, map main file locations inside the preamble range to a preamble loaded location. -When getting the source range of a preprocessing cursor, map preamble loaded locations back to main file locations. Fixes rdar://10175093 & http://llvm.org/PR10999 llvm-svn: 140519
Diffstat (limited to 'clang/test/Index/annotate-tokens-preamble.c')
-rw-r--r--clang/test/Index/annotate-tokens-preamble.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/Index/annotate-tokens-preamble.c b/clang/test/Index/annotate-tokens-preamble.c
new file mode 100644
index 00000000000..afac87a77aa
--- /dev/null
+++ b/clang/test/Index/annotate-tokens-preamble.c
@@ -0,0 +1,20 @@
+// A comment line.
+
+void f(void *ptr) {
+}
+
+
+// RUN: c-index-test -test-annotate-tokens=%s:1:1:5:1 %s | FileCheck %s
+// RUN: env CINDEXTEST_EDITING=1 c-index-test -test-annotate-tokens=%s:1:1:5:1 %s | FileCheck %s
+// CHECK: Comment: "// A comment line." [1:1 - 1:19]
+// CHECK: Keyword: "void" [3:1 - 3:5] FunctionDecl=f:3:6 (Definition)
+// CHECK: Identifier: "f" [3:6 - 3:7] FunctionDecl=f:3:6 (Definition)
+// CHECK: Punctuation: "(" [3:7 - 3:8] FunctionDecl=f:3:6 (Definition)
+// CHECK: Keyword: "void" [3:8 - 3:12] ParmDecl=ptr:3:14 (Definition)
+// CHECK: Punctuation: "*" [3:13 - 3:14] ParmDecl=ptr:3:14 (Definition)
+// CHECK: Identifier: "ptr" [3:14 - 3:17] ParmDecl=ptr:3:14 (Definition)
+// CHECK: Punctuation: ")" [3:17 - 3:18] FunctionDecl=f:3:6 (Definition)
+// CHECK: Punctuation: "{" [3:19 - 3:20] UnexposedStmt=
+// CHECK: Punctuation: "}" [4:1 - 4:2] UnexposedStmt=
+
+
OpenPOWER on IntegriCloud