aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/label-unused.c
diff options
context:
space:
mode:
Diffstat (limited to 'validation/label-unused.c')
-rw-r--r--validation/label-unused.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/validation/label-unused.c b/validation/label-unused.c
new file mode 100644
index 00000000..e3f255e1
--- /dev/null
+++ b/validation/label-unused.c
@@ -0,0 +1,29 @@
+static void foo(void)
+{
+l:
+ return;
+}
+
+static int bar(void)
+{
+ return ({
+l:
+ ;
+ 0;
+ });
+}
+
+static void baz(void)
+{
+l: __attribute__((unused));
+ return;
+}
+
+/*
+ * check-name: label-unused
+ *
+ * check-error-start
+label-unused.c:3:1: warning: unused label 'l'
+label-unused.c:10:1: warning: unused label 'l'
+ * check-error-end
+ */