aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2015-05-30 14:05:38 +0200
committerTristan Gingold <tgingold@free.fr>2015-05-30 14:05:38 +0200
commite8bd5e0824f4d3f626650446c1df438ebb7d994b (patch)
treed9c0910b2f4104292b72c59c18bae4b702aca748
parentf6d8e786a1ca3165b41cea7de05b8f2151ac31ff (diff)
downloadghdl-e8bd5e0824f4d3f626650446c1df438ebb7d994b.tar.gz
ghdl-e8bd5e0824f4d3f626650446c1df438ebb7d994b.tar.bz2
ghdl-e8bd5e0824f4d3f626650446c1df438ebb7d994b.zip
Testcase for ticket84.
-rw-r--r--testsuite/gna/ticket84/bug.vhdl27
-rwxr-xr-xtestsuite/gna/ticket84/testsuite.sh16
2 files changed, 43 insertions, 0 deletions
diff --git a/testsuite/gna/ticket84/bug.vhdl b/testsuite/gna/ticket84/bug.vhdl
new file mode 100644
index 000000000..8541a70c0
--- /dev/null
+++ b/testsuite/gna/ticket84/bug.vhdl
@@ -0,0 +1,27 @@
+use std.textio.all;
+
+entity ent is
+end entity;
+
+architecture a of ent is
+begin
+ main : process
+ type binary_file is file of character;
+ file fptr_text : text;
+ file fptr_binary : binary_file;
+ begin
+ file_open(fptr_text, "file.txt", write_mode);
+ write(fptr_text, string'("a"));
+ write(fptr_text, string'("b"));
+ file_close(fptr_text);
+
+ file_open(fptr_binary, "file.raw", write_mode);
+ write(fptr_binary, character'('a'));
+ write(fptr_binary, character'('b'));
+ file_close(fptr_binary);
+
+ write(output, string'("a"));
+ write(output, string'("b"));
+ wait;
+ end process;
+end architecture;
diff --git a/testsuite/gna/ticket84/testsuite.sh b/testsuite/gna/ticket84/testsuite.sh
new file mode 100755
index 000000000..aad3f12b3
--- /dev/null
+++ b/testsuite/gna/ticket84/testsuite.sh
@@ -0,0 +1,16 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze bug.vhdl
+elab_simulate ent
+clean
+
+if ! cmp file.txt file.raw; then
+ echo "Comparison mismatch"
+ exit 1
+fi
+
+rm -f file.txt file.raw
+
+echo "Test successful"