aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2013-12-29 03:55:27 +0100
committerTristan Gingold <tgingold@free.fr>2013-12-29 03:55:27 +0100
commite053480a1adc2d170ab2b4434413e0e56e0e27a1 (patch)
treef32aa01a40f7f08126634f229567a265652b39ea /testsuite
parent9ba1b51a8e8d55f01f6c71dbe381b79c73443ea8 (diff)
downloadghdl-e053480a1adc2d170ab2b4434413e0e56e0e27a1.tar.gz
ghdl-e053480a1adc2d170ab2b4434413e0e56e0e27a1.tar.bz2
ghdl-e053480a1adc2d170ab2b4434413e0e56e0e27a1.zip
Add bug18359
Diffstat (limited to 'testsuite')
-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"