Files
iverilog/ivtest/ivltests/enum_base_atom2.v
T
Lars-Peter Clausen 315bc1908a Add regression tests for enum base type
Check that the behavior for all sorts of base types for enums is correctly
implemented. Both for valid as well as invalid base types.

Signed-off-by: Lars-Peter Clausen <[email protected]>
2022-03-25 21:55:34 +01:00

32 lines
437 B
Verilog

// Check that it is possible to declare an enum type with an atom2 type as the
// base type.
module test;
enum byte {
A
} e1;
enum shortint {
B
} e2;
enum int {
C
} e3;
enum longint {
D
} e4;
initial begin
if ($bits(e1) == 8 && $bits(e2) == 16 &&
$bits(e3) == 32 && $bits(e4) == 64) begin
$display("PASSED");
end else begin
$display("FAILED");
end
end
endmodule