aboutsummaryrefslogtreecommitdiffstats
path: root/tests/verilog/always_comb_latch_4.ys
diff options
context:
space:
mode:
Diffstat (limited to 'tests/verilog/always_comb_latch_4.ys')
-rw-r--r--tests/verilog/always_comb_latch_4.ys17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/verilog/always_comb_latch_4.ys b/tests/verilog/always_comb_latch_4.ys
new file mode 100644
index 000000000..46b78801b
--- /dev/null
+++ b/tests/verilog/always_comb_latch_4.ys
@@ -0,0 +1,17 @@
+read_verilog -sv <<EOF
+module top;
+parameter AVOID_LATCH = 0;
+logic x, z;
+assign z = 1'b1;
+always_comb begin
+ logic y;
+ if (z)
+ y = 0;
+ for (int i = 1; i == AVOID_LATCH; i++)
+ y = 1;
+ x = z ? y : 1'b0;
+end
+endmodule
+EOF
+logger -expect error "^Latch inferred for signal `\\top\.\$unnamed_block\$3\.y' from always_comb process" 1
+proc