aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--testsuite/gna/issue2179/e.vhdl35
-rwxr-xr-xtestsuite/gna/issue2179/testsuite.sh13
2 files changed, 48 insertions, 0 deletions
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"