mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 00:19:42 +02:00
Add additional enum compatibility tests that check for compatibility in different contexts. * Array element * Function return value * Function and task argument * struct member * class property Signed-off-by: Lars-Peter Clausen <[email protected]>
20 lines
329 B
Verilog
20 lines
329 B
Verilog
// Check that an error is reported for implicit cast to enum when assigning
|
|
// from an array element.
|
|
|
|
module test;
|
|
|
|
typedef enum reg [31:0] {
|
|
A, B
|
|
} E;
|
|
|
|
E e;
|
|
int ea[2];
|
|
|
|
initial begin
|
|
ea[0] = B; // This is OK.
|
|
e = ea[0]; // This should fail. Implicit cast to enum.
|
|
$display("FAILED");
|
|
end
|
|
|
|
endmodule
|