summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/c-index-getCursor-pp.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-19 05:22:59 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-19 05:22:59 +0000
commit5272e80ce5dc4c108021ff4624bd0cd72bec83d8 (patch)
tree10a7405574fa691f6c596dd546ec8396977ae688 /clang/test/Index/c-index-getCursor-pp.c
parent83aeaab4620b6c3218ac36a7f329a4cb82abff81 (diff)
downloadbcm5719-llvm-5272e80ce5dc4c108021ff4624bd0cd72bec83d8.tar.gz
bcm5719-llvm-5272e80ce5dc4c108021ff4624bd0cd72bec83d8.zip
Visit preprocessing elements (macro instantiations and macro
definitions) as part of the translation unit, so that normal visitation, token-annotation, and cursor-at retrieval all see preprocessing elements. llvm-svn: 98935
Diffstat (limited to 'clang/test/Index/c-index-getCursor-pp.c')
-rw-r--r--clang/test/Index/c-index-getCursor-pp.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/Index/c-index-getCursor-pp.c b/clang/test/Index/c-index-getCursor-pp.c
new file mode 100644
index 00000000000..67fcfef2e4b
--- /dev/null
+++ b/clang/test/Index/c-index-getCursor-pp.c
@@ -0,0 +1,18 @@
+#define OBSCURE(X) X
+#define DECORATION
+
+typedef int T;
+void OBSCURE(func)(int x) {
+ OBSCURE(T) DECORATION value;
+}
+
+// RUN: c-index-test -cursor-at=%s:1:11 %s | FileCheck -check-prefix=CHECK-1 %s
+// CHECK-1: macro definition=OBSCURE
+// RUN: c-index-test -cursor-at=%s:2:14 %s | FileCheck -check-prefix=CHECK-2 %s
+// CHECK-2: macro definition=DECORATION
+// RUN: c-index-test -cursor-at=%s:5:7 %s | FileCheck -check-prefix=CHECK-3 %s
+// CHECK-3: macro instantiation=OBSCURE:1:9
+// RUN: c-index-test -cursor-at=%s:6:6 %s | FileCheck -check-prefix=CHECK-4 %s
+// CHECK-4: macro instantiation=OBSCURE:1:9
+// RUN: c-index-test -cursor-at=%s:6:19 %s | FileCheck -check-prefix=CHECK-5 %s
+// CHECK-5: macro instantiation=DECORATION:2:9
OpenPOWER on IntegriCloud