diff --git a/test_regress/t/t_inside_unbounded.v b/test_regress/t/t_inside_unbounded.v index 788b489b8..d7a5bfdd2 100644 --- a/test_regress/t/t_inside_unbounded.v +++ b/test_regress/t/t_inside_unbounded.v @@ -4,59 +4,59 @@ // any use, without warranty, 2026. // SPDX-License-Identifier: CC0-1.0 -module t_inside_unbounded; +module t; initial begin int value; // Test [$:100] - should match minimum to 100 value = 50; - if (!(value inside {[$:100]})) $stop; + if (!(value inside {[$ : 100]})) $stop; value = 100; - if (!(value inside {[$:100]})) $stop; + if (!(value inside {[$ : 100]})) $stop; value = 101; - if (value inside {[$:100]}) $stop; // Should NOT match + if (value inside {[$ : 100]}) $stop; // Should NOT match // Test [0:$] - should match 0 to maximum value = 50; - if (!(value inside {[0:$]})) $stop; + if (!(value inside {[0 : $]})) $stop; value = 0; - if (!(value inside {[0:$]})) $stop; + if (!(value inside {[0 : $]})) $stop; // Test [100:$] - should match 100 to maximum value = 100; - if (!(value inside {[100:$]})) $stop; + if (!(value inside {[100 : $]})) $stop; value = 200; - if (!(value inside {[100:$]})) $stop; + if (!(value inside {[100 : $]})) $stop; value = 50; - if (value inside {[100:$]}) $stop; // Should NOT match + if (value inside {[100 : $]}) $stop; // Should NOT match // Test mixed with other ranges value = 5; - if (!(value inside {[$:10], [90:$]})) $stop; + if (!(value inside {[$ : 10], [90 : $]})) $stop; value = 95; - if (!(value inside {[$:10], [90:$]})) $stop; + if (!(value inside {[$ : 10], [90 : $]})) $stop; value = 50; - if (value inside {[$:10], [90:$]}) $stop; // Should NOT match + if (value inside {[$ : 10], [90 : $]}) $stop; // Should NOT match // Test with function - if (!(get_value(50) inside {[$:100]})) $stop; - if (!(get_value(50) inside {[0:$]})) $stop; - if (get_value(50) inside {[100:$]}) $stop; // Should NOT match + if (!(get_value(50) inside {[$ : 100]})) $stop; + if (!(get_value(50) inside {[0 : $]})) $stop; + if (get_value(50) inside {[100 : $]}) $stop; // Should NOT match // Test with increment value = 49; - if (!(++value inside {[$:100]})) $stop; // value becomes 50 + if (!(++value inside {[$ : 100]})) $stop; // value becomes 50 if (value != 50) $stop; value = -1; - if (!(++value inside {[0:$]})) $stop; // value becomes 0 + if (!(++value inside {[0 : $]})) $stop; // value becomes 0 if (value != 0) $stop; $write("*-* All Finished *-*\n"); diff --git a/test_regress/t/t_inside_unbounded_bad.v b/test_regress/t/t_inside_unbounded_bad.v deleted file mode 100644 index 47d9cef70..000000000 --- a/test_regress/t/t_inside_unbounded_bad.v +++ /dev/null @@ -1,15 +0,0 @@ -// DESCRIPTION: Verilator: Test for unsupported [$:$] in inside range -// -// This file ONLY is placed under the Creative Commons Public Domain, for -// any use, without warranty, 2026. -// SPDX-License-Identifier: CC0-1.0 - -module t_inside_unbounded_bad; - initial begin - int value; - value = 50; - // [$:$] should warn - always true - if (value inside {[$:$]}) $display("PASS"); - $finish; - end -endmodule diff --git a/test_regress/t/t_inside_unbounded_nowarn.py b/test_regress/t/t_inside_unbounded_both.py similarity index 100% rename from test_regress/t/t_inside_unbounded_nowarn.py rename to test_regress/t/t_inside_unbounded_both.py diff --git a/test_regress/t/t_inside_unbounded_nowarn.v b/test_regress/t/t_inside_unbounded_both.v similarity index 84% rename from test_regress/t/t_inside_unbounded_nowarn.v rename to test_regress/t/t_inside_unbounded_both.v index 8e871b670..0ea59406c 100644 --- a/test_regress/t/t_inside_unbounded_nowarn.v +++ b/test_regress/t/t_inside_unbounded_both.v @@ -4,12 +4,12 @@ // any use, without warranty, 2026. // SPDX-License-Identifier: CC0-1.0 -module t_inside_unbounded_nowarn; +module t; initial begin int value; value = 50; // [$:$] is always true - warning suppressed with -Wno-INSIDETRUE - if (!(value inside {[$:$]})) $stop; + if (!(value inside {[$ : $]})) $stop; $write("*-* All Finished *-*\n"); $finish; end diff --git a/test_regress/t/t_inside_unbounded_bad.out b/test_regress/t/t_inside_unbounded_both_bad.out similarity index 54% rename from test_regress/t/t_inside_unbounded_bad.out rename to test_regress/t/t_inside_unbounded_both_bad.out index c4968085c..17e45e396 100644 --- a/test_regress/t/t_inside_unbounded_bad.out +++ b/test_regress/t/t_inside_unbounded_both_bad.out @@ -1,6 +1,6 @@ -%Warning-INSIDETRUE: t/t_inside_unbounded_bad.v:12:23: Unbounded on both sides of inside range [$:$] is always true - 12 | if (value inside {[$:$]}) $display("PASS"); - | ^ +%Warning-INSIDETRUE: t/t_inside_unbounded_both.v:12:25: Unbounded on both sides of inside range [$:$] is always true + 12 | if (!(value inside {[$ : $]})) $stop; + | ^ ... For warning description see https://verilator.org/warn/INSIDETRUE?v=latest ... Use "/* verilator lint_off INSIDETRUE */" and lint_on around source to disable this message. %Error: Exiting due to diff --git a/test_regress/t/t_inside_unbounded_bad.py b/test_regress/t/t_inside_unbounded_both_bad.py similarity index 90% rename from test_regress/t/t_inside_unbounded_bad.py rename to test_regress/t/t_inside_unbounded_both_bad.py index e842d48f7..19f054ae4 100755 --- a/test_regress/t/t_inside_unbounded_bad.py +++ b/test_regress/t/t_inside_unbounded_both_bad.py @@ -10,6 +10,7 @@ import vltest_bootstrap test.scenarios('vlt') +test.top_filename = 't/t_inside_unbounded_both.v' test.lint(fails=True, expect_filename=test.golden_filename)