• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
f()3 void f()
4 {
5   int x = 0;
6   goto label1;
7 
8 label1: // expected-note{{previous definition is here}}
9   x = 1;
10   goto label2; // expected-error{{use of undeclared label 'label2'}}
11 
12 label1: // expected-error{{redefinition of label 'label1'}}
13   x = 2;
14 }
15 
h()16 void 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