aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue705
diff options
context:
space:
mode:
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"