aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2023-02-25 08:23:20 +0100
committerTristan Gingold <tgingold@free.fr>2023-02-25 08:23:20 +0100
commit6985d68bd34e2528a1a31a317225f131e7404536 (patch)
tree2e3f16a992c25d6b24f93a3f0d76e1982f42598c /testsuite
parentb7c5831f6b6ca8978b1e98f316553d1d537b27c1 (diff)
downloadghdl-6985d68bd34e2528a1a31a317225f131e7404536.tar.gz
ghdl-6985d68bd34e2528a1a31a317225f131e7404536.tar.bz2
ghdl-6985d68bd34e2528a1a31a317225f131e7404536.zip
testsuite/synth: add a test for #2361
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/synth/issue2361/jkff.vhdl19
-rwxr-xr-xtestsuite/synth/issue2361/testsuite.sh8
2 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/synth/issue2361/jkff.vhdl b/testsuite/synth/issue2361/jkff.vhdl
new file mode 100644
index 000000000..0417089e2
--- /dev/null
+++ b/testsuite/synth/issue2361/jkff.vhdl
@@ -0,0 +1,19 @@
+entity jkff is
+ port (
+ j_n, k_n, clk : in bit;
+ q, q_n : inout bit);
+end entity;
+
+architecture behavioral of jkff is
+begin
+ flip_flop : process (j_n, k_n, clk) is
+ begin
+ case j_n & k_n & clk is
+ when "010" | "011" => q <= '1';
+ when "100" | "101" => q <= '0';
+ when "001" => q <= q_n;
+ when others => q <= unaffected;
+ end case;
+ end process;
+ q_n <= not q;
+end architecture;
diff --git a/testsuite/synth/issue2361/testsuite.sh b/testsuite/synth/issue2361/testsuite.sh
new file mode 100755
index 000000000..9ca84e726
--- /dev/null
+++ b/testsuite/synth/issue2361/testsuite.sh
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+GHDL_STD_FLAGS=--std=08
+synth_only jkff
+
+echo "Test successful"