summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testsuite/gna/bug017/call1.vhdl20
-rw-r--r--testsuite/gna/bug017/call2.vhdl20
-rw-r--r--testsuite/gna/bug017/call3.vhdl29
-rw-r--r--testsuite/gna/bug017/call4.vhdl28
-rw-r--r--testsuite/gna/bug017/call5.vhdl21
-rw-r--r--testsuite/gna/bug017/call6.vhdl21
-rw-r--r--testsuite/gna/bug017/call7.vhdl25
-rw-r--r--testsuite/gna/bug017/call8.vhdl25
-rw-r--r--testsuite/gna/bug017/call9.vhdl28
-rw-r--r--testsuite/gna/bug017/for1.vhdl16
-rw-r--r--testsuite/gna/bug017/if1.vhdl22
-rw-r--r--testsuite/gna/bug017/if2.vhdl23
-rw-r--r--testsuite/gna/bug017/if3.vhdl23
-rw-r--r--testsuite/gna/bug017/if4.vhdl19
-rw-r--r--testsuite/gna/bug017/loop1.vhdl19
-rw-r--r--testsuite/gna/bug017/loop2.vhdl20
-rw-r--r--testsuite/gna/bug017/ret1.vhdl25
-rw-r--r--testsuite/gna/bug017/simple.vhdl11
-rwxr-xr-xtestsuite/gna/bug017/testsuite.sh40
-rw-r--r--testsuite/gna/bug017/wait1.vhdl13
-rw-r--r--testsuite/gna/bug017/wait2.vhdl16
-rw-r--r--testsuite/gna/bug017/wait3.vhdl18
22 files changed, 482 insertions, 0 deletions
diff --git a/testsuite/gna/bug017/call1.vhdl b/testsuite/gna/bug017/call1.vhdl
new file mode 100644
index 0000000..ba68814
--- /dev/null
+++ b/testsuite/gna/bug017/call1.vhdl
@@ -0,0 +1,20 @@
+entity call1 is
+end;
+
+architecture behav of call1 is
+ procedure p is
+ begin
+ for i in 1 to 10 loop
+ report "hello";
+ wait for 1 ns;
+ end loop;
+ end p;
+begin
+ process
+ begin
+ p;
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/call2.vhdl b/testsuite/gna/bug017/call2.vhdl
new file mode 100644
index 0000000..82467b4
--- /dev/null
+++ b/testsuite/gna/bug017/call2.vhdl
@@ -0,0 +1,20 @@
+entity call2 is
+end;
+
+architecture behav of call2 is
+ procedure p (n : natural) is
+ begin
+ for i in 1 to n loop
+ report "hello";
+ wait for 1 ns;
+ end loop;
+ end p;
+begin
+ process
+ begin
+ p (5);
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/call3.vhdl b/testsuite/gna/bug017/call3.vhdl
new file mode 100644
index 0000000..43d5b0b
--- /dev/null
+++ b/testsuite/gna/bug017/call3.vhdl
@@ -0,0 +1,29 @@
+entity call3 is
+end;
+
+architecture behav of call3 is
+ procedure p2 (n : natural) is
+ begin
+ for i in 1 to n loop
+ report "hello 2";
+ wait for 1 ns;
+ end loop;
+ end p2;
+
+ procedure p (n : natural) is
+ begin
+ for i in 1 to n loop
+ p2 (i);
+ report "hello 1";
+ wait for 1 ns;
+ end loop;
+ end p;
+begin
+ process
+ begin
+ p (5);
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/call4.vhdl b/testsuite/gna/bug017/call4.vhdl
new file mode 100644
index 0000000..e2d600c
--- /dev/null
+++ b/testsuite/gna/bug017/call4.vhdl
@@ -0,0 +1,28 @@
+entity call4 is
+end;
+
+architecture behav of call4 is
+ procedure p (n : natural) is
+ procedure p2 (m : natural) is
+ begin
+ for i in 1 to m loop
+ report "hello 2";
+ wait for 1 ns;
+ end loop;
+ end p2;
+ begin
+ for i in 1 to n loop
+ p2 (i);
+ report "hello 1";
+ wait for 1 ns;
+ end loop;
+ end p;
+begin
+ process
+ begin
+ p (5);
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/call5.vhdl b/testsuite/gna/bug017/call5.vhdl
new file mode 100644
index 0000000..b5c372a
--- /dev/null
+++ b/testsuite/gna/bug017/call5.vhdl
@@ -0,0 +1,21 @@
+entity call5 is
+end;
+
+architecture behav of call5 is
+ procedure inc (p : inout integer) is
+ begin
+ wait for 1 ns;
+ p := p + 1;
+ end inc;
+begin
+ process
+ variable v : integer := 2;
+ begin
+ inc (v);
+ wait for 2 ns;
+ inc (v);
+ assert not (v = 4) report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/call6.vhdl b/testsuite/gna/bug017/call6.vhdl
new file mode 100644
index 0000000..c52b08b
--- /dev/null
+++ b/testsuite/gna/bug017/call6.vhdl
@@ -0,0 +1,21 @@
+entity call6 is
+end;
+
+architecture behav of call6 is
+ procedure check (s : string) is
+ begin
+ wait for 1 ns;
+ assert s (2) = 'a';
+ end;
+begin
+ process
+ variable v : integer := 2;
+ begin
+ check ("bac");
+ wait for 2 ns;
+ check ((1 => 'e', 2 => 'a', 3 => 'c'));
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/call7.vhdl b/testsuite/gna/bug017/call7.vhdl
new file mode 100644
index 0000000..54bcd05
--- /dev/null
+++ b/testsuite/gna/bug017/call7.vhdl
@@ -0,0 +1,25 @@
+entity call7 is
+end;
+
+architecture behav of call7 is
+ procedure check (s : string) is
+ begin
+ wait for 1 ns;
+ assert s (2) = 'a';
+ end;
+ function get_str
+ return string is
+ begin
+ return "xaz";
+ end get_str;
+begin
+ process
+ begin
+ check ("bac");
+ wait for 2 ns;
+ check (get_str);
+ report "SUCCESS" severity note;
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/call8.vhdl b/testsuite/gna/bug017/call8.vhdl
new file mode 100644
index 0000000..4e88c65
--- /dev/null
+++ b/testsuite/gna/bug017/call8.vhdl
@@ -0,0 +1,25 @@
+entity call8 is
+end;
+
+architecture behav of call8 is
+ type int_vector is array (natural range <>) of integer;
+ constant c : integer := 16#0123_4567#;
+
+ procedure check (s : int_vector) is
+ begin
+ wait for 2 ns;
+ assert s (2) = c;
+ end;
+
+ signal s : int_vector (0 to 3) := (123, 234, c, 345);
+begin
+ s (2) <= 456 after 1 ns;
+
+ process
+ begin
+ check (s);
+ report "SUCCESS" severity note;
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/call9.vhdl b/testsuite/gna/bug017/call9.vhdl
new file mode 100644
index 0000000..a6d6100
--- /dev/null
+++ b/testsuite/gna/bug017/call9.vhdl
@@ -0,0 +1,28 @@
+entity call9 is
+end;
+
+use std.textio.all;
+architecture behav of call9 is
+ procedure check_acc (l1, l2 : inout line) is
+ begin
+ assert l1 = null;
+ assert l2 = null;
+
+ l1 := new string'("Hello world");
+ assert l1 /= null;
+ assert l2 = null report "incorrect aliasing";
+
+ l2 := new string'("second");
+ assert l2 /= null;
+ assert l2 /= l1 report "incorrect aliasing";
+ end check_acc;
+begin
+ process
+ variable l : line;
+ begin
+ check_acc (l, l);
+ report "SUCCESS" severity note;
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/for1.vhdl b/testsuite/gna/bug017/for1.vhdl
new file mode 100644
index 0000000..02be9a1
--- /dev/null
+++ b/testsuite/gna/bug017/for1.vhdl
@@ -0,0 +1,16 @@
+entity for1 is
+end;
+
+architecture behav of for1 is
+begin
+ process
+ begin
+ for i in 1 to 10 loop
+ report "hello";
+ wait for 1 ns;
+ end loop;
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/if1.vhdl b/testsuite/gna/bug017/if1.vhdl
new file mode 100644
index 0000000..57554c7
--- /dev/null
+++ b/testsuite/gna/bug017/if1.vhdl
@@ -0,0 +1,22 @@
+entity if1 is
+end;
+
+architecture behav of if1 is
+begin
+ process
+ variable i : natural := 0;
+ begin
+ report "hello";
+ loop
+ if i = 10 then
+ exit;
+ else
+ report "hello2";
+ end if;
+ i := i + 1;
+ end loop;
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/if2.vhdl b/testsuite/gna/bug017/if2.vhdl
new file mode 100644
index 0000000..7c25c81
--- /dev/null
+++ b/testsuite/gna/bug017/if2.vhdl
@@ -0,0 +1,23 @@
+entity if2 is
+end;
+
+architecture behav of if2 is
+begin
+ process
+ variable i : natural := 0;
+ begin
+ report "hello";
+ loop
+ if i = 10 then
+ exit;
+ else
+ report "hello2";
+ wait for 1 ns;
+ end if;
+ i := i + 1;
+ end loop;
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/if3.vhdl b/testsuite/gna/bug017/if3.vhdl
new file mode 100644
index 0000000..0bc8708
--- /dev/null
+++ b/testsuite/gna/bug017/if3.vhdl
@@ -0,0 +1,23 @@
+entity if3 is
+end;
+
+architecture behav of if3 is
+begin
+ process
+ variable i : natural := 0;
+ begin
+ report "hello";
+ loop
+ if i = 10 then
+ exit;
+ else
+ report "hello2";
+ end if;
+ wait for 1 ns;
+ i := i + 1;
+ end loop;
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/if4.vhdl b/testsuite/gna/bug017/if4.vhdl
new file mode 100644
index 0000000..8eebe2c
--- /dev/null
+++ b/testsuite/gna/bug017/if4.vhdl
@@ -0,0 +1,19 @@
+entity if4 is
+end;
+
+architecture behav of if4 is
+begin
+ process
+ variable i : natural := 0;
+ begin
+ report "hello";
+ if i = 10 then
+ wait for 1 ns;
+ else
+ report "hello2";
+ end if;
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/loop1.vhdl b/testsuite/gna/bug017/loop1.vhdl
new file mode 100644
index 0000000..137628d
--- /dev/null
+++ b/testsuite/gna/bug017/loop1.vhdl
@@ -0,0 +1,19 @@
+entity loop1 is
+end;
+
+architecture behav of loop1 is
+begin
+ process
+ variable i : natural := 0;
+ begin
+ report "hello";
+ while i < 10 loop
+ wait for 1 ns;
+ report "hello2";
+ i := i + 1;
+ end loop;
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/loop2.vhdl b/testsuite/gna/bug017/loop2.vhdl
new file mode 100644
index 0000000..47a7da6
--- /dev/null
+++ b/testsuite/gna/bug017/loop2.vhdl
@@ -0,0 +1,20 @@
+entity loop2 is
+end;
+
+architecture behav of loop2 is
+begin
+ process
+ variable i : natural := 0;
+ begin
+ report "hello";
+ loop
+ exit when i = 10;
+ wait for 1 ns;
+ report "hello2";
+ i := i + 1;
+ end loop;
+ report "SUCCESS";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/ret1.vhdl b/testsuite/gna/bug017/ret1.vhdl
new file mode 100644
index 0000000..2ff937d
--- /dev/null
+++ b/testsuite/gna/bug017/ret1.vhdl
@@ -0,0 +1,25 @@
+entity ret1 is
+end;
+
+architecture behav of ret1 is
+ procedure p (n : natural) is
+ variable i : natural := 0;
+ begin
+ loop
+ report "hello 1";
+ wait for 1 ns;
+ if i = n then
+ return;
+ end if;
+ i := i + 1;
+ end loop;
+ end p;
+begin
+ process
+ begin
+ p (5);
+ report "SUCCESS: hello3";
+ wait;
+ end process;
+
+end behav;
diff --git a/testsuite/gna/bug017/simple.vhdl b/testsuite/gna/bug017/simple.vhdl
new file mode 100644
index 0000000..539bc10
--- /dev/null
+++ b/testsuite/gna/bug017/simple.vhdl
@@ -0,0 +1,11 @@
+entity simple is
+end;
+
+architecture behav of simple is
+begin
+ process
+ begin
+ report "hello";
+ assert false report "SUCESS";
+ end process;
+end behav;
diff --git a/testsuite/gna/bug017/testsuite.sh b/testsuite/gna/bug017/testsuite.sh
new file mode 100755
index 0000000..ec1f709
--- /dev/null
+++ b/testsuite/gna/bug017/testsuite.sh
@@ -0,0 +1,40 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+units="
+call1
+call2
+call3
+call4
+call5
+call6
+call7
+call8
+call9
+for1
+if1
+if2
+if3
+if4
+loop1
+loop2
+ret1
+wait1
+wait2
+wait3
+"
+
+for f in $units; do
+ analyze ${f}.vhdl
+ elab_simulate $f --assert-level=error 2>&1 | tee res.out
+ if ! grep -q SUCCESS res.out; then
+ echo "Failure of $f"
+ exit 1
+ fi
+done
+
+rm -f res.out
+clean
+
+echo "Test successful"
diff --git a/testsuite/gna/bug017/wait1.vhdl b/testsuite/gna/bug017/wait1.vhdl
new file mode 100644
index 0000000..fbea74a
--- /dev/null
+++ b/testsuite/gna/bug017/wait1.vhdl
@@ -0,0 +1,13 @@
+entity wait1 is
+end;
+
+architecture behav of wait1 is
+begin
+ process
+ begin
+ report "hello";
+ wait for 1 ns;
+ report "SUCCESS";
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/bug017/wait2.vhdl b/testsuite/gna/bug017/wait2.vhdl
new file mode 100644
index 0000000..c3fcd7f
--- /dev/null
+++ b/testsuite/gna/bug017/wait2.vhdl
@@ -0,0 +1,16 @@
+entity wait2 is
+end;
+
+architecture behav of wait2 is
+ signal t : natural;
+begin
+ process
+ begin
+ report "hello";
+ wait until t = 2;
+ report "SUCCESS";
+ wait;
+ end process;
+
+ t <= 1 after 2 ns, 2 after 4 ns;
+end behav;
diff --git a/testsuite/gna/bug017/wait3.vhdl b/testsuite/gna/bug017/wait3.vhdl
new file mode 100644
index 0000000..77599ba
--- /dev/null
+++ b/testsuite/gna/bug017/wait3.vhdl
@@ -0,0 +1,18 @@
+entity wait3 is
+end;
+
+architecture behav of wait3 is
+ signal t : natural;
+begin
+ process
+ begin
+ report "hello";
+ wait on t;
+ report "hello2";
+ wait for 0 ns;
+ report "SUCCESS";
+ wait;
+ end process;
+
+ t <= 1 after 2 ns, 2 after 4 ns;
+end behav;