From ff0bf0a5e31478d657235914c7b6a7c26824e378 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 13 Sep 2025 10:45:05 -0400 Subject: [PATCH] Tests: Add testcase (#4998) --- test_regress/t/t_assoc_ref_type.v | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test_regress/t/t_assoc_ref_type.v b/test_regress/t/t_assoc_ref_type.v index 3544ce76e..173daf87f 100644 --- a/test_regress/t/t_assoc_ref_type.v +++ b/test_regress/t/t_assoc_ref_type.v @@ -50,15 +50,26 @@ class Wrapper#(type VAL_T=int); VAL_T value; endclass +class Bum; + typedef int map_t[string]; + map_t m_value; + function new(map_t value); + m_value = value; + endfunction +endclass + module t; typedef WBase wrap_map_t[string]; typedef WBase wrap_queue_t[$]; + localparam string str_key = "the_key"; + initial begin Bar bar_i = new; Baz baz_1_i = new; Baz #(Foo2) baz_2_i = new; + Bum bum_i; Wrapper#(wrap_map_t) wrap_map = new(); Wrapper#(wrap_queue_t) wrap_queue = new(); @@ -71,6 +82,9 @@ module t; if (baz_1_i.get(2).get_x() != 1) $stop; if (baz_2_i.get(3).get_x() != 2) $stop; + bum_i = new('{str_key: 42}); + if (bum_i.m_value["the_key"] != 42) $stop; + $write("*-* All Finished *-*\n"); $finish; end