summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorTristan Gingold2013-12-29 04:27:56 +0100
committerTristan Gingold2013-12-29 04:27:56 +0100
commit1ab7d75f4c4c6e281d1cd96084aae231481df609 (patch)
treed0be1ee51b474825fa3d58cf985a7fc6f102b696 /testsuite
parent6e75035993a0f52456c300931ee32b24e2626696 (diff)
downloadghdl-1ab7d75f4c4c6e281d1cd96084aae231481df609.tar.gz
ghdl-1ab7d75f4c4c6e281d1cd96084aae231481df609.tar.bz2
ghdl-1ab7d75f4c4c6e281d1cd96084aae231481df609.zip
Add bug20771.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/gna/bug20771/20771.vhd31
-rw-r--r--testsuite/gna/bug20771/hello.txt4
-rwxr-xr-xtestsuite/gna/bug20771/testsuite.sh10
3 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/gna/bug20771/20771.vhd b/testsuite/gna/bug20771/20771.vhd
new file mode 100644
index 0000000..55968ae
--- /dev/null
+++ b/testsuite/gna/bug20771/20771.vhd
@@ -0,0 +1,31 @@
+entity Jon is
+end Jon;
+
+use std.textio.all;
+
+architecture Taylor of Jon is
+begin
+
+process is
+ variable buf:line;
+ variable s : string(1 to 1);
+
+ variable fstatus : file_open_status;
+ file readfile : text;
+ constant temp_string : string := "hello.txt";
+begin
+ file_open(fstatus, readfile, temp_string, read_mode);
+ report "open " & file_open_status'image(fstatus) severity note;
+ if fstatus = OPEN_OK then
+-- while not endfile(readfile)
+ loop
+ readline(readfile, buf);
+ read(buf, s);
+ report "s= "& s severity note;
+ end loop;
+ end if;
+ report "done" severity note;
+ wait;
+end process;
+
+end Taylor;
diff --git a/testsuite/gna/bug20771/hello.txt b/testsuite/gna/bug20771/hello.txt
new file mode 100644
index 0000000..a9a9b00
--- /dev/null
+++ b/testsuite/gna/bug20771/hello.txt
@@ -0,0 +1,4 @@
+1
+2
+hello
+3
diff --git a/testsuite/gna/bug20771/testsuite.sh b/testsuite/gna/bug20771/testsuite.sh
new file mode 100755
index 0000000..384aaeb
--- /dev/null
+++ b/testsuite/gna/bug20771/testsuite.sh
@@ -0,0 +1,10 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze 20771.vhd
+elab_simulate_failure jon
+
+clean
+
+echo "Test successful"