aboutsummaryrefslogtreecommitdiffstats
path: root/src/ortho/oread/tests/const5.on
diff options
context:
space:
mode:
Diffstat (limited to 'src/ortho/oread/tests/const5.on')
-rw-r--r--src/ortho/oread/tests/const5.on17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ortho/oread/tests/const5.on b/src/ortho/oread/tests/const5.on
new file mode 100644
index 000000000..0d98781f2
--- /dev/null
+++ b/src/ortho/oread/tests/const5.on
@@ -0,0 +1,17 @@
+TYPE __ghdl_index_type IS UNSIGNED (32);
+
+TYPE index_array_type IS ARRAY[__ghdl_index_type] OF __ghdl_index_type;
+
+PUBLIC FUNCTION main (a : __ghdl_index_type) RETURN __ghdl_index_type
+DECLARE
+BEGIN
+ DECLARE
+ TYPE my_array IS SUBARRAY index_array_type[2];
+ PRIVATE CONSTANT cst : my_array;
+ CONSTANT cst := [2]{__ghdl_index_type'[1], __ghdl_index_type'[2]};
+ LOCAL VAR v : __ghdl_index_type;
+ BEGIN
+ v := a;
+ RETURN a +# cst[0];
+ END;
+END;