xref: /minix3/external/bsd/llvm/dist/clang/test/Index/complete-enums.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // Note: the run lines follow their respective tests, since line/column
2*f4a2713aSLionel Sambuc // matter in this test.
3*f4a2713aSLionel Sambuc struct X { X(); ~X(); };
4*f4a2713aSLionel Sambuc enum class Color {
5*f4a2713aSLionel Sambuc   Red = 17,
6*f4a2713aSLionel Sambuc   Green,
7*f4a2713aSLionel Sambuc   Blue
8*f4a2713aSLionel Sambuc };
9*f4a2713aSLionel Sambuc int Greeby();
f(Color color)10*f4a2713aSLionel Sambuc void f(Color color) {
11*f4a2713aSLionel Sambuc   switch (color) {
12*f4a2713aSLionel Sambuc   case Color::Green: { X x; }
13*f4a2713aSLionel Sambuc   case Color::Red;
14*f4a2713aSLionel Sambuc   }
15*f4a2713aSLionel Sambuc }
16*f4a2713aSLionel Sambuc 
17*f4a2713aSLionel Sambuc // RUN: c-index-test -code-completion-at=%s:12:8 -std=c++11  %s | FileCheck -check-prefix=CHECK-CC1 %s
18*f4a2713aSLionel Sambuc // CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Blue} (7)
19*f4a2713aSLionel Sambuc // CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Green} (7)
20*f4a2713aSLionel Sambuc // CHECK-CC1: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Red} (7)
21*f4a2713aSLionel Sambuc 
22*f4a2713aSLionel Sambuc // RUN: c-index-test -code-completion-at=%s:13:8 -std=c++11  %s | FileCheck -check-prefix=CHECK-CC2 %s
23*f4a2713aSLionel Sambuc // CHECK-CC2: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Blue} (7)
24*f4a2713aSLionel Sambuc // CHECK-CC2-NOT: Green
25*f4a2713aSLionel Sambuc // CHECK-CC2: EnumConstantDecl:{ResultType Color}{Text Color::}{TypedText Red} (7)
26