Argyrios Kyrtzidis | 5c5f03e | 2011-08-18 19:41:28 +0000 | [diff] [blame] | 1 | struct Point { |
| 2 | float x; |
| 3 | float y; |
| 4 | float z; |
| 5 | }; |
| 6 | |
| 7 | #define MACRO2(x) x |
| 8 | #define MACRO(x) MACRO2(x) |
| 9 | |
| 10 | void test(struct Point *p) { |
| 11 | p->x; |
| 12 | MACRO(p->x); |
| 13 | } |
| 14 | |
Argyrios Kyrtzidis | cd0fd18 | 2012-12-21 01:17:20 +0000 | [diff] [blame^] | 15 | #define MACRO3(x,y,z) x |
| 16 | |
| 17 | void test(struct Point *p) { |
| 18 | MACRO3(p->x); |
| 19 | MACRO3(p->x |
| 20 | } |
| 21 | |
Argyrios Kyrtzidis | 5c5f03e | 2011-08-18 19:41:28 +0000 | [diff] [blame] | 22 | // RUN: c-index-test -code-completion-at=%s:11:12 %s | FileCheck %s |
| 23 | // RUN: c-index-test -code-completion-at=%s:12:12 %s | FileCheck %s |
Argyrios Kyrtzidis | cd0fd18 | 2012-12-21 01:17:20 +0000 | [diff] [blame^] | 24 | // RUN: c-index-test -code-completion-at=%s:18:13 %s | FileCheck %s |
| 25 | // RUN: c-index-test -code-completion-at=%s:19:13 %s | FileCheck %s |
Argyrios Kyrtzidis | 5c5f03e | 2011-08-18 19:41:28 +0000 | [diff] [blame] | 26 | // CHECK: FieldDecl:{ResultType float}{TypedText x} (35) |
| 27 | // CHECK-NEXT: FieldDecl:{ResultType float}{TypedText y} (35) |
| 28 | // CHECK-NEXT: FieldDecl:{ResultType float}{TypedText z} (35) |
| 29 | // CHECK-NEXT: Completion contexts: |
| 30 | // CHECK-NEXT: Arrow member access |
| 31 | // CHECK-NEXT: Container Kind: StructDecl |