aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-11 15:38:34 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-07-14 01:27:55 +0200
commit0394c281af257abb24774bd6f081b7abb9f821e3 (patch)
tree18857df9b9b6100e245e5684661f1477662e82e3
parentc9676a3b0349a1053c673243af52a2ef1b272bd7 (diff)
downloadsparse-0394c281af257abb24774bd6f081b7abb9f821e3.tar.gz
add testcase for incorrect empty expressions
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--validation/empty-assign.c14
-rw-r--r--validation/empty-initializer.c10
2 files changed, 24 insertions, 0 deletions
diff --git a/validation/empty-assign.c b/validation/empty-assign.c
new file mode 100644
index 00000000..48ac626d
--- /dev/null
+++ b/validation/empty-assign.c
@@ -0,0 +1,14 @@
+static int foo(int a)
+{
+ a = ; // KO
+ return a;
+}
+
+/*
+ * check-name: empty-assign
+ * check-known-to-fail
+ *
+ * check-error-start
+empty-assign.c:3:11: error: expression expected before ';'
+ * check-error-end
+ */
diff --git a/validation/empty-initializer.c b/validation/empty-initializer.c
new file mode 100644
index 00000000..0ca763f6
--- /dev/null
+++ b/validation/empty-initializer.c
@@ -0,0 +1,10 @@
+static int i = ; // KO
+
+/*
+ * check-name: empty-initializer
+ * check-known-to-fail
+ *
+ * check-error-start
+empty-initializer.c:1:16: error: expression expected before ';'
+ * check-error-end
+ */