aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue2071/repro2.vhdl
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/issue2071/repro2.vhdl')
-rw-r--r--testsuite/gna/issue2071/repro2.vhdl37
1 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/gna/issue2071/repro2.vhdl b/testsuite/gna/issue2071/repro2.vhdl
new file mode 100644
index 000000000..f00671310
--- /dev/null
+++ b/testsuite/gna/issue2071/repro2.vhdl
@@ -0,0 +1,37 @@
+package TST_PKG is
+ type Indices_t is array (natural range <>) of bit_vector;
+
+ type Bus_t is record
+ Indices : Indices_t;
+ end record;
+
+ function Init(
+ TST_PKG_bus : Bus_t
+ ) return Bus_t;
+
+end package;
+
+package body TST_PKG is
+ function Init(
+ TST_PKG_bus : Bus_t
+ )
+ return Bus_t is
+ variable result : Bus_t(
+ Indices(TST_PKG_bus.Indices'range)(TST_PKG_bus.Indices'element'range)
+ );
+ begin
+ result.Indices := (others => (others => '0'));
+ return result;
+ end function Init;
+end package body;
+
+use work.tst_pkg.all;
+
+entity repro2 is
+end;
+
+architecture arch of repro2 is
+ constant c1 : bus_t := (indices => (1 to 4 => "01"));
+ constant c2 : bus_t := init (c1);
+begin
+end;