const2ast: add diagnostics tests

This commit is contained in:
Emil J. Tywoniak
2025-06-16 21:48:12 +02:00
parent 41107e5473
commit 49cd3887a7
4 changed files with 17 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
read_verilog <<EOT
module test (y);
output signed [2:0] y = 1'b1;
endmodule
EOT
dump
+3
View File
@@ -0,0 +1,3 @@
module test (y);
output signed [2:0] y = 1'bf;
endmodule
+2
View File
@@ -0,0 +1,2 @@
logger -expect prefix-error "./constparser_f_file.sv:2: ERROR: Digit larger than 1 used in in base-2 constant." 1
read_verilog -sv ./constparser_f_file.sv
+6
View File
@@ -0,0 +1,6 @@
logger -expect prefix-error "<<EOT:2: ERROR: syntax error, unexpected invalid token, expecting TOK_BASED_CONSTVAL" 1
read_verilog <<EOT
module test (y);
output signed [2:0] y = 1'bg;
endmodule
EOT