diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-11-09 06:24:54 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-11-09 06:24:54 +0000 |
| commit | 229bebdeb584d4491e40c9b10a3a22485db5c54a (patch) | |
| tree | 7a85d32118f793190283ec45c14427f62437dd29 /clang/test/Index | |
| parent | 12a610d1fa79c11ff9aec2ae1cdf258ed131ae88 (diff) | |
| download | bcm5719-llvm-229bebdeb584d4491e40c9b10a3a22485db5c54a.tar.gz bcm5719-llvm-229bebdeb584d4491e40c9b10a3a22485db5c54a.zip | |
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.
llvm-svn: 118495
Diffstat (limited to 'clang/test/Index')
| -rw-r--r-- | clang/test/Index/annotate-tokens-pp.c | 2 | ||||
| -rw-r--r-- | clang/test/Index/blocks.c | 1 | ||||
| -rw-r--r-- | clang/test/Index/code-complete-errors.c | 9 |
3 files changed, 9 insertions, 3 deletions
diff --git a/clang/test/Index/annotate-tokens-pp.c b/clang/test/Index/annotate-tokens-pp.c index a6e7fb99d60..3dd9ffeddcb 100644 --- a/clang/test/Index/annotate-tokens-pp.c +++ b/clang/test/Index/annotate-tokens-pp.c @@ -173,7 +173,7 @@ void test() { // CHECK: Punctuation: "," [25:26 - 25:27] UnexposedStmt= // CHECK: Punctuation: "{" [25:28 - 25:29] UnexposedStmt= // CHECK: Keyword: "int" [25:30 - 25:33] UnexposedStmt= -// CHECK: Identifier: "z" [25:34 - 25:35] VarDecl=z:25:3 (Definition) +// CHECK: Identifier: "z" [25:34 - 25:35] VarDecl=z:25:34 (Definition) // CHECK: Punctuation: "=" [25:36 - 25:37] UnexposedStmt= // CHECK: Identifier: "x" [25:38 - 25:39] DeclRefExpr=x:24:7 // CHECK: Punctuation: ";" [25:39 - 25:40] UnexposedStmt= diff --git a/clang/test/Index/blocks.c b/clang/test/Index/blocks.c index 5a31a212558..a8965d2aa67 100644 --- a/clang/test/Index/blocks.c +++ b/clang/test/Index/blocks.c @@ -14,7 +14,6 @@ void test() { // CHECK: blocks.c:7:3: UnexposedStmt= Extent=[7:3 - 7:26] // CHECK: blocks.c:7:21: VarDecl=_foo:7:21 (Definition) Extent=[7:17 - 7:25] // CHECK: blocks.c:7:17: TypeRef=struct foo:4:8 Extent=[7:17 - 7:20] -// CHECK: blocks.c:8:3: UnexposedStmt= Extent=[8:3 - 8:17] // CHECK: blocks.c:8:11: VarDecl=i:8:11 (Definition) Extent=[8:11 - 8:16] // CHECK: blocks.c:8:15: UnexposedExpr= Extent=[8:15 - 8:16] // CHECK: blocks.c:9:3: CallExpr= Extent=[9:3 - 9:65] diff --git a/clang/test/Index/code-complete-errors.c b/clang/test/Index/code-complete-errors.c index 01c298c01d9..4fe213eca65 100644 --- a/clang/test/Index/code-complete-errors.c +++ b/clang/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 |

