summaryrefslogtreecommitdiff
path: root/testsuite/gna/bug21497
diff options
context:
space:
mode:
authorTristan Gingold2014-01-17 02:57:06 +0100
committerTristan Gingold2014-01-17 02:57:06 +0100
commit6a7003f0c7f1afcb1198fdc18e0db0afbff7ac87 (patch)
tree06fc4ab4336f70e0bac0e2d9397d1d89a195a760 /testsuite/gna/bug21497
parent6dd41d6791e97118165c8e4af6f178188ab2bb45 (diff)
downloadghdl-6a7003f0c7f1afcb1198fdc18e0db0afbff7ac87.tar.gz
ghdl-6a7003f0c7f1afcb1198fdc18e0db0afbff7ac87.tar.bz2
ghdl-6a7003f0c7f1afcb1198fdc18e0db0afbff7ac87.zip
Fix bug21497: do not create an indirection for access to complex type.
Add a type check in mcode for New_Address.
Diffstat (limited to 'testsuite/gna/bug21497')
-rwxr-xr-xtestsuite/gna/bug21497/repro.vhdl19
-rwxr-xr-xtestsuite/gna/bug21497/testsuite.sh11
2 files changed, 30 insertions, 0 deletions
diff --git a/testsuite/gna/bug21497/repro.vhdl b/testsuite/gna/bug21497/repro.vhdl
new file mode 100755
index 0000000..fe6e1c3
--- /dev/null
+++ b/testsuite/gna/bug21497/repro.vhdl
@@ -0,0 +1,19 @@
+entity tb is
+ generic (low : integer := 1 ; high : integer := 10);
+end;
+
+architecture behav of tb is
+begin
+ process
+ type st_arr1 is array (low to high) of integer;
+
+ type st_arr2 is array (low to high) of st_arr1;
+ constant c_st_arr2 : st_arr2 := (others => (others => 1));
+
+ type a_st_arr2 is access st_arr2;
+ variable v_st_arr2 : a_st_arr2 := new st_arr2'(c_st_arr2) ;
+ begin
+ assert v_st_arr2.all = c_st_arr2 severity failure;
+ wait;
+ end process ;
+end behav;
diff --git a/testsuite/gna/bug21497/testsuite.sh b/testsuite/gna/bug21497/testsuite.sh
new file mode 100755
index 0000000..5322424
--- /dev/null
+++ b/testsuite/gna/bug21497/testsuite.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+
+analyze repro.vhdl
+elab_simulate tb
+
+clean
+
+echo "Test successful"