aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-01-01 23:11:27 +0100
committerTristan Gingold <tgingold@free.fr>2014-01-01 23:11:27 +0100
commit535bbc11e9a6532b1a6e1197169e79203f191ef1 (patch)
tree62f5fafee07b1f87024b66a41ee28a8c12d5833a /testsuite/gna
parentc8150ec75d67a046e9e78b61ba26ad5be5fbe187 (diff)
downloadghdl-535bbc11e9a6532b1a6e1197169e79203f191ef1.tar.gz
ghdl-535bbc11e9a6532b1a6e1197169e79203f191ef1.tar.bz2
ghdl-535bbc11e9a6532b1a6e1197169e79203f191ef1.zip
Rework registration of RTIs for packages, to fix bug 21052.
Diffstat (limited to 'testsuite/gna')
-rw-r--r--testsuite/gna/bug21052/test.ghwbin0 -> 246 bytes
-rw-r--r--testsuite/gna/bug21052/test.vhd81
-rw-r--r--testsuite/gna/bug21052/test3.vhd27
-rwxr-xr-xtestsuite/gna/bug21052/testsuite.sh10
4 files changed, 118 insertions, 0 deletions
diff --git a/testsuite/gna/bug21052/test.ghw b/testsuite/gna/bug21052/test.ghw
new file mode 100644
index 000000000..165a53c5a
--- /dev/null
+++ b/testsuite/gna/bug21052/test.ghw
Binary files differ
diff --git a/testsuite/gna/bug21052/test.vhd b/testsuite/gna/bug21052/test.vhd
new file mode 100644
index 000000000..329bd750d
--- /dev/null
+++ b/testsuite/gna/bug21052/test.vhd
@@ -0,0 +1,81 @@
+library std;
+use std.textio.all;
+entity test is end entity;
+architecture a of test is
+ component wrapper is end component;
+begin
+ inst :if false generate inst :wrapper; end generate;
+ process
+ variable l :line;
+ begin
+ write(l, string'("OK")); writeline(output, l); wait;
+ end process;
+end architecture;
+
+package some_package is
+ -- this signal seems to be problematic
+ signal some_signal :bit;
+ component some_component end component;
+end package;
+
+entity wrapper is end entity;
+
+architecture a of wrapper is begin
+ inst :work.some_package.some_component;
+end architecture;
+
+
+
+-- ################################################################################
+-- $ ghdl -c test.vhd -e test
+-- test.vhd:17:8:warning: component instance "inst" is not bound
+-- test.vhd:16:14:warning: (in default configuration of wrapper(a))
+-- $ ./test
+-- OK
+-- $ ./test --wave=test.ghw
+-- Aborted (core dumped)
+-- $ ghdl --version
+-- GHDL 0.29 (20100109) [Sokcho edition]
+-- Compiled with GNAT Version: 4.7.2
+-- GCC back-end code generator
+-- Written by Tristan Gingold.
+--
+-- Copyright (C) 2003 - 2010 Tristan Gingold.
+-- GHDL is free software, covered by the GNU General Public License. There is NO
+-- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+-- ################################################################################
+-- $ ghdl -c test.vhd -e test
+-- test.vhd:19:8:warning: component instance "inst" is not bound
+-- test.vhd:18:14:warning: (in default configuration of wrapper(a))
+-- $ ./test
+-- OK
+-- $ ./test --wave=test.ghw
+-- ^C
+-- $ ghdl --version
+-- GHDL 0.29 (20100109) [Sokcho edition]
+-- Compiled with GNAT Version: 4.4.2 20091222 (Red Hat 4.4.2-20
+-- GCC back-end code generator
+-- Written by Tristan Gingold.
+--
+-- Copyright (C) 2003 - 2010 Tristan Gingold.
+-- GHDL is free software, covered by the GNU General Public License. There is NO
+-- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+-- ################################################################################
+-- $ ghdl -c test.vhd -e test
+-- test.vhd:19:8:warning: component instance "inst" is not bound
+-- test.vhd:18:14:warning: (in default configuration of wrapper(a))
+-- $ ./test
+-- OK
+-- $ ./test --wave=test.ghw
+--
+-- raised CONSTRAINT_ERROR : grt-waves.adb:824 access check failed
+-- $ ghdl --version
+-- GHDL 0.30dev (20100112) [Sokcho edition]
+-- Compiled with GNAT Version: 4.8.0 20130412 (Red Hat 4.8.0-2)
+-- GCC back-end code generator
+-- Written by Tristan Gingold.
+--
+-- Copyright (C) 2003 - 2010 Tristan Gingold.
+-- GHDL is free software, covered by the GNU General Public License. There is NO
+-- warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+-- ################################################################################
diff --git a/testsuite/gna/bug21052/test3.vhd b/testsuite/gna/bug21052/test3.vhd
new file mode 100644
index 000000000..9eb42ce91
--- /dev/null
+++ b/testsuite/gna/bug21052/test3.vhd
@@ -0,0 +1,27 @@
+package some_package is
+ -- this signal seems to be problematic
+ -- uncomment to reproduce the bug
+ signal some_signal :bit;
+ component some_component end component;
+end package;
+
+entity some_component is end entity;
+architecture a of some_component is begin end architecture;
+
+entity wrapper is end entity;
+architecture a of wrapper is begin
+ inst :work.some_package.some_component;
+end architecture;
+
+entity test is end entity;
+architecture a of test is
+ component wrapper is end component;
+ signal dummy :bit;
+begin
+ inst :if false generate inst :wrapper; end generate;
+ process begin
+ wait for 1 ns; dummy <= '1';
+ wait for 1 ns; dummy <= '0';
+ wait;
+ end process;
+end architecture;
diff --git a/testsuite/gna/bug21052/testsuite.sh b/testsuite/gna/bug21052/testsuite.sh
new file mode 100755
index 000000000..542440374
--- /dev/null
+++ b/testsuite/gna/bug21052/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze test.vhd
+elab_simulate test --wave=test.ghw
+
+clean
+
+echo "Test successful"