From 0db659f0d91d57c5b36ae40c3be0f542a4ad75d1 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 18 Aug 2022 06:16:11 +0200 Subject: testsuite/gna: add a test and close #2179 --- testsuite/gna/issue2179/e.vhdl | 35 +++++++++++++++++++++++++++++++++++ testsuite/gna/issue2179/testsuite.sh | 13 +++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 testsuite/gna/issue2179/e.vhdl create mode 100755 testsuite/gna/issue2179/testsuite.sh diff --git a/testsuite/gna/issue2179/e.vhdl b/testsuite/gna/issue2179/e.vhdl new file mode 100644 index 000000000..58886236b --- /dev/null +++ b/testsuite/gna/issue2179/e.vhdl @@ -0,0 +1,35 @@ +package pkg is + type rec is record + elem : bit_vector; + end record; +end package; + +entity i is + port ( + signal p : out work.pkg.rec + ); +end entity; + +architecture a of i is + signal s1 : work.pkg.rec(elem(3 downto 0)); + signal s2 : s1'subtype; +begin + s1.elem <= (others => '0'); + s2.elem <= (others => '0'); +-- p.elem <= (p.elem'range => '0'); + p.elem <= (others => '0'); -- reproducer.vhdl:20:19: 'others' choice not allowed for an aggregate in this context +end architecture; + +entity e is +end entity; + +architecture a of e is + signal s : work.pkg.rec( + elem(7 downto 0) + ); +begin + inst : entity work.i + port map ( + p => s + ); +end architecture; diff --git a/testsuite/gna/issue2179/testsuite.sh b/testsuite/gna/issue2179/testsuite.sh new file mode 100755 index 000000000..505de548c --- /dev/null +++ b/testsuite/gna/issue2179/testsuite.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +. ../../testenv.sh + +export GHDL_STD_FLAGS="--std=08" +analyze_failure e.vhdl + +export GHDL_STD_FLAGS="--std=08 -frelaxed" +analyze e.vhdl + +clean + +echo "Test successful" -- cgit v1.2.3