diff options
-rw-r--r-- | testsuite/gna/bug056/tb2.vhdl | 23 | ||||
-rw-r--r-- | testsuite/gna/bug056/tb3.vhdl | 14 | ||||
-rw-r--r-- | testsuite/gna/bug056/tb3_err.vhdl | 14 | ||||
-rwxr-xr-x | testsuite/gna/bug056/testsuite.sh | 8 |
4 files changed, 59 insertions, 0 deletions
diff --git a/testsuite/gna/bug056/tb2.vhdl b/testsuite/gna/bug056/tb2.vhdl new file mode 100644 index 000000000..c6c7b2d02 --- /dev/null +++ b/testsuite/gna/bug056/tb2.vhdl @@ -0,0 +1,23 @@ +package pkg2 is + generic (c : natural); + + function f return natural; +end pkg2; + +package body pkg2 is + constant d : natural := c; + + function f return natural is + begin + return d; + end f; +end pkg2; + +entity tb2 is +end; + +architecture behav of tb2 is + package p is new work.pkg2 generic map (c => 3); +begin + assert p.f = 3; +end behav; diff --git a/testsuite/gna/bug056/tb3.vhdl b/testsuite/gna/bug056/tb3.vhdl new file mode 100644 index 000000000..34b758aa2 --- /dev/null +++ b/testsuite/gna/bug056/tb3.vhdl @@ -0,0 +1,14 @@ +package pkg3 is + generic (c : natural); + + constant d : natural := c; +end; + +entity tb3 is +end tb3; + +architecture behav of tb3 is + package p is new work.pkg3 generic map (c => 3); +begin + assert p.d = 3; +end behav; diff --git a/testsuite/gna/bug056/tb3_err.vhdl b/testsuite/gna/bug056/tb3_err.vhdl new file mode 100644 index 000000000..693e77d6c --- /dev/null +++ b/testsuite/gna/bug056/tb3_err.vhdl @@ -0,0 +1,14 @@ +package pkg3 is + generic (c : natural); + + constant d : natural := c; +end; + +entity tb3 is +end tb3; + +architecture behav of tb3 is + package p is new work.pkg generic map (c => 3); +begin + assert p.d = 3; +end behav; diff --git a/testsuite/gna/bug056/testsuite.sh b/testsuite/gna/bug056/testsuite.sh index 8f65b4375..c66636b9d 100755 --- a/testsuite/gna/bug056/testsuite.sh +++ b/testsuite/gna/bug056/testsuite.sh @@ -7,6 +7,14 @@ GHDL_STD_FLAGS=--std=08 analyze tb.vhdl elab_simulate tb +analyze tb2.vhdl +elab_simulate tb2 + +analyze_failure tb3_err.vhdl + +analyze tb3.vhdl +elab_simulate tb3 + clean echo "Test successful" |