From 0557b7d15c6f44720e7122bf480e67f1e168f13f Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 15 Sep 2016 01:49:03 +0200 Subject: Add testcase for generic-mapped package --- testsuite/gna/bug057/tb.vhdl | 21 +++++++++++++++++++++ testsuite/gna/bug057/tb2.vhdl | 20 ++++++++++++++++++++ testsuite/gna/bug057/testsuite.sh | 15 +++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 testsuite/gna/bug057/tb.vhdl create mode 100644 testsuite/gna/bug057/tb2.vhdl create mode 100755 testsuite/gna/bug057/testsuite.sh diff --git a/testsuite/gna/bug057/tb.vhdl b/testsuite/gna/bug057/tb.vhdl new file mode 100644 index 000000000..cc4b8f9f3 --- /dev/null +++ b/testsuite/gna/bug057/tb.vhdl @@ -0,0 +1,21 @@ +package pkg1 is + generic (c : natural); + generic map (c => 5); + + function f return natural; +end pkg1; + +package body pkg1 is + function f return natural is + begin + return c; + end f; +end pkg1; + +entity tb is +end tb; + +architecture behav of tb is +begin + assert work.pkg1.f = 5; +end behav; diff --git a/testsuite/gna/bug057/tb2.vhdl b/testsuite/gna/bug057/tb2.vhdl new file mode 100644 index 000000000..98f7bc5c1 --- /dev/null +++ b/testsuite/gna/bug057/tb2.vhdl @@ -0,0 +1,20 @@ +entity tb2 is +end tb2; + +architecture behav of tb2 is + package pkg1 is + generic (c : natural); + generic map (c => 5); + + function f return natural; + end pkg1; + + package body pkg1 is + function f return natural is + begin + return c; + end f; + end pkg1; +begin + assert pkg1.f = 5 severity failure; +end behav; diff --git a/testsuite/gna/bug057/testsuite.sh b/testsuite/gna/bug057/testsuite.sh new file mode 100755 index 000000000..737932da6 --- /dev/null +++ b/testsuite/gna/bug057/testsuite.sh @@ -0,0 +1,15 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=--std=08 + +analyze tb.vhdl +elab_simulate tb + +analyze tb2.vhdl +elab_simulate tb2 + +clean + +echo "Test successful" -- cgit v1.2.3