diff options
Diffstat (limited to 'testsuite/gna/issue2288/tb_minimal.vhdl')
-rw-r--r-- | testsuite/gna/issue2288/tb_minimal.vhdl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/testsuite/gna/issue2288/tb_minimal.vhdl b/testsuite/gna/issue2288/tb_minimal.vhdl new file mode 100644 index 000000000..e241c2560 --- /dev/null +++ b/testsuite/gna/issue2288/tb_minimal.vhdl @@ -0,0 +1,34 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity tb_minimal is +end tb_minimal; + +architecture rtl of tb_minimal is +begin + MAIN_PROC : process + + function fun return std_ulogic_vector is + variable v_return : std_ulogic_vector(0 to 3) := x"A"; + begin + return v_return; + end function fun; + + variable v_result : std_ulogic_vector(0 to 7); + variable v_some_data : std_ulogic_vector(0 to 3) := x"B"; + variable v_fun_result : std_ulogic_vector(0 to 3); + begin + + -- working: + -- v_fun_result := fun; + -- v_result := std_ulogic_vector'(v_some_data, v_fun_result); + + -- not working: + v_result := std_ulogic_vector'(v_some_data, fun); + + report "result= 0x" & to_hstring(v_result); + assert v_result = x"BA" severity failure; + wait; + end process; + +end architecture; |