summaryrefslogtreecommitdiff
path: root/test/Parser/goto.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2011-02-20 13:06:31 +0000
committerDimitry Andric <dim@FreeBSD.org>2011-02-20 13:06:31 +0000
commitbca07a4524feb4edec581062d631a13116320a24 (patch)
treea9243275843fbeaa590afc07ee888e006b8d54ea /test/Parser/goto.c
parent998bc5802ecdd65ce3b270f6c69a8ae8557f0a10 (diff)
Notes
Diffstat (limited to 'test/Parser/goto.c')
-rw-r--r--test/Parser/goto.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Parser/goto.c b/test/Parser/goto.c
new file mode 100644
index 0000000000000..a3e01174eb94f
--- /dev/null
+++ b/test/Parser/goto.c
@@ -0,0 +1,30 @@
+/* RUN: %clang_cc1 -fsyntax-only -verify %s
+*/
+
+void test1() {
+ goto ; /* expected-error {{expected identifier}} */
+}
+
+
+void test2() {
+ l: /* expected-note {{previous definition is here}} */
+
+ {
+ __label__ l;
+ l: goto l;
+ }
+
+ {
+ __label__ l;
+ __label__ h; /* expected-error {{use of undeclared label 'h'}} */
+ l: goto l;
+ }
+
+ /* PR3429 & rdar://8287027
+ */
+ {
+ l: /* expected-error {{redefinition of label 'l'}} */
+ ;
+ }
+
+}