aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/ticket39
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-03-14 07:26:23 +0100
committerTristan Gingold <tgingold@free.fr>2015-03-14 07:26:23 +0100
commitfb10c3db8616f63ed33ba3d2d0f62bc0514ac536 (patch)
treeb917019562949de259dc50d03f0046cd7d8e844f /testsuite/gna/ticket39
parentc38d446c4d9c4fb304f29f15a89c3959b5a883ba (diff)
downloadghdl-fb10c3db8616f63ed33ba3d2d0f62bc0514ac536.tar.gz
ghdl-fb10c3db8616f63ed33ba3d2d0f62bc0514ac536.tar.bz2
ghdl-fb10c3db8616f63ed33ba3d2d0f62bc0514ac536.zip
Add test for ticket39
Diffstat (limited to 'testsuite/gna/ticket39')
-rw-r--r--testsuite/gna/ticket39/test.vhd44
-rwxr-xr-xtestsuite/gna/ticket39/testsuite.sh10
2 files changed, 54 insertions, 0 deletions
diff --git a/testsuite/gna/ticket39/test.vhd b/testsuite/gna/ticket39/test.vhd
new file mode 100644
index 000000000..e1df80501
--- /dev/null
+++ b/testsuite/gna/ticket39/test.vhd
@@ -0,0 +1,44 @@
+entity test is
+end entity test;
+
+library ieee;
+use ieee.std_logic_1164.all;
+
+architecture test of test is
+
+ type state_t is record
+ a : real;
+ end record state_t;
+
+ procedure p1 (
+ variable state : inout state_t;
+ a : in std_ulogic_vector(1 downto 0)) is
+ begin
+ report "test " & std_ulogic'image(a(1)) & std_ulogic'image(a(0)) severity note;
+ end procedure p1;
+
+ procedure p2 (
+ variable state : inout state_t;
+ n : in natural) is
+ variable b : std_ulogic;
+ begin
+ b := '0';
+ for i in 0 to n loop
+ p1(state => state, a(0) => b, a(1) => 'X');
+ b := not b;
+ state.a := state.a + 1.0;
+ end loop;
+ end procedure p2;
+
+begin
+
+ p_p: process is
+ variable state : state_t;
+ begin
+ state.a := 0.0;
+ p2(state, 2);
+ p2(state, 2);
+ wait;
+ end process p_p;
+
+end architecture test;
diff --git a/testsuite/gna/ticket39/testsuite.sh b/testsuite/gna/ticket39/testsuite.sh
new file mode 100755
index 000000000..99a5b4d78
--- /dev/null
+++ b/testsuite/gna/ticket39/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze test.vhd
+elab_simulate test
+
+clean
+
+echo "Test successful"