blob: ce195b175f3c2f48afad4e251234e40227b7c189 [file] [log] [blame]
Chris Lattner4b009652007-07-25 00:24:17 +00001// RUN: clang -parse-ast-check %s
2
Chris Lattner4b009652007-07-25 00:24:17 +00003void f (int z) {
4 while (z) {
5 default: z--; // expected-error {{statement not in switch}}
6 }
7}
8
Chris Lattner3429a812007-08-23 05:46:52 +00009void foo(int X) {
10 switch (X) {
Chris Lattner1a4066d2007-08-23 06:23:56 +000011 case 42: ; // expected-error {{previous case value}}
Chris Lattner3429a812007-08-23 05:46:52 +000012 case 5000000000LL: // expected-warning {{overflow}}
Chris Lattner1a4066d2007-08-23 06:23:56 +000013 case 42: // expected-error {{duplicate case value}}
Chris Lattner3429a812007-08-23 05:46:52 +000014 ;
15 }
16}
17