aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/issue1042
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-28 18:33:53 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-28 18:40:27 +0100
commit6a8be8e0ace3040689d849990114415ead81879d (patch)
tree5104b49c379084a5719c21b39009afe1e78d07e9 /testsuite/synth/issue1042
parent49c59985a88a1bd8ab2ef812574d41dd96022840 (diff)
downloadghdl-6a8be8e0ace3040689d849990114415ead81879d.tar.gz
ghdl-6a8be8e0ace3040689d849990114415ead81879d.tar.bz2
ghdl-6a8be8e0ace3040689d849990114415ead81879d.zip
testsuite: add testcase for #1042.
Diffstat (limited to 'testsuite/synth/issue1042')
-rw-r--r--testsuite/synth/issue1042/ent.vhdl25
-rwxr-xr-xtestsuite/synth/issue1042/testsuite.sh12
2 files changed, 37 insertions, 0 deletions
diff --git a/testsuite/synth/issue1042/ent.vhdl b/testsuite/synth/issue1042/ent.vhdl
new file mode 100644
index 000000000..df10edc5f
--- /dev/null
+++ b/testsuite/synth/issue1042/ent.vhdl
@@ -0,0 +1,25 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity ent is
+ generic (
+ VAL : real := 1.5
+ );
+ port (
+ lt : out std_logic;
+ lte : out std_logic;
+ eq : out std_logic;
+ gte : out std_logic;
+ gt : out std_logic
+ );
+end;
+
+architecture a of ent is
+begin
+ lt <= '1' when VAL < 1.5 else '0';
+ lte <= '1' when VAL <= 1.5 else '0';
+ eq <= '1' when VAL = 1.5 else '0';
+ gte <= '1' when VAL >= 1.5 else '0';
+ gt <= '1' when VAL > 1.5 else '0';
+end;
+
diff --git a/testsuite/synth/issue1042/testsuite.sh b/testsuite/synth/issue1042/testsuite.sh
new file mode 100755
index 000000000..bc454cfda
--- /dev/null
+++ b/testsuite/synth/issue1042/testsuite.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+for t in ent; do
+ synth $t.vhdl -e $t > syn_$t.vhdl
+ analyze syn_$t.vhdl
+done
+
+clean
+
+echo "Test successful"