aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-11-29 06:19:06 +0100
committerTristan Gingold <tgingold@free.fr>2017-11-29 06:19:06 +0100
commitcdec4a400cd14775cc06acf43787cb95c792f258 (patch)
tree69db15904ae6a45f43dd5e49690f50a6e15f1da7 /testsuite
parentad23318cf197c329f80926018ce693aeeef13467 (diff)
downloadghdl-cdec4a400cd14775cc06acf43787cb95c792f258.tar.gz
ghdl-cdec4a400cd14775cc06acf43787cb95c792f258.tar.bz2
ghdl-cdec4a400cd14775cc06acf43787cb95c792f258.zip
Add testcase for previous patch.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/bug081/dummy.vhdl28
-rwxr-xr-xtestsuite/gna/bug081/testsuite.sh10
2 files changed, 38 insertions, 0 deletions
diff --git a/testsuite/gna/bug081/dummy.vhdl b/testsuite/gna/bug081/dummy.vhdl
new file mode 100644
index 000000000..bdaf37058
--- /dev/null
+++ b/testsuite/gna/bug081/dummy.vhdl
@@ -0,0 +1,28 @@
+package DummyPackage is
+ constant FISH: integer := 4;
+ function STICKS return natural;
+ constant IM_TOTALLY_NOT_NEGATIVE: natural := FISH - STICKS;
+end package;
+
+package body DummyPackage is
+ function STICKS return natural is
+ begin
+ return 5;
+ end function;
+end package body;
+
+library ieee;
+use ieee.std_logic_1164.all;
+use work.DummyPackage.all;
+
+entity DummyEntity is
+port (
+ signal i_data: in std_logic_vector(IM_TOTALLY_NOT_NEGATIVE-1 downto 0);
+ signal o_data: out std_logic_vector(IM_TOTALLY_NOT_NEGATIVE-1 downto 0)
+);
+end entity;
+
+architecture arch of DummyEntity is
+begin
+ o_data <= i_data;
+end architecture;
diff --git a/testsuite/gna/bug081/testsuite.sh b/testsuite/gna/bug081/testsuite.sh
new file mode 100755
index 000000000..7101b5636
--- /dev/null
+++ b/testsuite/gna/bug081/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze dummy.vhdl
+elab_simulate_failure dummyentity
+
+clean
+
+echo "Test successful"