summaryrefslogtreecommitdiff
path: root/testsuite/gna/ticket98
diff options
context:
space:
mode:
authorTristan Gingold2015-12-21 19:52:11 +0100
committerTristan Gingold2015-12-21 19:52:11 +0100
commitef5d600013b862baa196ae68cd8453ab843f6e94 (patch)
treee8e0ce168c1f7e1da2bbb64e7cb3e0075744ceae /testsuite/gna/ticket98
parent39a34058f1de6c2c80b9f39fe36890f66a111f86 (diff)
downloadghdl-ef5d600013b862baa196ae68cd8453ab843f6e94.tar.gz
ghdl-ef5d600013b862baa196ae68cd8453ab843f6e94.tar.bz2
ghdl-ef5d600013b862baa196ae68cd8453ab843f6e94.zip
Add testcase for ticket98
Diffstat (limited to 'testsuite/gna/ticket98')
-rw-r--r--testsuite/gna/ticket98/junk1.vhd30
-rw-r--r--testsuite/gna/ticket98/junk1ok.vhd30
-rwxr-xr-xtestsuite/gna/ticket98/testsuite.sh11
3 files changed, 71 insertions, 0 deletions
diff --git a/testsuite/gna/ticket98/junk1.vhd b/testsuite/gna/ticket98/junk1.vhd
new file mode 100644
index 0000000..a42ad6d
--- /dev/null
+++ b/testsuite/gna/ticket98/junk1.vhd
@@ -0,0 +1,30 @@
+package pkg_FileIO is
+ -------------------------------
+ -- Define some basic data types
+ -------------------------------
+ subtype t_BYTE is integer range 0 to 2**8 - 1;
+
+ ---------------------------------------
+ -- And arrays of those basic data types
+ ---------------------------------------
+ type arr_t_BYTE is array(natural range <>) of t_BYTE;
+
+ ----------------------------
+ -- And a pointer to an array
+ ----------------------------
+ type ptr_arr_t_BYTE is access arr_t_BYTE;
+
+ procedure Read_File(File_Name: in STRING; Data: out ptr_arr_t_BYTE; Length: out integer);
+end pkg_FileIO;
+
+package body pkg_FileIO is
+ procedure Read_File(File_Name: in STRING; Data: out ptr_arr_t_BYTE; Length: out integer) is
+ begin
+ Data := new arr_t_BYTE(0 to 10);
+ for i in 0 to 10 loop
+ Data(i) := 0; -- Comment this line out and GHDL is happy
+ end loop;
+ Length := 11;
+ end Read_File;
+end pkg_FileIO;
+
diff --git a/testsuite/gna/ticket98/junk1ok.vhd b/testsuite/gna/ticket98/junk1ok.vhd
new file mode 100644
index 0000000..9c286cf
--- /dev/null
+++ b/testsuite/gna/ticket98/junk1ok.vhd
@@ -0,0 +1,30 @@
+package pkg_FileIO is
+ -------------------------------
+ -- Define some basic data types
+ -------------------------------
+ subtype t_BYTE is integer range 0 to 2**8 - 1;
+
+ ---------------------------------------
+ -- And arrays of those basic data types
+ ---------------------------------------
+ type arr_t_BYTE is array(natural range <>) of t_BYTE;
+
+ ----------------------------
+ -- And a pointer to an array
+ ----------------------------
+ type ptr_arr_t_BYTE is access arr_t_BYTE;
+
+ procedure Read_File(File_Name: in STRING; Data: inout ptr_arr_t_BYTE; Length: out integer);
+end pkg_FileIO;
+
+package body pkg_FileIO is
+ procedure Read_File(File_Name: in STRING; Data: inout ptr_arr_t_BYTE; Length: out integer) is
+ begin
+ Data := new arr_t_BYTE(0 to 10);
+ for i in 0 to 10 loop
+ Data(i) := 0; -- Comment this line out and GHDL is happy
+ end loop;
+ Length := 11;
+ end Read_File;
+end pkg_FileIO;
+
diff --git a/testsuite/gna/ticket98/testsuite.sh b/testsuite/gna/ticket98/testsuite.sh
new file mode 100755
index 0000000..1b5548d
--- /dev/null
+++ b/testsuite/gna/ticket98/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze_failure junk1.vhd
+analyze --std=08 junk1.vhd
+analyze junk1ok.vhd
+clean
+clean --std=08
+
+echo "Test successful"