verilator/test_regress/t/t_static_in_loop_unsup.v
Ryszard Rozak ed1a9309d4
Throw warning if static variable is declared in a loop (#4018)
Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
2023-03-14 10:03:08 +01:00

27 lines
583 B
Systemverilog

// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed under the Creative Commons Public Domain, for
// any use, without warranty, 2023 by Antmicro Ltd.
// SPDX-License-Identifier: CC0-1.0
module t;
initial begin
int x = 0;
while (x < 10) begin : outer_loop
int y = 0;
while (y < x) begin : inner_loop
static int a = 0;
a++;
y++;
end
x++;
end
if (outer_loop.inner_loop.a != 45) $stop;
$write("*-* All Finished *-*\n");
$finish;
end
endmodule