aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/label-stmt-expr1.c
diff options
context:
space:
mode:
Diffstat (limited to 'validation/label-stmt-expr1.c')
-rw-r--r--validation/label-stmt-expr1.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/validation/label-stmt-expr1.c b/validation/label-stmt-expr1.c
new file mode 100644
index 00000000..339217dc
--- /dev/null
+++ b/validation/label-stmt-expr1.c
@@ -0,0 +1,29 @@
+static int foo(void)
+{
+ goto l;
+ ({
+l:
+ 0;
+ });
+}
+
+static void bar(void)
+{
+ ({
+l:
+ 0;
+ });
+ goto l;
+}
+
+/*
+ * check-name: label-stmt-expr1
+ * check-known-to-fail
+ *
+ * check-error-start
+label-stmt-expr1.c:3:9: error: label 'l' used outside statement expression
+label-stmt-expr1.c:5:1: label 'l' defined here
+label-stmt-expr1.c:16:9: error: label 'l' used outside statement expression
+label-stmt-expr1.c:13:1: label 'l' defined here
+ * check-error-end
+ */