aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-05-26 18:19:19 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2018-05-26 18:34:55 +0200
commit8efcdf62178fd8cb97d1626443dcf560c1d895b8 (patch)
tree7050c160d8e02ef0ff43fa233194ac483a8c58ca /validation
parent943416a743501230f89879fa63d8186694df2e55 (diff)
downloadsparse-dev-8efcdf62178fd8cb97d1626443dcf560c1d895b8.tar.gz
label: add testcase for label redefinition
Redefined labels create inconsistencies in BB processing. Add a testcase for it. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
-rw-r--r--validation/label-redefined.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/validation/label-redefined.c b/validation/label-redefined.c
new file mode 100644
index 00000000..5e0a51b4
--- /dev/null
+++ b/validation/label-redefined.c
@@ -0,0 +1,18 @@
+extern void fun(void);
+
+static void foo(int p)
+{
+l:
+ if (p)
+l:
+ fun();
+}
+
+/*
+ * check-name: label-redefined
+ * check-known-to-fail
+ *
+ * check-error-start
+label-redefined.c:7:1: error: label 'l' redefined
+ * check-error-end
+ */