mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-04 08:34:09 +02:00
By adding ivtest to the iverilog source tree, it is easier to keep the regression test synchronized with the source that is being tested. This should be especially helpful for PRs that add a new feature, and have a matching ivtest PR with the regression test for that feature.
51 lines
494 B
Verilog
51 lines
494 B
Verilog
// Check that all sorts of enum dimension declarations are handled correctly and
|
|
// do not cause an assert or segfault.
|
|
|
|
module test;
|
|
|
|
// These are invalid
|
|
|
|
enum logic [$] {
|
|
A
|
|
} a;
|
|
|
|
enum logic [] {
|
|
B
|
|
} b;
|
|
|
|
enum logic [-1] {
|
|
C
|
|
} c;
|
|
|
|
enum logic [0] {
|
|
D
|
|
} d;
|
|
|
|
enum logic [1:0][3:0] {
|
|
E
|
|
} e;
|
|
|
|
// These are valid
|
|
|
|
enum logic [0:2] {
|
|
F
|
|
} f;
|
|
|
|
enum logic [2:0] {
|
|
G
|
|
} g;
|
|
|
|
enum logic [-1:-2] {
|
|
H
|
|
} h;
|
|
|
|
// These are valid as an extension in iverilog
|
|
|
|
enum logic [16] {
|
|
I
|
|
} i;
|
|
|
|
int x;
|
|
|
|
endmodule
|