1 // RUN: %clang_cc1 -fsyntax-only -verify %s
4 default: z--; // expected-error {{statement not in switch}}
10 case 42: ; // expected-note {{previous case}}
11 case 5000000000LL: // expected-warning {{overflow}}
12 case 42: // expected-error {{duplicate case value}}
15 case 100 ... 99: ; // expected-warning {{empty case range}}
17 case 43: ; // expected-note {{previous case}}
18 case 43 ... 45: ; // expected-error {{duplicate case value}}
20 case 100 ... 20000:; // expected-note {{previous case}}
21 case 15000 ... 40000000:; // expected-error {{duplicate case value}}
41 case g(): // expected-error {{expression is not an integer constant expression}}
42 case 0 ... g(): // expected-error {{expression is not an integer constant expression}}
47 case 0 && g() ... 1 || g():
52 case g() && 0: // expected-error {{expression is not an integer constant expression}} // expected-note {{subexpression not valid in an integer constant expression}}
57 case 0 ... g() || 1: // expected-error {{expression is not an integer constant expression}} // expected-note {{subexpression not valid in an integer constant expression}}
64 default: // expected-note {{previous case defined here}}
65 default: // expected-error {{multiple default labels in one switch}}
73 case 1234: // expected-warning {{overflow converting case value}}
79 int f0(int var) { // expected-note{{'var' declared here}}
80 switch (va) { // expected-error{{use of undeclared identifier 'va'}}
94 switch(a) { //expected-warning{{enumeration value 'B' not handled in switch}}
106 case 3: // expected-warning{{case value not in enumerated type ''}}
112 case 3 ... //expected-warning{{case value not in enumerated type ''}}
113 4: //expected-warning{{case value not in enumerated type ''}}
121 case 0 ... 2: //expected-warning{{case value not in enumerated type ''}}
125 case 1 ... 3: //expected-warning{{case value not in enumerated type ''}}
129 case 0 ... //expected-warning{{case value not in enumerated type ''}}
130 3: //expected-warning{{case value not in enumerated type ''}}
152 switch(a) { //expected-warning{{enumeration value 'B' not handled in switch}}
164 case 0: //expected-warning{{case value not in enumerated type ''}}
166 case 2: //expected-warning{{case value not in enumerated type ''}}
168 case 4: //expected-warning{{case value not in enumerated type ''}}
181 case 0 ... //expected-warning{{case value not in enumerated type ''}}
182 1: //expected-warning{{case value not in enumerated type ''}}
184 case 5 ... //expected-warning{{case value not in enumerated type ''}}
185 9: //expected-warning{{case value not in enumerated type ''}}
187 case 13 ... //expected-warning{{case value not in enumerated type ''}}
188 16: //expected-warning{{case value not in enumerated type ''}}
199 switch(a) { //expected-warning{{enumeration value 'A' not handled in switch}}