From 3046b4d72fa98863cc6773cf99426876308ea621 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 10 Dec 2010 07:23:11 +0000 Subject: In clang_getCursor(), don't override a preprocessing cursor within another preprocessing cursor, since we want the outermost one. llvm-svn: 121470 --- clang/test/Index/c-index-getCursor-pp.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'clang/test/Index/c-index-getCursor-pp.c') 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 -- cgit v1.2.3