aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug18359
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/gna/bug18359')
-rw-r--r--testsuite/gna/bug18359/testcase.vhdl28
-rwxr-xr-xtestsuite/gna/bug18359/testsuite.sh10
2 files changed, 38 insertions, 0 deletions
diff --git a/testsuite/gna/bug18359/testcase.vhdl b/testsuite/gna/bug18359/testcase.vhdl
new file mode 100644
index 000000000..4302e942a
--- /dev/null
+++ b/testsuite/gna/bug18359/testcase.vhdl
@@ -0,0 +1,28 @@
+entity testcase is
+end entity testcase;
+
+architecture non_conformity of testcase is
+ function some_function return integer is
+ variable my : integer := 0;
+ begin
+ my := my + 1;
+ return my;
+ end function some_function;
+begin
+
+ stuff: process
+ variable last_value : integer;
+ begin
+ for i in 1 to 4 loop
+ report "Count: " & integer'image(some_function)
+ severity NOTE;
+ end loop;
+ last_value := some_function;
+ assert last_value = 5
+ report "Counter's last value is " & integer'image(last_value)
+ & " but expected 5"
+ severity ERROR;
+ wait;
+ end process;
+
+end architecture non_conformity;
diff --git a/testsuite/gna/bug18359/testsuite.sh b/testsuite/gna/bug18359/testsuite.sh
new file mode 100755
index 000000000..6846fea28
--- /dev/null
+++ b/testsuite/gna/bug18359/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze testcase.vhdl
+elab_simulate testcase
+
+clean
+
+echo "Test successful"