From 1455a0839e4e8963f90d030d13433a68c3d5c180 Mon Sep 17 00:00:00 2001 From: Jukka Hertzog Date: Tue, 5 Nov 2024 14:46:02 +0000 Subject: [PATCH] Issue#1251: Updated test file to exercise corner case --- tests/function/rule_508_test_input.fixed.vhd | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/function/rule_508_test_input.fixed.vhd b/tests/function/rule_508_test_input.fixed.vhd index 0ffa3a44..23a110e2 100644 --- a/tests/function/rule_508_test_input.fixed.vhd +++ b/tests/function/rule_508_test_input.fixed.vhd @@ -114,6 +114,31 @@ architecture rtl of test is end function my_func; + function my_func return integer is + + constant con : integer := PARAM1; + variable var : integer := PARAM4; + + begin + + -- PARAM1 + sig <= PARAM1 + PARAM2; + var := PARAM1 + PARAM2; + sig <= PARAM1 when true else PARAM2; + var := PARAM1 when true else PARAM2; + with PARAM5 select PARAM4 := + PARAM1 when 1, + PARAM2 when 0, + PARAM3 when others; + with PARAM4 select PARAM5 <= + PARAM1 when 1, + PARAM2 when 0, + PARAM3 when others; + + return PARAM1; + + end function my_func; + begin end architecture rtl;