From e8bd5e0824f4d3f626650446c1df438ebb7d994b Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 30 May 2015 14:05:38 +0200 Subject: Testcase for ticket84. --- testsuite/gna/ticket84/bug.vhdl | 27 +++++++++++++++++++++++++++ testsuite/gna/ticket84/testsuite.sh | 16 ++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 testsuite/gna/ticket84/bug.vhdl create mode 100755 testsuite/gna/ticket84/testsuite.sh (limited to 'testsuite/gna/ticket84') 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" -- cgit