From bd681e64540831934ebc40dc8fcdfcbb0e559c6a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 26 Nov 2018 20:22:09 +0100 Subject: Add reproducer for #705 --- testsuite/gna/issue705/bug.vhdl | 17 +++++++++++++++++ testsuite/gna/issue705/bug2.vhdl | 21 +++++++++++++++++++++ testsuite/gna/issue705/testsuite.sh | 10 ++++++++++ 3 files changed, 48 insertions(+) create mode 100644 testsuite/gna/issue705/bug.vhdl create mode 100644 testsuite/gna/issue705/bug2.vhdl create mode 100755 testsuite/gna/issue705/testsuite.sh (limited to 'testsuite/gna') 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" -- cgit v1.2.3