26 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3void f()4{5 int x = 0;6 goto label1;7 8label1: // expected-note{{previous definition is here}}9 x = 1;10 goto label2; // expected-error{{use of undeclared label 'label2'}}11 12label1: // expected-error{{redefinition of label 'label1'}}13 x = 2;14}15 16void h()17{18 int x = 0;19 switch (x)20 {21 case 1:;22 default:; // expected-error{{multiple default labels in one switch}}23 default:; // expected-note{{previous case defined here}}24 }25}26