diff options
author | Tristan Gingold | 2015-05-30 14:05:38 +0200 |
---|---|---|
committer | Tristan Gingold | 2015-05-30 14:05:38 +0200 |
commit | e8bd5e0824f4d3f626650446c1df438ebb7d994b (patch) | |
tree | d9c0910b2f4104292b72c59c18bae4b702aca748 /testsuite/gna/ticket84 | |
parent | f6d8e786a1ca3165b41cea7de05b8f2151ac31ff (diff) | |
download | ghdl-e8bd5e0824f4d3f626650446c1df438ebb7d994b.tar.gz ghdl-e8bd5e0824f4d3f626650446c1df438ebb7d994b.tar.bz2 ghdl-e8bd5e0824f4d3f626650446c1df438ebb7d994b.zip |
Testcase for ticket84.
Diffstat (limited to 'testsuite/gna/ticket84')
-rw-r--r-- | testsuite/gna/ticket84/bug.vhdl | 27 | ||||
-rwxr-xr-x | testsuite/gna/ticket84/testsuite.sh | 16 |
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 0000000..8541a70 --- /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 0000000..aad3f12 --- /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" |