aboutsummaryrefslogtreecommitdiff
path: root/test/Index/c-index-getCursor-pp.c
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-08 02:21:17 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-12-08 02:21:17 +0000
commit5f5250b140544436eb3c2fbd9f43e14019ef01f2 (patch)
treecde8d8ad3e8c8f256f124f8a5986c6850ddb3ecf /test/Index/c-index-getCursor-pp.c
parent61c1c8ee3fa1bd1f4866d246c72af854be834634 (diff)
[libclang] Resolve a cursor that points to a macro name inside a #ifdef/#ifndef
directive as a macro expansion. This is more of a "macro reference" than a macro expansion but it's close enough for libclang's purposes. If it causes issues we can revisit and introduce a new kind of cursor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169666 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/c-index-getCursor-pp.c')
-rw-r--r--test/Index/c-index-getCursor-pp.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Index/c-index-getCursor-pp.c b/test/Index/c-index-getCursor-pp.c
index 01b0a6972e..48d07adf22 100644
--- a/test/Index/c-index-getCursor-pp.c
+++ b/test/Index/c-index-getCursor-pp.c
@@ -17,6 +17,12 @@ const char *fname = __FILE__;
#include <a.h>
+#ifdef OBSCURE
+#endif
+
+#if defined(OBSCURE)
+#endif
+
// RUN: c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s
// CHECK-1: macro definition=OBSCURE
// RUN: c-index-test -cursor-at=%s:2:14 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-2 %s
@@ -35,6 +41,9 @@ const char *fname = __FILE__;
// CHECK-8: macro expansion=__FILE__
// RUN: c-index-test -cursor-at=%s:18:12 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-9 %s
// CHECK-9: inclusion directive=a.h
+// RUN: c-index-test -cursor-at=%s:20:10 -cursor-at=%s:23:15 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-10 %s
+// CHECK-10: 20:8 macro expansion=OBSCURE
+// CHECK-10: 23:13 macro expansion=OBSCURE
// Same tests, but with "editing" optimizations
// RUN: env CINDEXTEST_EDITING=1 c-index-test -cursor-at=%s:1:11 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-1 %s