Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | /* RUN: %clang_cc1 -fsyntax-only -verify %s |
Chris Lattner | 95cfb85 | 2007-07-22 04:13:33 +0000 | [diff] [blame] | 2 | */ |
| 3 | |
Chris Lattner | 4ae493c | 2011-02-18 02:08:43 +0000 | [diff] [blame] | 4 | void test1() { |
Chris Lattner | 95cfb85 | 2007-07-22 04:13:33 +0000 | [diff] [blame] | 5 | goto ; /* expected-error {{expected identifier}} */ |
| 6 | } |
Chris Lattner | 4ae493c | 2011-02-18 02:08:43 +0000 | [diff] [blame] | 7 | |
| 8 | |
| 9 | void test2() { |
| 10 | l: /* expected-note {{previous definition is here}} */ |
| 11 | |
| 12 | { |
| 13 | __label__ l; |
| 14 | l: goto l; |
| 15 | } |
| 16 | |
| 17 | { |
| 18 | __label__ l; |
| 19 | __label__ h; /* expected-error {{use of undeclared label 'h'}} */ |
| 20 | l: goto l; |
| 21 | } |
| 22 | |
| 23 | /* PR3429 & rdar://8287027 |
| 24 | */ |
| 25 | { |
| 26 | l: /* expected-error {{redefinition of label 'l'}} */ |
| 27 | ; |
| 28 | } |
| 29 | |
| 30 | } |