aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue705
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-11-26 20:22:09 +0100
committerTristan Gingold <tgingold@free.fr>2018-11-26 20:29:32 +0100
commitbd681e64540831934ebc40dc8fcdfcbb0e559c6a (patch)
tree43550f712eba8795493be3fe5b1c0736e4ffff99 /testsuite/gna/issue705
parentc5f7cf91d03a5210e6d7eacd6cbad3883db85e0d (diff)
downloadghdl-bd681e64540831934ebc40dc8fcdfcbb0e559c6a.tar.gz
ghdl-bd681e64540831934ebc40dc8fcdfcbb0e559c6a.tar.bz2
ghdl-bd681e64540831934ebc40dc8fcdfcbb0e559c6a.zip
Add reproducer for #705
Diffstat (limited to 'testsuite/gna/issue705')
-rw-r--r--testsuite/gna/issue705/bug.vhdl17
-rw-r--r--testsuite/gna/issue705/bug2.vhdl21
-rwxr-xr-xtestsuite/gna/issue705/testsuite.sh10
3 files changed, 48 insertions, 0 deletions
diff --git a/testsuite/gna/issue705/bug.vhdl b/testsuite/gna/issue705/bug.vhdl
new file mode 100644
index 000000000..7bbcbcd3e
--- /dev/null
+++ b/testsuite/gna/issue705/bug.vhdl
@@ -0,0 +1,17 @@
+package pkg is
+ constant const : character := 'a';
+end package;
+
+entity tb_ent is
+end entity;
+
+architecture a of tb_ent is
+ constant const : natural := 1;
+begin
+ main : process
+ use work.pkg.const;
+ begin
+ report integer'image(const); -- 0 in GHDL, I expect 1
+ assert const = 1; -- Fails in GHDL
+ end process;
+end architecture;
diff --git a/testsuite/gna/issue705/bug2.vhdl b/testsuite/gna/issue705/bug2.vhdl
new file mode 100644
index 000000000..2e1c3f306
--- /dev/null
+++ b/testsuite/gna/issue705/bug2.vhdl
@@ -0,0 +1,21 @@
+package pkg is
+ constant const : natural := 0;
+end package;
+
+package pkg2 is
+ constant const : natural := 2;
+end package;
+
+entity tb_ent is
+end entity;
+
+architecture a of tb_ent is
+ use work.pkg.const;
+begin
+ main : process
+ use work.pkg2.const;
+ begin
+ report integer'image(const); -- Should be an error as const is ambiguous
+ end process;
+end architecture;
+
diff --git a/testsuite/gna/issue705/testsuite.sh b/testsuite/gna/issue705/testsuite.sh
new file mode 100755
index 000000000..59d2fc3c2
--- /dev/null
+++ b/testsuite/gna/issue705/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze bug.vhdl
+analyze_failure bug2.vhdl
+
+clean
+
+echo "Test successful"