diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-24 20:21:13 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-24 20:21:13 +0000 |
commit | 1fbb447e9d43c2c676e94081fbfee7eb6cbe933b (patch) | |
tree | 1b3026ad766c51ee8e035705d31c63f123c9d4d0 /test/Index/complete-preprocessor.m | |
parent | f44e854ed1e3aa86d2ed6d615ccd109d50ddcff9 (diff) |
Implement preprocessor code completion where a macro name is expected,
e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname>
expression in a preprocessor conditional.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111954 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/complete-preprocessor.m')
-rw-r--r-- | test/Index/complete-preprocessor.m | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/Index/complete-preprocessor.m b/test/Index/complete-preprocessor.m index b951c1622e..14c4c150b3 100644 --- a/test/Index/complete-preprocessor.m +++ b/test/Index/complete-preprocessor.m @@ -4,7 +4,12 @@ #if 1 #endif - +#define FOO(a, b) a##b +#define BAR +#ifdef FOO +#endif +#if defined(FOO) +#endif // RUN: c-index-test -code-completion-at=%s:4:2 %s | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: NotImplemented:{TypedText define}{HorizontalSpace }{Placeholder macro} (30) @@ -45,3 +50,8 @@ // CHECK-CC2-NEXT: NotImplemented:{TypedText pragma}{HorizontalSpace }{Placeholder arguments} (30) // CHECK-CC2-NEXT: NotImplemented:{TypedText undef}{HorizontalSpace }{Placeholder macro} (30) // CHECK-CC2-NEXT: NotImplemented:{TypedText warning}{HorizontalSpace }{Placeholder message} (30) +// RUN: c-index-test -code-completion-at=%s:9:8 %s | FileCheck -check-prefix=CHECK-CC3 %s +// CHECK-CC3: NotImplemented:{TypedText BAR} (30) +// CHECK-CC3: NotImplemented:{TypedText FOO} (30) +// RUN: c-index-test -code-completion-at=%s:11:12 %s | FileCheck -check-prefix=CHECK-CC3 %s +// RUN: c-index-test -code-completion-at=%s:11:13 %s | FileCheck -check-prefix=CHECK-CC3 %s |