Added unittest for unsupported arguments

This commit is contained in:
Tobias Rosenkranz 2020-01-27 22:29:53 +01:00
parent 37151820c4
commit 2207217df3
3 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,5 @@
%Error: Internal Error: t/t_enum_type_methods_bad.v:24: ../V3Width.cpp:#: Unsupported: enum next/prev with non-const argument
: ... In instance t
e.next(increment);
^~~~
... See the manual and https://verilator.org for more assistance.

View File

@ -0,0 +1,18 @@
#!/usr/bin/perl
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
#
# Copyright 2003 by Wilson Snyder. This program is free software; you can
# redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License
# Version 2.0.
scenarios(simulator => 1);
compile(
fails => 1,
expect_filename => $Self->{golden_filename}
);
ok(1);
1;

View File

@ -0,0 +1,28 @@
// DESCRIPTION: Verilator: Verilog Test module
//
// This file ONLY is placed into the Public Domain, for any use,
// without warranty, 2014 by Wilson Snyder.
module t (/*AUTOARG*/
// Inputs
clk,
increment
);
input clk;
input [1:0] increment;
typedef enum [3:0] {
E01 = 1,
E03 = 3,
E04 = 4,
E05 = 5
} my_t;
my_t e;
always @ (posedge clk) begin
e.next(increment);
$finish;
end
endmodule