From 7f6e03839738cb5a57d6d9cbcd6109dd262f7977 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 8 Dec 2016 04:59:37 +0100 Subject: issue #205: add instantiation. Fix #205 --- testsuite/gna/issue205/repro1.vhdl | 33 +++++++++++++++++++++++++++++++++ testsuite/gna/issue205/testsuite.sh | 3 ++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 testsuite/gna/issue205/repro1.vhdl 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 -- cgit v1.2.3