aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-02-12 18:36:45 +0100
committerTristan Gingold <tgingold@free.fr>2023-02-13 07:58:50 +0100
commitf041824100c87e65ae8aaa92dff01988b6fbc94f (patch)
treed6f9e0d69f0bc37daca1409eb0cf53979c5e01e6 /testsuite
parent20e5bd83379ab7a20002dc200f62da64dcd56df9 (diff)
downloadghdl-f041824100c87e65ae8aaa92dff01988b6fbc94f.tar.gz
ghdl-f041824100c87e65ae8aaa92dff01988b6fbc94f.tar.bz2
ghdl-f041824100c87e65ae8aaa92dff01988b6fbc94f.zip
testsuite/gna: add tests for #2350
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/issue2350/test.vhdl26
-rw-r--r--testsuite/gna/issue2350/test2.vhdl20
-rw-r--r--testsuite/gna/issue2350/test3.vhdl20
-rw-r--r--testsuite/gna/issue2350/test4.vhdl12
-rw-r--r--testsuite/gna/issue2350/test5.vhdl21
-rw-r--r--testsuite/gna/issue2350/test6.vhdl16
-rw-r--r--testsuite/gna/issue2350/test7.vhdl15
-rwxr-xr-xtestsuite/gna/issue2350/testsuite.sh26
8 files changed, 156 insertions, 0 deletions
diff --git a/testsuite/gna/issue2350/test.vhdl b/testsuite/gna/issue2350/test.vhdl
new file mode 100644
index 000000000..65df6b825
--- /dev/null
+++ b/testsuite/gna/issue2350/test.vhdl
@@ -0,0 +1,26 @@
+library ieee ;
+ use ieee.std_logic_1164.all ;
+ use ieee.numeric_std.all ;
+
+entity test is
+end entity ;
+
+architecture arch of test is
+
+ type cx_t is record
+ re : signed ;
+ im : signed ;
+ end record ;
+
+ subtype c16_t is cx_t( re(15 downto 0), im(15 downto 0) ) ;
+
+ constant x : c16_t := ( re => to_signed(0, 16), im => to_signed(0, 17) ) ;
+
+begin
+
+ tb : process
+ begin
+ std.env.stop ;
+ end process ;
+
+end architecture ;
diff --git a/testsuite/gna/issue2350/test2.vhdl b/testsuite/gna/issue2350/test2.vhdl
new file mode 100644
index 000000000..b66cf429e
--- /dev/null
+++ b/testsuite/gna/issue2350/test2.vhdl
@@ -0,0 +1,20 @@
+library ieee ;
+ use ieee.std_logic_1164.all ;
+ use ieee.numeric_std.all ;
+
+entity test2 is
+end entity ;
+
+architecture arch of test2 is
+
+ type cx_t is record
+ re : signed (15 downto 0);
+ im : signed (15 downto 0);
+ end record ;
+
+-- subtype c16_t is cx_t( re(15 downto 0), im(15 downto 0) ) ;
+
+ constant x : cx_t := ( re => to_signed(0, 16), im => to_signed(0, 17) ) ;
+
+begin
+end architecture ;
diff --git a/testsuite/gna/issue2350/test3.vhdl b/testsuite/gna/issue2350/test3.vhdl
new file mode 100644
index 000000000..117024484
--- /dev/null
+++ b/testsuite/gna/issue2350/test3.vhdl
@@ -0,0 +1,20 @@
+library ieee ;
+ use ieee.std_logic_1164.all ;
+ use ieee.numeric_std.all ;
+
+entity test3 is
+end entity ;
+
+architecture arch of test3 is
+
+ type cx_t is record
+ re : signed (15 downto 0);
+ im : signed (15 downto 0);
+ end record ;
+
+-- subtype c16_t is cx_t( re(15 downto 0), im(15 downto 0) ) ;
+
+ constant x : cx_t := ( re => to_signed(0, 16), im => "00000001000000010" ) ;
+
+begin
+end architecture ;
diff --git a/testsuite/gna/issue2350/test4.vhdl b/testsuite/gna/issue2350/test4.vhdl
new file mode 100644
index 000000000..6fd3de42a
--- /dev/null
+++ b/testsuite/gna/issue2350/test4.vhdl
@@ -0,0 +1,12 @@
+library ieee ;
+ use ieee.std_logic_1164.all ;
+ use ieee.numeric_std.all ;
+
+entity test4 is
+end entity ;
+
+architecture arch of test4 is
+
+ constant x : signed(15 downto 0) := to_signed(0, 17);
+begin
+end architecture ;
diff --git a/testsuite/gna/issue2350/test5.vhdl b/testsuite/gna/issue2350/test5.vhdl
new file mode 100644
index 000000000..52896eea2
--- /dev/null
+++ b/testsuite/gna/issue2350/test5.vhdl
@@ -0,0 +1,21 @@
+library ieee ;
+ use ieee.std_logic_1164.all ;
+ use ieee.numeric_std.all ;
+
+entity test5 is
+end entity ;
+
+architecture arch of test5 is
+
+ type cx_t is record
+ re : signed (15 downto 0);
+ im : signed (15 downto 0);
+ end record ;
+
+-- subtype c16_t is cx_t( re(15 downto 0), im(15 downto 0) ) ;
+
+ constant a : signed(16 downto 0) := "00000001000000010"; --(others => '0');
+ constant x : cx_t := ( re => to_signed(0, 16), im => a);
+
+begin
+end architecture ;
diff --git a/testsuite/gna/issue2350/test6.vhdl b/testsuite/gna/issue2350/test6.vhdl
new file mode 100644
index 000000000..e3c991ea5
--- /dev/null
+++ b/testsuite/gna/issue2350/test6.vhdl
@@ -0,0 +1,16 @@
+library ieee ;
+ use ieee.std_logic_1164.all ;
+ use ieee.numeric_std.all ;
+
+entity test6 is
+end entity ;
+
+architecture arch of test6 is
+
+ type cx_t is array (1 to 2) of signed (15 downto 0);
+
+ constant a : signed(16 downto 0) := "00000001000000010"; --(others => '0');
+ constant x : cx_t := ( 1 => to_signed(0, 16), 2 => a);
+
+begin
+end architecture ;
diff --git a/testsuite/gna/issue2350/test7.vhdl b/testsuite/gna/issue2350/test7.vhdl
new file mode 100644
index 000000000..e11354f2c
--- /dev/null
+++ b/testsuite/gna/issue2350/test7.vhdl
@@ -0,0 +1,15 @@
+library ieee ;
+ use ieee.std_logic_1164.all ;
+ use ieee.numeric_std.all ;
+
+entity test7 is
+end entity ;
+
+architecture arch of test7 is
+
+ type cx_t is array (1 to 2) of signed (15 downto 0);
+
+ constant x : cx_t := ( 1 => to_signed(0, 16), 2 => to_signed(0, 17));
+
+begin
+end architecture ;
diff --git a/testsuite/gna/issue2350/testsuite.sh b/testsuite/gna/issue2350/testsuite.sh
new file mode 100755
index 000000000..9ced4d5ef
--- /dev/null
+++ b/testsuite/gna/issue2350/testsuite.sh
@@ -0,0 +1,26 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze test.vhdl
+elab_simulate_failure test
+
+analyze_failure -Werror=runtime-error test.vhdl
+analyze_failure -Werror=runtime-error test2.vhdl
+
+# Humm duplicate error
+analyze_failure -Werror=runtime-error test3.vhdl
+#analyze test3.vhdl
+
+analyze_failure -Werror=runtime-error test4.vhdl
+
+analyze_failure -Werror=runtime-error test5.vhdl
+
+analyze_failure -Werror=runtime-error test6.vhdl
+
+analyze_failure -Werror=runtime-error test7.vhdl
+
+clean
+
+echo "Test successful"