aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-10-24 06:43:26 +0200
committerTristan Gingold <tgingold@free.fr>2019-10-24 06:43:43 +0200
commit420bcb45b110172ced81830fedcb72cee46c038a (patch)
tree0b7c26f00c2de3266f04a507a2d37e995101c30a /testsuite/gna
parent0d427a74341db4b511e472222f9d4ce0f7717a3c (diff)
downloadghdl-420bcb45b110172ced81830fedcb72cee46c038a.tar.gz
ghdl-420bcb45b110172ced81830fedcb72cee46c038a.tar.bz2
ghdl-420bcb45b110172ced81830fedcb72cee46c038a.zip
Add testcase for #984
Diffstat (limited to 'testsuite/gna')
-rw-r--r--testsuite/gna/issue984/const_pkg.vhd5
-rw-r--r--testsuite/gna/issue984/generic_check.vhd19
-rw-r--r--testsuite/gna/issue984/tester.vhd9
-rw-r--r--testsuite/gna/issue984/tester_conf.vhd12
-rwxr-xr-xtestsuite/gna/issue984/testsuite.sh14
-rw-r--r--testsuite/gna/issue984/types_pkg.vhd3
6 files changed, 62 insertions, 0 deletions
diff --git a/testsuite/gna/issue984/const_pkg.vhd b/testsuite/gna/issue984/const_pkg.vhd
new file mode 100644
index 000000000..d93361ba9
--- /dev/null
+++ b/testsuite/gna/issue984/const_pkg.vhd
@@ -0,0 +1,5 @@
+use work.types_pkg.all;
+
+package const_pkg is
+ constant c : generic_type := (others => 5);
+end package;
diff --git a/testsuite/gna/issue984/generic_check.vhd b/testsuite/gna/issue984/generic_check.vhd
new file mode 100644
index 000000000..cba427e71
--- /dev/null
+++ b/testsuite/gna/issue984/generic_check.vhd
@@ -0,0 +1,19 @@
+use work.types_pkg.all;
+-- Workaround:
+--use work.const_pkg.all;
+
+entity generic_check is
+ generic (
+ i : generic_type
+ );
+end entity;
+
+architecture a of generic_check is
+begin
+ process
+ begin
+ assert i(0) = 5 report "Should be 5, is " & integer'image(i(0))
+ severity failure;
+ wait;
+ end process;
+end architecture;
diff --git a/testsuite/gna/issue984/tester.vhd b/testsuite/gna/issue984/tester.vhd
new file mode 100644
index 000000000..63ef279e2
--- /dev/null
+++ b/testsuite/gna/issue984/tester.vhd
@@ -0,0 +1,9 @@
+entity tester is
+end entity;
+
+architecture a of tester is
+ component check is
+ end component;
+begin
+ checker: check;
+end architecture;
diff --git a/testsuite/gna/issue984/tester_conf.vhd b/testsuite/gna/issue984/tester_conf.vhd
new file mode 100644
index 000000000..7644dfbb7
--- /dev/null
+++ b/testsuite/gna/issue984/tester_conf.vhd
@@ -0,0 +1,12 @@
+use work.const_pkg.all;
+
+configuration tester_conf of tester is
+ for a
+ for checker : check
+ use entity work.generic_check
+ generic map (
+ i => c
+ );
+ end for;
+ end for;
+end configuration;
diff --git a/testsuite/gna/issue984/testsuite.sh b/testsuite/gna/issue984/testsuite.sh
new file mode 100755
index 000000000..032cba8c7
--- /dev/null
+++ b/testsuite/gna/issue984/testsuite.sh
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze types_pkg.vhd
+analyze const_pkg.vhd
+analyze tester.vhd
+analyze generic_check.vhd
+analyze tester_conf.vhd
+elab_simulate tester_conf
+
+clean
+
+echo "Test successful"
diff --git a/testsuite/gna/issue984/types_pkg.vhd b/testsuite/gna/issue984/types_pkg.vhd
new file mode 100644
index 000000000..19527eb60
--- /dev/null
+++ b/testsuite/gna/issue984/types_pkg.vhd
@@ -0,0 +1,3 @@
+package types_pkg is
+ type generic_type is array(0 to 3) of integer;
+end package;