diff options
author | Tristan Gingold <tgingold@free.fr> | 2018-01-30 18:13:03 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2018-01-30 18:13:03 +0100 |
commit | fe8a650f08a4e091a04f063bc1a4f18928a35c9d (patch) | |
tree | d3bae81bdc4a7d1028d4bd737049a1f664bcd91e /testsuite | |
parent | bcc56418d72fb8c96109ce9379e5aa5ce54cad98 (diff) | |
download | ghdl-fe8a650f08a4e091a04f063bc1a4f18928a35c9d.tar.gz ghdl-fe8a650f08a4e091a04f063bc1a4f18928a35c9d.tar.bz2 ghdl-fe8a650f08a4e091a04f063bc1a4f18928a35c9d.zip |
Add testcase for #459
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gna/issue459/e.vhdl | 16 | ||||
-rw-r--r-- | testsuite/gna/issue459/e1.vhdl | 9 | ||||
-rw-r--r-- | testsuite/gna/issue459/e2.vhdl | 10 | ||||
-rw-r--r-- | testsuite/gna/issue459/e3.vhdl | 13 | ||||
-rw-r--r-- | testsuite/gna/issue459/e4.vhdl | 13 | ||||
-rw-r--r-- | testsuite/gna/issue459/repro1.vhdl | 13 | ||||
-rwxr-xr-x | testsuite/gna/issue459/testsuite.sh | 27 |
7 files changed, 101 insertions, 0 deletions
diff --git a/testsuite/gna/issue459/e.vhdl b/testsuite/gna/issue459/e.vhdl new file mode 100644 index 000000000..04cd76df0 --- /dev/null +++ b/testsuite/gna/issue459/e.vhdl @@ -0,0 +1,16 @@ +entity E is +end entity; + +architecture A of E is + -- array with unconstrained array element type + type A is array(natural range <>) of bit_vector; + + -- partially constrained array -> constrained inner array (element) + subtype P1 is A(open)(7 downto 0); + -- partially constrained array -> constrained outer array (vector) + subtype P2 is A(15 downto 0)(open); + + signal S1 : P1(15 downto 0); -- finally constraining the vector size + signal S2 : P2(open)(7 downto 0); -- finally constraining the element size line 14 +begin +end architecture; diff --git a/testsuite/gna/issue459/e1.vhdl b/testsuite/gna/issue459/e1.vhdl new file mode 100644 index 000000000..357904020 --- /dev/null +++ b/testsuite/gna/issue459/e1.vhdl @@ -0,0 +1,9 @@ +entity E1 is +end entity; + +architecture behav of E1 is + -- array with unconstrained array element type + type A is array(natural range <>) of bit_vector; + +begin +end architecture; diff --git a/testsuite/gna/issue459/e2.vhdl b/testsuite/gna/issue459/e2.vhdl new file mode 100644 index 000000000..98cc0c0c9 --- /dev/null +++ b/testsuite/gna/issue459/e2.vhdl @@ -0,0 +1,10 @@ +entity E2 is +end entity; + +architecture behav of E2 is + -- array with unconstrained array element type + type A is array(natural range <>) of bit_vector; + + signal s : a (7 downto 0)(3 downto 0); +begin +end architecture; diff --git a/testsuite/gna/issue459/e3.vhdl b/testsuite/gna/issue459/e3.vhdl new file mode 100644 index 000000000..3ae23fe54 --- /dev/null +++ b/testsuite/gna/issue459/e3.vhdl @@ -0,0 +1,13 @@ +entity E3 is +end entity; + +architecture A of E3 is + -- array with unconstrained array element type + type A is array(natural range <>) of bit_vector; + + -- partially constrained array -> constrained outer array (vector) + subtype P2 is A(15 downto 0)(open); + + signal S2 : P2(open)(7 downto 0); -- finally constraining the element size line 14 +begin +end architecture; diff --git a/testsuite/gna/issue459/e4.vhdl b/testsuite/gna/issue459/e4.vhdl new file mode 100644 index 000000000..cc636928f --- /dev/null +++ b/testsuite/gna/issue459/e4.vhdl @@ -0,0 +1,13 @@ +entity E4 is +end entity; + +architecture A of E4 is + -- array with unconstrained array element type + type A is array(natural range <>) of bit_vector; + + -- partially constrained array -> constrained inner array (element) + subtype P1 is A(open)(7 downto 0); + + signal S1 : P1(15 downto 0); -- finally constraining the vector size +begin +end architecture; diff --git a/testsuite/gna/issue459/repro1.vhdl b/testsuite/gna/issue459/repro1.vhdl new file mode 100644 index 000000000..1d0fbe954 --- /dev/null +++ b/testsuite/gna/issue459/repro1.vhdl @@ -0,0 +1,13 @@ +entity repro1 is +end entity; + +architecture A of repro1 is + -- array with unconstrained array element type + type A is array(natural range <>) of bit_vector; + + -- partially constrained array -> constrained outer array (vector) + subtype P2 is A(15 downto 0)(open); + + signal S2 : P2(open)(7 downto 0); -- fully constrained. +begin +end architecture; diff --git a/testsuite/gna/issue459/testsuite.sh b/testsuite/gna/issue459/testsuite.sh new file mode 100755 index 000000000..7c2dcc280 --- /dev/null +++ b/testsuite/gna/issue459/testsuite.sh @@ -0,0 +1,27 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 + +analyze e4.vhdl +elab_simulate e4 + +analyze e3.vhdl +elab_simulate e3 + +analyze e2.vhdl +elab_simulate e2 + +analyze e1.vhdl +elab_simulate e1 + +analyze e.vhdl +elab_simulate e + +analyze repro1.vhdl +elab_simulate repro1 + +clean + +echo "Test successful" |