[PATCH 1/3] add tescase for unreachable label in switch

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

 



or more exactly, an unreachable switch statement but containing a
reachable label. This is valid code but is curently wrongly linearized.

So, add a testcase for it.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 validation/linear/unreachable-label0.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 validation/linear/unreachable-label0.c

diff --git a/validation/linear/unreachable-label0.c b/validation/linear/unreachable-label0.c
new file mode 100644
index 000000000..568ae588a
--- /dev/null
+++ b/validation/linear/unreachable-label0.c
@@ -0,0 +1,20 @@
+static int foo(int a)
+{
+	goto label;
+	switch(a) {
+	default:
+label:
+		break;
+	}
+	return 0;
+}
+
+/*
+ * check-name: unreachable-label0
+ * check-command: test-linearize $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-contains: ret\\.
+ * check-output-excludes: END
+ */
-- 
2.18.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