diff options
author | Tristan Gingold <tgingold@free.fr> | 2017-10-24 06:21:18 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2017-10-24 06:21:18 +0200 |
commit | 7e5107e960144176a27ca370564e1d2f0ba23c5f (patch) | |
tree | 8e7e19618313b52679182f986924d977963b31a1 | |
parent | ff13d4486589935979bd3b1799e1b226e6a149a4 (diff) | |
download | ghdl-7e5107e960144176a27ca370564e1d2f0ba23c5f.tar.gz ghdl-7e5107e960144176a27ca370564e1d2f0ba23c5f.tar.bz2 ghdl-7e5107e960144176a27ca370564e1d2f0ba23c5f.zip |
Add testcase for previous commit. (Related to #440).
-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" |