From 140ec48166f9c8c478d1433507c632cea80929bc Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 18 Sep 2021 17:40:11 +0200 Subject: testsuite/gna: add a test for #543 --- testsuite/gna/issue543/ent.vhdl | 10 ++++++++++ testsuite/gna/issue543/repro1.vhdl | 14 ++++++++++++++ testsuite/gna/issue543/testsuite.sh | 14 ++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 testsuite/gna/issue543/ent.vhdl create mode 100644 testsuite/gna/issue543/repro1.vhdl create mode 100755 testsuite/gna/issue543/testsuite.sh (limited to 'testsuite/gna/issue543') diff --git a/testsuite/gna/issue543/ent.vhdl b/testsuite/gna/issue543/ent.vhdl new file mode 100644 index 000000000..9d0027fc2 --- /dev/null +++ b/testsuite/gna/issue543/ent.vhdl @@ -0,0 +1,10 @@ +entity ent is end entity; +architecture arch of ent is + attribute att :integer_vector; + constant const :integer := 1; + attribute att of const:constant is (2, 3); +begin + assert false + report "const'att(0) is " & integer'image(const'att(0)) + severity note; +end architecture; diff --git a/testsuite/gna/issue543/repro1.vhdl b/testsuite/gna/issue543/repro1.vhdl new file mode 100644 index 000000000..e18861122 --- /dev/null +++ b/testsuite/gna/issue543/repro1.vhdl @@ -0,0 +1,14 @@ +entity repro1 is +end entity; + +architecture arch of repro1 is + attribute att : integer_vector; + constant const : integer := 1; + attribute att of const: constant is (2, 3); + constant const2 : integer_vector := const'att; + constant const3 : integer_vector := const2; +begin + assert false + report "const'att(0) is " & integer'image(const3(0)) + severity note; +end architecture; diff --git a/testsuite/gna/issue543/testsuite.sh b/testsuite/gna/issue543/testsuite.sh new file mode 100755 index 000000000..9ae8123cf --- /dev/null +++ b/testsuite/gna/issue543/testsuite.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS=--std=08 +analyze ent.vhdl +elab_simulate ent + +analyze repro1.vhdl +elab_simulate repro1 + +clean + +echo "Test successful" -- cgit v1.2.3