aboutsummaryrefslogtreecommitdiff
path: root/test/Index/code-complete-errors.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-11-09 06:24:54 +0000
committerDouglas Gregor <dgregor@apple.com>2010-11-09 06:24:54 +0000
commita9b06d4c246d6c301e3dd1844f5dba669ed9c631 (patch)
tree250b364482b355d61c7306c371105fd26e031519 /test/Index/code-complete-errors.c
parent27a31fe6fac7eb98ece172bf83af93a3a103f5b4 (diff)
ntroduce clang_getSpellingLocation() into libclang, to provide the
location where we're spelling a token even within a macro. clang_getInstantiationLocation() tells where we instantiated the macro. I'm still not thrilled with the CXSourceLocation/CXSourceRange APIs, since they gloss over macro-instantiation information. Take 2: this time, adjusted tests appropriately and used a "simple" approach to the spelling location. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/code-complete-errors.c')
-rw-r--r--test/Index/code-complete-errors.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Index/code-complete-errors.c b/test/Index/code-complete-errors.c
index 01c298c01d..4fe213eca6 100644
--- a/test/Index/code-complete-errors.c
+++ b/test/Index/code-complete-errors.c
@@ -10,7 +10,14 @@ int f(int *ptr1, float *ptr2) {
return ptr1 != ptr2; // CHECK: code-complete-errors.c:10:15:{10:10-10:14}{10:18-10:22}: warning: comparison of distinct pointer types ('int *' and 'float *')
}
+#define expand_to_binary_function(ret, name, parm1, parm2, code) ret name(parm1, parm2) code
+
+expand_to_binary_function(int, g, int *ip, float *fp, {
+// CHECK: code-complete-errors.c:17:15:{17:12-17:14}{17:18-17:20}: warning: comparison of distinct pointer types ('int *' and 'float *')
+ return ip == fp;
+ })
+
void g() { }
-// RUN: c-index-test -code-completion-at=%s:13:12 -pedantic %s 2> %t
+// RUN: c-index-test -code-completion-at=%s:19:12 -pedantic %s 2> %t
// RUN: FileCheck -check-prefix=CHECK %s < %t