aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-02-11 07:43:06 +0100
committerTristan Gingold <tgingold@free.fr>2021-02-11 18:55:29 +0100
commit6090543d0315b2e04374d3ad19b393ea22016974 (patch)
treef010b7cb059b1a8416fb0add291bc456249fb53f /testsuite/gna
parent8e832e1b538f60f4bec8d67e59699a8a9c439b04 (diff)
downloadghdl-6090543d0315b2e04374d3ad19b393ea22016974.tar.gz
ghdl-6090543d0315b2e04374d3ad19b393ea22016974.tar.bz2
ghdl-6090543d0315b2e04374d3ad19b393ea22016974.zip
testsuite/gna: add a test for #1640
Diffstat (limited to 'testsuite/gna')
-rw-r--r--testsuite/gna/issue1640/test.vhdl30
-rwxr-xr-xtestsuite/gna/issue1640/testsuite.sh9
2 files changed, 39 insertions, 0 deletions
diff --git a/testsuite/gna/issue1640/test.vhdl b/testsuite/gna/issue1640/test.vhdl
new file mode 100644
index 000000000..d0db05141
--- /dev/null
+++ b/testsuite/gna/issue1640/test.vhdl
@@ -0,0 +1,30 @@
+package cpu_types is
+
+ constant word_size : positive := 2147483649;
+ constant address_size : positive := 24;
+
+ subtype word is bit_vector(word_size - 1 downto 0);
+ subtype address is bit_vector(address_size - 1 downto 0);
+
+ type status_value is ( halted, idle, fetch, mem_read, mem_write,
+ io_read, io_write, int_ack );
+
+end package cpu_types;
+
+-- end code from book
+
+
+
+package fg_08_01 is
+
+ constant status :
+ -- code from book
+ work.cpu_types.status_value
+ -- end code from book
+ :=
+ -- code from book
+ work.cpu_types.status_value'(work.cpu_types.fetch)
+ -- end code from book
+ ;
+
+end package fg_08_01;
diff --git a/testsuite/gna/issue1640/testsuite.sh b/testsuite/gna/issue1640/testsuite.sh
new file mode 100755
index 000000000..f8534f54e
--- /dev/null
+++ b/testsuite/gna/issue1640/testsuite.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze test.vhdl
+
+clean
+
+echo "Test successful"