summaryrefslogtreecommitdiffstats
path: root/test/CodeCompletion
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-28 21:50:18 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-28 21:50:18 +0000
commitf9578436414e4a5e4af8b77567b89c1679f99519 (patch)
tree39ba6d993ca522f4194750254c8ca0f069c7b61c /test/CodeCompletion
parenta9f2368a4016901b5e2ed109b1eead2835ca8242 (diff)
When performing code completion for a case statement in a switch whose
condition is not of enumeration type, provide code-completion results containing all values of integral or enumeral type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109677 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeCompletion')
-rw-r--r--test/CodeCompletion/enum-switch-case.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/CodeCompletion/enum-switch-case.c b/test/CodeCompletion/enum-switch-case.c
index 082072600f..d5df371152 100644
--- a/test/CodeCompletion/enum-switch-case.c
+++ b/test/CodeCompletion/enum-switch-case.c
@@ -18,11 +18,28 @@ void test(enum Color color) {
case Green:
break;
-
+ }
+
+ unsigned c2;
+ switch (c2) {
+ case
+ }
+
// RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:19:10 %s -o - | FileCheck -check-prefix=CC1 %s
// CHECK-CC1: Blue
// CHECK-CC1-NEXT: Green
// CHECK-CC1-NEXT: Indigo
// CHECK-CC1-NEXT: Orange
// CHECK-CC1-NEXT: Violet
-
+
+ // RUN: %clang_cc1 -fsyntax-only -code-completion-at=%s:25:10 %s -o - | FileCheck -check-prefix=CC2 %s
+ // CHECK-CC2: COMPLETION: Blue : [#enum Color#]Blue
+ // CHECK-CC2-NEXT: COMPLETION: c2 : [#unsigned int#]c2
+ // CHECK-CC2-NEXT: COMPLETION: color : [#enum Color#]color
+ // CHECK-CC2-NEXT: COMPLETION: Green : [#enum Color#]Green
+ // CHECK-CC2-NEXT: COMPLETION: Indigo : [#enum Color#]Indigo
+ // CHECK-CC2-NEXT: COMPLETION: Orange : [#enum Color#]Orange
+ // CHECK-CC2-NEXT: COMPLETION: Red : [#enum Color#]Red
+ // CHECK-CC2-NEXT: COMPLETION: Pattern : sizeof(<#expression-or-type#>)
+ // CHECK-CC2-NEXT: COMPLETION: Violet : [#enum Color#]Violet
+ // CHECK-CC2-NEXT: COMPLETION: Yellow : [#enum Color#]Yellow