From 9f99eee0818eafb3c544181c4ad2eda00d59e5ce Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 13 Jun 2020 18:58:08 +0200 Subject: testsuite/gna: add a test for #1361 --- testsuite/gna/issue1361/repro.vhdl | 19 +++++++++++++++++++ testsuite/gna/issue1361/repro2.vhdl | 15 +++++++++++++++ testsuite/gna/issue1361/repro3.vhdl | 15 +++++++++++++++ testsuite/gna/issue1361/repro3err.vhdl | 15 +++++++++++++++ testsuite/gna/issue1361/testsuite.sh | 19 +++++++++++++++++++ 5 files changed, 83 insertions(+) create mode 100644 testsuite/gna/issue1361/repro.vhdl create mode 100644 testsuite/gna/issue1361/repro2.vhdl create mode 100644 testsuite/gna/issue1361/repro3.vhdl create mode 100644 testsuite/gna/issue1361/repro3err.vhdl create mode 100755 testsuite/gna/issue1361/testsuite.sh (limited to 'testsuite') diff --git a/testsuite/gna/issue1361/repro.vhdl b/testsuite/gna/issue1361/repro.vhdl new file mode 100644 index 000000000..54447849d --- /dev/null +++ b/testsuite/gna/issue1361/repro.vhdl @@ -0,0 +1,19 @@ +ENTITY repro IS +END repro; + +ARCHITECTURE vhdl_behavioral of repro IS + constant userpreload : boolean := true; + CONSTANT MaxData : NATURAL := 16#FF#; --255; + CONSTANT AddrRANGE : NATURAL := 16#0FFFFFF#; + + TYPE MemArray IS ARRAY (0 TO AddrRANGE) OF INTEGER RANGE -1 TO MaxData; + SHARED VARIABLE Mem : MemArray := (OTHERS => MaxData); +begin + MemPreload : PROCESS + BEGIN + IF UserPreload THEN + Mem := (OTHERS => MaxData); + end if; + WAIT; + END PROCESS MemPreload; +END vhdl_behavioral; diff --git a/testsuite/gna/issue1361/repro2.vhdl b/testsuite/gna/issue1361/repro2.vhdl new file mode 100644 index 000000000..428073458 --- /dev/null +++ b/testsuite/gna/issue1361/repro2.vhdl @@ -0,0 +1,15 @@ +ENTITY repro2 IS +END repro2; + +ARCHITECTURE behav of repro2 IS + CONSTANT AddrRANGE : NATURAL := 16#0FFFFFF#; + + TYPE MemArray IS ARRAY (0 TO AddrRANGE) OF bit_vector(7 downto 0); +begin + process + VARIABLE Mem : MemArray := (OTHERS => x"00"); + begin + Mem := (OTHERS => x"ff"); + WAIT; + END PROCESS; +END behav; diff --git a/testsuite/gna/issue1361/repro3.vhdl b/testsuite/gna/issue1361/repro3.vhdl new file mode 100644 index 000000000..1309a3ba0 --- /dev/null +++ b/testsuite/gna/issue1361/repro3.vhdl @@ -0,0 +1,15 @@ +ENTITY repro3 IS +END repro3; + +ARCHITECTURE behav of repro3 IS + CONSTANT AddrRANGE : NATURAL := 16#0FFFFFF#; + + TYPE MemArray IS ARRAY (0 TO AddrRANGE) OF bit_vector; +begin + process + VARIABLE Mem : MemArray(open)(7 downto 0) := (OTHERS => x"00"); + begin + Mem := (OTHERS => x"ff"); + WAIT; + END PROCESS; +END behav; diff --git a/testsuite/gna/issue1361/repro3err.vhdl b/testsuite/gna/issue1361/repro3err.vhdl new file mode 100644 index 000000000..9d7b82007 --- /dev/null +++ b/testsuite/gna/issue1361/repro3err.vhdl @@ -0,0 +1,15 @@ +ENTITY repro3err IS +END repro3err; + +ARCHITECTURE behav of repro3err IS + CONSTANT AddrRANGE : NATURAL := 16#0FFFFFF#; + + TYPE MemArray IS ARRAY (0 TO AddrRANGE) OF bit_vector; +begin + process + VARIABLE Mem : MemArray(open)(7 downto 0) := (OTHERS => x"00"); + begin + Mem := (OTHERS => x"fff"); + WAIT; + END PROCESS; +END behav; diff --git a/testsuite/gna/issue1361/testsuite.sh b/testsuite/gna/issue1361/testsuite.sh new file mode 100755 index 000000000..f809c42d2 --- /dev/null +++ b/testsuite/gna/issue1361/testsuite.sh @@ -0,0 +1,19 @@ +#! /bin/sh + +. ../../testenv.sh + +analyze repro.vhdl +elab_simulate repro + +analyze repro2.vhdl +elab_simulate repro2 + +clean + +export GHDL_STD_FLAGS=--std=08 +analyze repro3.vhdl +elab_simulate repro3 + +clean + +echo "Test successful" -- cgit v1.2.3