aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-05-12 08:30:21 +0200
committerTristan Gingold <tgingold@free.fr>2020-05-13 06:01:06 +0200
commit841001b3747e41ba4553d062319de867a9639a9b (patch)
tree403d25cfd5e537aace874e8cd476815d04198f77 /testsuite
parent2a6174e6847070f95a2c4737dc0b8f7069c84429 (diff)
downloadghdl-841001b3747e41ba4553d062319de867a9639a9b.tar.gz
ghdl-841001b3747e41ba4553d062319de867a9639a9b.tar.bz2
ghdl-841001b3747e41ba4553d062319de867a9639a9b.zip
testsuite/gna: add a test for #1300
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/gna/issue1300/testsuite.sh6
-rw-r--r--testsuite/gna/issue1300/wishbone_types_err2.vhdl20
2 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/gna/issue1300/testsuite.sh b/testsuite/gna/issue1300/testsuite.sh
index ec021a312..b5b72bdd9 100755
--- a/testsuite/gna/issue1300/testsuite.sh
+++ b/testsuite/gna/issue1300/testsuite.sh
@@ -3,9 +3,15 @@
. ../../testenv.sh
export GHDL_STD_FLAGS=--std=08
+
analyze wishbone_types.vhdl icache.vhdl
elab_simulate icache
clean
+analyze wishbone_types_err2.vhdl icache.vhdl
+elab_simulate icache
+
+clean
+
echo "Test successful"
diff --git a/testsuite/gna/issue1300/wishbone_types_err2.vhdl b/testsuite/gna/issue1300/wishbone_types_err2.vhdl
new file mode 100644
index 000000000..3111ab266
--- /dev/null
+++ b/testsuite/gna/issue1300/wishbone_types_err2.vhdl
@@ -0,0 +1,20 @@
+package wishbone_types is
+ type wb_slave_out_t is record
+ dat : bit_vector;
+ ack : bit;
+ stall : bit;
+ end record;
+
+ -- Common subtypes
+ constant wb_cpu_data_bits : integer := 64;
+ subtype wb_cpu_in_t is wb_slave_out_t(dat(wb_cpu_data_bits-1 downto 0));
+
+ -- GHDL: Works
+-- subtype wishbone_slave_out is wb_slave_out_t(dat(wb_cpu_data_bits-1 downto 0));
+
+ -- GHDL: Breaks
+ subtype wishbone_slave_out is wb_cpu_in_t;
+
+ type wishbone_slave_out_vector is
+ array (natural range <>) of wb_cpu_in_t;
+end package wishbone_types;