aboutsummaryrefslogtreecommitdiffstats
path: root/tests/verilog
diff options
context:
space:
mode:
authorKamil Rakoczy <krakoczy@antmicro.com>2021-02-04 12:12:59 +0100
committerKamil Rakoczy <krakoczy@antmicro.com>2021-02-04 17:16:30 +0100
commit98c4feb72ff52f12aadd34b0deccb819d701ff2c (patch)
treea1d186a2cf2830f84711ce4d097154f30313310b /tests/verilog
parentbaf1875307f1608762169d3037ba005da88b201e (diff)
downloadyosys-98c4feb72ff52f12aadd34b0deccb819d701ff2c.tar.gz
yosys-98c4feb72ff52f12aadd34b0deccb819d701ff2c.tar.bz2
yosys-98c4feb72ff52f12aadd34b0deccb819d701ff2c.zip
Add check of begin/end labels for genblock
Signed-off-by: Kamil Rakoczy <krakoczy@antmicro.com>
Diffstat (limited to 'tests/verilog')
-rw-r--r--tests/verilog/block_labels.ys26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/verilog/block_labels.ys b/tests/verilog/block_labels.ys
new file mode 100644
index 000000000..e76bcf771
--- /dev/null
+++ b/tests/verilog/block_labels.ys
@@ -0,0 +1,26 @@
+read_verilog <<EOT
+module foo;
+
+ genvar a = 0;
+ for (a = 0; a < 10; a++) begin : a
+ end : a
+endmodule
+EOT
+read_verilog <<EOT
+module foo2;
+
+ genvar a = 0;
+ for (a = 0; a < 10; a++) begin : a
+ end
+endmodule
+EOT
+
+logger -expect error "Begin label \(a\) and end label \(b\) don't match\." 1
+read_verilog <<EOT
+module foo3;
+
+ genvar a = 0;
+ for (a = 0; a < 10; a++) begin : a
+ end : b
+endmodule
+EOT