From 6a7003f0c7f1afcb1198fdc18e0db0afbff7ac87 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Fri, 17 Jan 2014 02:57:06 +0100 Subject: Fix bug21497: do not create an indirection for access to complex type. Add a type check in mcode for New_Address. --- testsuite/gna/bug21497/repro.vhdl | 19 +++++++++++++++++++ testsuite/gna/bug21497/testsuite.sh | 11 +++++++++++ 2 files changed, 30 insertions(+) create mode 100755 testsuite/gna/bug21497/repro.vhdl create mode 100755 testsuite/gna/bug21497/testsuite.sh (limited to 'testsuite/gna') diff --git a/testsuite/gna/bug21497/repro.vhdl b/testsuite/gna/bug21497/repro.vhdl new file mode 100755 index 000000000..fe6e1c323 --- /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 000000000..532242432 --- /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" -- cgit v1.2.3