diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-21 18:10:23 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-21 18:10:23 +0000 |
commit | 3e1005f085006dfb3545f0c54ac5e22483137c7d (patch) | |
tree | 5283db3a9e3b8fdbc5449a436b48d22b8f5b69bf /test/CodeCompletion/enum-switch-case.c | |
parent | 86d9a52c24d390631a888d4ff812e1b15445e0a0 (diff) |
Code completion for "case" statements within a switch on an expression
of enumeration type, providing the various unused enumerators as options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeCompletion/enum-switch-case.c')
-rw-r--r-- | test/CodeCompletion/enum-switch-case.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/CodeCompletion/enum-switch-case.c b/test/CodeCompletion/enum-switch-case.c new file mode 100644 index 0000000000..08488f75c1 --- /dev/null +++ b/test/CodeCompletion/enum-switch-case.c @@ -0,0 +1,27 @@ +// RUN: clang-cc -fsyntax-only -code-completion-dump=1 %s -o - | FileCheck -check-prefix=CC1 %s && +// RUN: true + +enum Color { + Red, + Orange, + Yellow, + Green, + Blue, + Indigo, + Violet +}; + +void test(enum Color color) { + switch (color) { + case Red: + break; + + case Yellow: + break; + + // CHECK-CC1: Blue : 0 + // CHECK-NEXT-CC1: Green : 0 + // CHECK-NEXT-CC1: Indigo : 0 + // CHECK-NEXT-CC1: Orange : 0 + // CHECK-NEXT-CC1: Violet : 0 + case |