diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-02-01 21:14:59 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-02-02 07:38:17 +0100 |
commit | 4a2e4c835179d51d61afef2d58ddc75696eda165 (patch) | |
tree | 5f63b73089995c5656bcaf0d217db5f0e533f77a | |
parent | 983e68ed194f034696a02cea34f55a93ec543018 (diff) | |
download | ghdl-4a2e4c835179d51d61afef2d58ddc75696eda165.tar.gz ghdl-4a2e4c835179d51d61afef2d58ddc75696eda165.tar.bz2 ghdl-4a2e4c835179d51d61afef2d58ddc75696eda165.zip |
testsuite/gna: add tests in bug056
-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" |