diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-08-17 00:31:25 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-08-17 00:31:25 +0000 |
| commit | 6f5bd2f6300925ae8517da81491b923958e797a6 (patch) | |
| tree | a6172932a033c6f58464b868264d738b292743ef /clang/test/Index/get-cursor-macro-args.m | |
| parent | 161868db4cbaf93a798e32024aa2fefde221896c (diff) | |
| download | bcm5719-llvm-6f5bd2f6300925ae8517da81491b923958e797a6.tar.gz bcm5719-llvm-6f5bd2f6300925ae8517da81491b923958e797a6.zip | |
[libclang] Make clang_getCursor able to handle locations that point inside macro arguments.
e.g. for:
\define INVOKE(METHOD, CLASS) [CLASS METHOD]
void test2() {
INVOKE(meth, MyClass);
}
Pointing at 'meth' will give a CXCursor_ObjCMessageExpr and pointing at 'MyClass'
will give a CXCursor_ObjCClassRef.
llvm-svn: 137796
Diffstat (limited to 'clang/test/Index/get-cursor-macro-args.m')
| -rw-r--r-- | clang/test/Index/get-cursor-macro-args.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Index/get-cursor-macro-args.m b/clang/test/Index/get-cursor-macro-args.m new file mode 100644 index 00000000000..4e0ac78fe05 --- /dev/null +++ b/clang/test/Index/get-cursor-macro-args.m @@ -0,0 +1,19 @@ +// Test without PCH +// RUN: c-index-test -cursor-at=%S/get-cursor-macro-args.h:9:12 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:9:21 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:15:12 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:15:20 \ +// RUN: %s -include get-cursor-macro-args.h | FileCheck %s + +// Test with PCH +// RUN: c-index-test -write-pch %t.pch -x objective-c-header %S/get-cursor-macro-args.h +// RUN: c-index-test -cursor-at=%S/get-cursor-macro-args.h:9:12 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:9:21 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:15:12 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:15:20 \ +// RUN: %s -include-pch %t.pch | FileCheck %s + +// CHECK: ObjCClassRef=MyClass:1:12 +// CHECK-NEXT: ObjCMessageExpr=meth:2:1 +// CHECK-NEXT: ObjCMessageExpr=meth:2:1 +// CHECK-NEXT: ObjCClassRef=MyClass:1:12 |

