summaryrefslogtreecommitdiffstats
path: root/clang/test/Index/c-index-getCursor-pp.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-12-10 07:23:11 +0000
committerDouglas Gregor <dgregor@apple.com>2010-12-10 07:23:11 +0000
commit3046b4d72fa98863cc6773cf99426876308ea621 (patch)
tree8db790ba759423b28a5ad6a8649389cae4d49ff6 /clang/test/Index/c-index-getCursor-pp.c
parent49590148504ec0f9939943704f68e99d35e96895 (diff)
downloadbcm5719-llvm-3046b4d72fa98863cc6773cf99426876308ea621.tar.gz
bcm5719-llvm-3046b4d72fa98863cc6773cf99426876308ea621.zip
In clang_getCursor(), don't override a preprocessing cursor within
another preprocessing cursor, since we want the outermost one. llvm-svn: 121470
Diffstat (limited to 'clang/test/Index/c-index-getCursor-pp.c')
-rw-r--r--clang/test/Index/c-index-getCursor-pp.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Index/c-index-getCursor-pp.c b/clang/test/Index/c-index-getCursor-pp.c
index 2393965c283..8f986912cd6 100644
--- a/clang/test/Index/c-index-getCursor-pp.c
+++ b/clang/test/Index/c-index-getCursor-pp.c
@@ -8,6 +8,11 @@ void OBSCURE(func)(int x) {
#include "a.h"
+#define A(X) X
+#define B(X) A(X)
+
+B(int x);
+
// 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
@@ -20,6 +25,8 @@ void OBSCURE(func)(int x) {
// CHECK-5: macro instantiation=DECORATION:2:9
// RUN: c-index-test -cursor-at=%s:9:10 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-6 %s
// CHECK-6: inclusion directive=a.h
+// RUN: c-index-test -cursor-at=%s:14:1 -I%S/Inputs %s | FileCheck -check-prefix=CHECK-7 %s
+// CHECK-7: macro instantiation=B:12:9
// 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
OpenPOWER on IntegriCloud