diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-12-08 04:59:37 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-12-08 05:01:44 +0100 |
commit | 7f6e03839738cb5a57d6d9cbcd6109dd262f7977 (patch) | |
tree | c9d0eea437c3ccf9a4fe1b2c505430adca44d007 /testsuite | |
parent | 6e17825944e639625749a44088f9374652d92aad (diff) | |
download | ghdl-7f6e03839738cb5a57d6d9cbcd6109dd262f7977.tar.gz ghdl-7f6e03839738cb5a57d6d9cbcd6109dd262f7977.tar.bz2 ghdl-7f6e03839738cb5a57d6d9cbcd6109dd262f7977.zip |
issue #205: add instantiation.
Fix #205
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/gna/issue205/repro1.vhdl | 33 | ||||
-rwxr-xr-x | testsuite/gna/issue205/testsuite.sh | 3 |
2 files changed, 35 insertions, 1 deletions
diff --git a/testsuite/gna/issue205/repro1.vhdl b/testsuite/gna/issue205/repro1.vhdl new file mode 100644 index 000000000..79ccfd54f --- /dev/null +++ b/testsuite/gna/issue205/repro1.vhdl @@ -0,0 +1,33 @@ +package SortListGenericPkg is + generic ( + type ElementType; + function "<"(L : ElementType; R : ElementType) return boolean; + function "<="(L : ElementType; R : ElementType) return boolean + ); + function f (a, b : ElementType) return boolean; +end package; + +package body SortListGenericPkg is + function f (a, b : ElementType) return boolean is + begin + return a <= b; + end f; +end; + +package mysort is new work.SortListGenericPkg generic map (natural, "<", "<="); + +entity repro is +end repro; + +use work.mysort.all; +architecture behav of repro +is +begin + process + variable ok : boolean; + begin + ok := f (3, 12); + assert ok report "bad comparaison" severity failure; + wait; + end process; +end behav; diff --git a/testsuite/gna/issue205/testsuite.sh b/testsuite/gna/issue205/testsuite.sh index 7b37332aa..eefe1e0b3 100755 --- a/testsuite/gna/issue205/testsuite.sh +++ b/testsuite/gna/issue205/testsuite.sh @@ -3,7 +3,8 @@ . ../../testenv.sh export GHDL_STD_FLAGS=--std=08 -analyze repro.vhdl +analyze repro1.vhdl +elab_simulate repro clean |