From 91c054e4cce6aa8d4fc53d3d02970a752a9d2987 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 26 Sep 2020 09:12:54 +0200 Subject: testsuite/synth: add a case for #1475 --- testsuite/synth/issue1475/e.vhdl | 11 +++++++++++ testsuite/synth/issue1475/e1.vhdl | 12 ++++++++++++ testsuite/synth/issue1475/e2.vhdl | 15 +++++++++++++++ testsuite/synth/issue1475/testsuite.sh | 10 ++++++++++ 4 files changed, 48 insertions(+) create mode 100644 testsuite/synth/issue1475/e.vhdl create mode 100644 testsuite/synth/issue1475/e1.vhdl create mode 100644 testsuite/synth/issue1475/e2.vhdl create mode 100755 testsuite/synth/issue1475/testsuite.sh diff --git a/testsuite/synth/issue1475/e.vhdl b/testsuite/synth/issue1475/e.vhdl new file mode 100644 index 000000000..e4e6497af --- /dev/null +++ b/testsuite/synth/issue1475/e.vhdl @@ -0,0 +1,11 @@ +library ieee; +use ieee.numeric_std.all; + +entity e is +end entity; + +architecture a of e is + signal s : unsigned(31 downto 0); +begin + assert s = -3; +end architecture; diff --git a/testsuite/synth/issue1475/e1.vhdl b/testsuite/synth/issue1475/e1.vhdl new file mode 100644 index 000000000..c1523bf4f --- /dev/null +++ b/testsuite/synth/issue1475/e1.vhdl @@ -0,0 +1,12 @@ +library ieee; +use ieee.numeric_std.all; +use ieee.std_logic_1164.all; + +entity e1 is +end entity; + +architecture a of e1 is + signal s : unsigned(31 downto 0) := (others => '0'); +begin + assert s = -3; +end architecture; diff --git a/testsuite/synth/issue1475/e2.vhdl b/testsuite/synth/issue1475/e2.vhdl new file mode 100644 index 000000000..88b83c94d --- /dev/null +++ b/testsuite/synth/issue1475/e2.vhdl @@ -0,0 +1,15 @@ +entity e2 is +end; + +architecture behav of e2 is + type my_type is (lit1, lit2); + + function "+" (l : my_type; r : natural) return my_type is + begin + return lit2; + end "+"; + + signal s : my_type := lit1; +begin + assert s + (-1) = lit2; +end behav; diff --git a/testsuite/synth/issue1475/testsuite.sh b/testsuite/synth/issue1475/testsuite.sh new file mode 100755 index 000000000..495223cad --- /dev/null +++ b/testsuite/synth/issue1475/testsuite.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +. ../../testenv.sh + +for t in e2 e1 e; do + synth_failure $t +done +clean + +echo "Test successful" -- cgit v1.2.3