diff options
-rw-r--r-- | testsuite/gna/issue440/e.vhdl | 13 | ||||
-rw-r--r-- | testsuite/gna/issue440/e2.vhdl | 16 | ||||
-rw-r--r-- | testsuite/gna/issue440/e3.vhdl | 15 | ||||
-rwxr-xr-x | testsuite/gna/issue440/testsuite.sh | 17 |
4 files changed, 61 insertions, 0 deletions
diff --git a/testsuite/gna/issue440/e.vhdl b/testsuite/gna/issue440/e.vhdl new file mode 100644 index 000000000..d09bc3954 --- /dev/null +++ b/testsuite/gna/issue440/e.vhdl @@ -0,0 +1,13 @@ +package p is + generic( + function generic_f(b:bit) return boolean + ); +end package; + +entity e is end entity; +architecture a of e is + function f(b:bit) return boolean is begin return false; end function; + package q is new work.p generic map(f); +begin + assert q.generic_f('0') report "msg1" severity note; +end architecture; diff --git a/testsuite/gna/issue440/e2.vhdl b/testsuite/gna/issue440/e2.vhdl new file mode 100644 index 000000000..d077ea742 --- /dev/null +++ b/testsuite/gna/issue440/e2.vhdl @@ -0,0 +1,16 @@ +package p2 is + generic( + -- function generic_f(b:bit) return boolean + function f(b:bit) return boolean + ); + alias generic_f is f [bit return boolean]; -- non object alias +end package; + +entity e2 is end entity; +architecture a of e2 is + function f(b:bit) return boolean is begin return false; end function; + package q is new work.p2 generic map(f); +begin + assert q.generic_f('0') report "OK" severity note; + assert q.generic_f('0') = false report "Bad value" severity failure; +end architecture; diff --git a/testsuite/gna/issue440/e3.vhdl b/testsuite/gna/issue440/e3.vhdl new file mode 100644 index 000000000..42868bac9 --- /dev/null +++ b/testsuite/gna/issue440/e3.vhdl @@ -0,0 +1,15 @@ +package p3 is + generic( + -- function generic_f(b:bit) return boolean + function f(b:bit) return boolean + ); + constant c : boolean := f('0'); +end package; + +entity e3 is end entity; +architecture a of e3 is + function f(b:bit) return boolean is begin return false; end function; + package q is new work.p3 generic map(f); +begin + assert q.c = false report "bad value" severity failure; +end architecture; diff --git a/testsuite/gna/issue440/testsuite.sh b/testsuite/gna/issue440/testsuite.sh new file mode 100755 index 000000000..3840a8714 --- /dev/null +++ b/testsuite/gna/issue440/testsuite.sh @@ -0,0 +1,17 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +analyze e3.vhdl +elab_simulate e3 + +analyze e2.vhdl +elab_simulate e2 + +# Not yet fixed +# analyze e.vhdl + +clean + +echo "Test successful" |