1b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor// Note: the run lines follow their respective tests, since line/column
2b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor// matter in this test.
327bec77f5eb0920b401497be32713cb42339edefDouglas Gregorstruct X { X(); ~X(); };
4b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregorenum class Color {
5b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor  Red = 17,
6b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor  Green,
7b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor  Blue
8b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor};
9b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregorint Greeby();
10b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregorvoid f(Color color) {
11b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor  switch (color) {
1227bec77f5eb0920b401497be32713cb42339edefDouglas Gregor  case Color::Green: { X x; }
13b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor  case Color::Red;
14b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor  }
15b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor}
16b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor
17b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor// RUN: c-index-test -code-completion-at=%s:12:8 -std=c++11  %s | FileCheck -check-prefix=CHECK-CC1 %s
18b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor// CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Blue} (7)
19b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor// CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Green} (7)
20b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor// CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Red} (7)
21b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor
22b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor// RUN: c-index-test -code-completion-at=%s:13:8 -std=c++11  %s | FileCheck -check-prefix=CHECK-CC2 %s
23b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor// CHECK-CC2: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Blue} (7)
24b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor// CHECK-CC2-NOT: Green
25b223d8c4266655fe7a9491a0aff0263597672823Douglas Gregor// CHECK-CC2: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Red} (7)
26