aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-03-10 20:34:17 +0100
committerTristan Gingold <tgingold@free.fr>2020-03-10 20:34:17 +0100
commit556bd7c420a231b02b7159217aec9ae5bbe34e8d (patch)
tree0f434f2bfa2a777f81ffb90e5da896de8bb179e0 /testsuite/synth
parent2e50c44a48b74ecb7f5a14e4c4d0181cfa2d7402 (diff)
downloadghdl-556bd7c420a231b02b7159217aec9ae5bbe34e8d.tar.gz
ghdl-556bd7c420a231b02b7159217aec9ae5bbe34e8d.tar.bz2
ghdl-556bd7c420a231b02b7159217aec9ae5bbe34e8d.zip
testsuite/synth: add a test for previous commit.
Diffstat (limited to 'testsuite/synth')
-rw-r--r--testsuite/synth/if02/if01.vhdl15
-rw-r--r--testsuite/synth/if02/if02.vhdl15
-rw-r--r--testsuite/synth/if02/if03.vhdl21
-rwxr-xr-xtestsuite/synth/if02/testsuite.sh9
4 files changed, 60 insertions, 0 deletions
diff --git a/testsuite/synth/if02/if01.vhdl b/testsuite/synth/if02/if01.vhdl
new file mode 100644
index 000000000..fa515cd7d
--- /dev/null
+++ b/testsuite/synth/if02/if01.vhdl
@@ -0,0 +1,15 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity if01 is
+ port (a : std_logic;
+ b : std_logic;
+ sel : std_logic;
+ s : out std_logic);
+end if01;
+
+architecture behav of if01 is
+begin
+ s <= a when sel = '0'
+ else b when sel = '1';
+end behav;
diff --git a/testsuite/synth/if02/if02.vhdl b/testsuite/synth/if02/if02.vhdl
new file mode 100644
index 000000000..b9155c7c4
--- /dev/null
+++ b/testsuite/synth/if02/if02.vhdl
@@ -0,0 +1,15 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity if01 is
+ port (a : std_logic;
+ b : std_logic;
+ sel : std_logic_vector (1 downto 0);
+ s : out std_logic);
+end if01;
+
+architecture behav of if01 is
+begin
+ s <= a when sel = "01"
+ else b when sel = "10";
+end behav;
diff --git a/testsuite/synth/if02/if03.vhdl b/testsuite/synth/if02/if03.vhdl
new file mode 100644
index 000000000..6ff896358
--- /dev/null
+++ b/testsuite/synth/if02/if03.vhdl
@@ -0,0 +1,21 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+entity if03 is
+ port (a : std_logic;
+ b : std_logic;
+ sel : std_logic;
+ s : out std_logic);
+end if03;
+
+architecture behav of if03 is
+begin
+ process (a, b, sel)
+ begin
+ if sel = '0' then
+ s <= a;
+ elsif sel = '1' then
+ s <= b;
+ end if;
+ end process;
+end behav;
diff --git a/testsuite/synth/if02/testsuite.sh b/testsuite/synth/if02/testsuite.sh
new file mode 100755
index 000000000..575200dcb
--- /dev/null
+++ b/testsuite/synth/if02/testsuite.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+for t in if01 if02 if03; do
+ synth_failure $t.vhdl -e
+done
+
+echo "Test successful"