[PATCH 1/3] add testcase for incorrect empty expressions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/empty-assign.c      | 14 ++++++++++++++
 validation/empty-initializer.c | 10 ++++++++++
 2 files changed, 24 insertions(+)
 create mode 100644 validation/empty-assign.c
 create mode 100644 validation/empty-initializer.c

diff --git a/validation/empty-assign.c b/validation/empty-assign.c
new file mode 100644
index 000000000000..48ac626ddaed
--- /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 000000000000..0ca763f699a0
--- /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
+ */
-- 
2.27.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux