From a12106286ce1e81e0fa2f035a92a6c588a0d93e2 Mon Sep 17 00:00:00 2001
From: Andre Maroneze <andre.maroneze@cea.fr>
Date: Fri, 9 Oct 2020 17:54:01 +0200
Subject: [PATCH] [kernel] add non-regression test for const local inits

---
 tests/syntax/local-init-const.i                 | 9 +++++++++
 tests/syntax/oracle/local-init-const.res.oracle | 1 +
 2 files changed, 10 insertions(+)
 create mode 100644 tests/syntax/local-init-const.i
 create mode 100644 tests/syntax/oracle/local-init-const.res.oracle

diff --git a/tests/syntax/local-init-const.i b/tests/syntax/local-init-const.i
new file mode 100644
index 00000000000..1d79724df76
--- /dev/null
+++ b/tests/syntax/local-init-const.i
@@ -0,0 +1,9 @@
+/*run.config
+  OPT: -no-autoload-plugins -load-module eva,scope -eva -eva-verbose 0
+ */
+unsigned id(unsigned x) { return x; }
+
+void main() {
+  unsigned const r = id(1 > 2 ? 1 : 2);
+  //@ assert written_r: r == 2;
+}
diff --git a/tests/syntax/oracle/local-init-const.res.oracle b/tests/syntax/oracle/local-init-const.res.oracle
new file mode 100644
index 00000000000..98bd497cc4f
--- /dev/null
+++ b/tests/syntax/oracle/local-init-const.res.oracle
@@ -0,0 +1 @@
+[kernel] Parsing tests/syntax/local-init-const.i (no preprocessing)
-- 
GitLab