diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-08 02:21:17 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-12-08 02:21:17 +0000 |
commit | f77b0f888690e056e7da4efe94f5e97f996f6b05 (patch) | |
tree | 56d4908f75d242c4859a5d2b610a7ab7289f7c96 /clang/test/Index/c-index-getCursor-pp.c | |
parent | 222a7bbf0ded69b369d05dbeeceef0d86cbb0f37 (diff) | |
download | bcm5719-llvm-f77b0f888690e056e7da4efe94f5e97f996f6b05.tar.gz bcm5719-llvm-f77b0f888690e056e7da4efe94f5e97f996f6b05.zip |
[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.
llvm-svn: 169666
Diffstat (limited to 'clang/test/Index/c-index-getCursor-pp.c')
-rw-r--r-- | clang/test/Index/c-index-getCursor-pp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Index/c-index-getCursor-pp.c b/clang/test/Index/c-index-getCursor-pp.c index 01b0a6972ee..48d07adf220 100644 --- a/clang/test/Index/c-index-getCursor-pp.c +++ b/clang/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 |