Skip to content

Commit

Permalink
Verilog: KNOWNBUG test for new
Browse files Browse the repository at this point in the history
  • Loading branch information
kroening committed Oct 31, 2024
1 parent 6b0d346 commit 48c423e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions regression/verilog/class/new1.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
KNOWNBUG
new1.sv

^EXIT=0$
^SIGNAL=0$
--
--
The class is not yet recognized as a type.
6 changes: 6 additions & 0 deletions regression/verilog/class/new1.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class myClass;
endclass

module main;
myClass x = new;
endmodule
1 change: 1 addition & 0 deletions src/hw_cbmc_irep_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ IREP_ID_ONE(verilog_implicit_typecast)
IREP_ID_ONE(verilog_unique)
IREP_ID_ONE(verilog_unique0)
IREP_ID_ONE(verilog_priority)
IREP_ID_ONE(verilog_new)
IREP_ID_ONE(verilog_non_indexed_part_select)
IREP_ID_ONE(verilog_indexed_part_select_plus)
IREP_ID_ONE(verilog_indexed_part_select_minus)
Expand Down
16 changes: 16 additions & 0 deletions src/verilog/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,11 @@ enum_name_declaration_list:
class_scope: class_type TOK_COLONCOLON
;

class_scope_opt:
/* Optional */
| class_scope
;

integer_type:
integer_vector_type
| integer_atom_type
Expand Down Expand Up @@ -1863,6 +1868,12 @@ variable_decl_assignment:
{ $$ = $1; stack_expr($$).id(ID_declarator);
addswap($$, ID_type, $2);
addswap($$, ID_value, $4); }
| variable_identifier variable_dimension_brace '=' class_new
;

class_new:
TOK_NEW list_of_arguments_paren_opt
{ init($$, ID_verilog_new); mto($$, $2); }
;

// System Verilog standard 1800-2017
Expand Down Expand Up @@ -3639,6 +3650,11 @@ list_of_arguments_paren:
{ $$ = $2; }
;

list_of_arguments_paren_opt:
/* Optional */
| list_of_arguments_paren
;

list_of_arguments:
/* Optional */
{ init($$); }
Expand Down

0 comments on commit 48c423e

Please sign in to comment.