aboutsummaryrefslogtreecommitdiffstats
path: root/tests/various
diff options
context:
space:
mode:
authorMiodrag Milanović <mmicko@gmail.com>2020-03-14 13:34:59 +0200
committerGitHub <noreply@github.com>2020-03-14 13:34:59 +0200
commit569e834df2244f214cda8f34daa87ed417089ca1 (patch)
tree2dea3ee1e1a072d162b90bc86c1c678ff809d66a /tests/various
parentfaf4ee69de8dc6245f5fcf1ca7bd28f45b827c29 (diff)
parentdd562f29e7ea248a64fce50e61998d0c0f73fe7e (diff)
downloadyosys-569e834df2244f214cda8f34daa87ed417089ca1.tar.gz
yosys-569e834df2244f214cda8f34daa87ed417089ca1.tar.bz2
yosys-569e834df2244f214cda8f34daa87ed417089ca1.zip
Merge pull request #1759 from zeldin/constant_with_comment_redux
refixed parsing of constant with comment between size and value
Diffstat (limited to 'tests/various')
-rw-r--r--tests/various/bug1745.ys8
-rw-r--r--tests/various/constcomment.ys16
2 files changed, 24 insertions, 0 deletions
diff --git a/tests/various/bug1745.ys b/tests/various/bug1745.ys
new file mode 100644
index 000000000..2e5b8c2d4
--- /dev/null
+++ b/tests/various/bug1745.ys
@@ -0,0 +1,8 @@
+logger -expect error "syntax error, unexpected TOK_CONSTVAL" 1
+read_verilog <<EOT
+module inverter(input a, output y);
+
+ assign y = (a == 1'b0? 1'b1 : 1'b0);
+
+endmodule // inverter
+EOT
diff --git a/tests/various/constcomment.ys b/tests/various/constcomment.ys
new file mode 100644
index 000000000..f4f2e75d8
--- /dev/null
+++ b/tests/various/constcomment.ys
@@ -0,0 +1,16 @@
+read_verilog <<EOT
+module top1;
+ localparam a = 8 /*foo*/ 'h ab;
+ localparam b = 8 'h /*foo*/ cd;
+ generate
+ if (a != 8'b10101011) $error("a incorrect!");
+ if (b != 8'b11001101) $error("b incorrect!");
+ endgenerate
+endmodule
+EOT
+logger -expect error "syntax error, unexpected TOK_BASE" 1
+read_verilog <<EOT
+module top2;
+ localparam a = 12'h4 /*foo*/'b0;
+endmodule
+EOT