diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-05-16 10:18:10 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-05-16 10:18:10 +0200 |
commit | aa4eca399cf873d651d16b3f52514dca4a5b69d4 (patch) | |
tree | 77a89422cd4e73f163950e1b86b9ec1115ebee90 /testsuite/gna/issue1765 | |
parent | 506cd567d1794415f3d28ca6af72c91c4859b77a (diff) | |
download | ghdl-aa4eca399cf873d651d16b3f52514dca4a5b69d4.tar.gz ghdl-aa4eca399cf873d651d16b3f52514dca4a5b69d4.tar.bz2 ghdl-aa4eca399cf873d651d16b3f52514dca4a5b69d4.zip |
testsuite/gna: add a test for #1765
Diffstat (limited to 'testsuite/gna/issue1765')
-rw-r--r-- | testsuite/gna/issue1765/ent.vhdl | 28 | ||||
-rw-r--r-- | testsuite/gna/issue1765/ent93.vhdl | 28 | ||||
-rwxr-xr-x | testsuite/gna/issue1765/testsuite.sh | 14 |
3 files changed, 70 insertions, 0 deletions
diff --git a/testsuite/gna/issue1765/ent.vhdl b/testsuite/gna/issue1765/ent.vhdl new file mode 100644 index 000000000..c2f21f62e --- /dev/null +++ b/testsuite/gna/issue1765/ent.vhdl @@ -0,0 +1,28 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +--use work.TestPkg.all ; + +entity test is + port( + input : in unsigned ; + output : out unsigned + ); +end entity; + +architecture rtl of test is +alias A is Output ; -- does not work +-- alias A : unsigned(output'range) is Output ; -- Works +-- alias A : output'subtype is Output ; -- Works + +begin + A <= (output'range => '0') ; + + process + begin + wait on input ; -- Suppress first run + report "input = " & to_hstring(input) ; + end process ; + +end architecture ; diff --git a/testsuite/gna/issue1765/ent93.vhdl b/testsuite/gna/issue1765/ent93.vhdl new file mode 100644 index 000000000..3ac359299 --- /dev/null +++ b/testsuite/gna/issue1765/ent93.vhdl @@ -0,0 +1,28 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +--use work.TestPkg.all ; + +entity test is + port( + input : in unsigned ; + output : out unsigned + ); +end entity; + +architecture rtl of test is +alias A is Output ; -- does not work +-- alias A : unsigned(output'range) is Output ; -- Works +-- alias A : output'subtype is Output ; -- Works + +begin + A <= (output'range => '0') ; + + process + begin + wait on input ; -- Suppress first run +-- report "input = " & to_hstring(input) ; + end process ; + +end architecture ; diff --git a/testsuite/gna/issue1765/testsuite.sh b/testsuite/gna/issue1765/testsuite.sh new file mode 100755 index 000000000..644614735 --- /dev/null +++ b/testsuite/gna/issue1765/testsuite.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze ent93.vhdl + +clean + +export GHDL_STD_FLAGS=--std=08 +analyze ent.vhdl + +clean + +echo "Test successful" |