diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-20 00:51:32 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-20 00:51:32 +0000 |
commit | 0872a06d1ee1a3b62ef833f955051418d18006a1 (patch) | |
tree | e80dec7e201d432c8d3db16e2808883df05d1779 /test | |
parent | 9fe48561a199ef6e684e0ea9656b425baeca92a8 (diff) |
When associating file ranges of macro arguments with their
macro expansion ranges, make sure to check all the FileID
entries that are contained in the spelling range of the
expansion for the macro argument.
Fixes rdar://12537982
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Index/get-cursor-macro-args.h | 4 | ||||
-rw-r--r-- | test/Index/get-cursor-macro-args.m | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/test/Index/get-cursor-macro-args.h b/test/Index/get-cursor-macro-args.h index 40ec8dc0b8..70d0dc7bf8 100644 --- a/test/Index/get-cursor-macro-args.h +++ b/test/Index/get-cursor-macro-args.h @@ -2,8 +2,8 @@ +(void)meth; @end -#define MACRO2(x) x -#define MACRO(x) MACRO2(x) +#define MACRO2(x) (x) +#define MACRO(x) MACRO2((x)) void test() { MACRO([MyClass meth]); diff --git a/test/Index/get-cursor-macro-args.m b/test/Index/get-cursor-macro-args.m index a439419b76..d5ab72878f 100644 --- a/test/Index/get-cursor-macro-args.m +++ b/test/Index/get-cursor-macro-args.m @@ -1,6 +1,8 @@ // 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:9:9 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:9:22 \ // 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 %S/get-cursor-macro-args.h | FileCheck %s @@ -9,6 +11,8 @@ // 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:9:9 \ +// RUN: -cursor-at=%S/get-cursor-macro-args.h:9:22 \ // 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 @@ -16,4 +20,6 @@ // CHECK: ObjCClassRef=MyClass:1:12 // CHECK-NEXT: ObjCMessageExpr=meth:2:8 // CHECK-NEXT: ObjCMessageExpr=meth:2:8 +// CHECK-NEXT: ObjCMessageExpr=meth:2:8 +// CHECK-NEXT: ObjCMessageExpr=meth:2:8 // CHECK-NEXT: ObjCClassRef=MyClass:1:12 |