diff mbox series

[SPARSE,1/5] add testcase for 'jump inside discarded expression statement'

Message ID 20200410184918.64692-2-luc.vanoostenryck@gmail.com (mailing list archive)
State Rejected, archived
Headers show
Series detect invalid branches in the IR | expand

Commit Message

Luc Van Oostenryck April 10, 2020, 6:49 p.m. UTC
A goto done into an piece of code discarded at expand or
linearize time will produce an invalid IR.

Add a testcase for it.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 validation/linear/goto-and-expr-stmt0.c | 28 +++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 validation/linear/goto-and-expr-stmt0.c
diff mbox series

Patch

diff --git a/validation/linear/goto-and-expr-stmt0.c b/validation/linear/goto-and-expr-stmt0.c
new file mode 100644
index 000000000000..548813531779
--- /dev/null
+++ b/validation/linear/goto-and-expr-stmt0.c
@@ -0,0 +1,28 @@ 
+int t(void)
+{
+	goto inside;
+	return 1 ? 2 : ({
+inside:
+			return 3;
+			4;
+		    });
+}
+
+void f(int x, int y)
+{
+	1 ? x : ({
+a:
+		 y;
+	});
+	goto a;
+}
+
+/*
+ * check-name: goto-and-expr-stmt0
+ * check-command: test-linearize -Wno-decl $file
+ * check-known-to-fail
+ *
+ * check-output-ignore
+ * check-output-excludes: END
+ * check-error-ignore
+ */