mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-09-03 06:03:11 +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]>
22 lines
341 B
Verilog
22 lines
341 B
Verilog
// Check that an error is reported for implicit cast to enum when assigning
|
|
// from a function call.
|
|
|
|
module test;
|
|
|
|
typedef enum reg [31:0] {
|
|
A, B
|
|
} E;
|
|
|
|
function integer f();
|
|
return B;
|
|
endfunction
|
|
|
|
E e;
|
|
|
|
initial begin
|
|
e = f(); // This should fail. Implicit cast to enum type.
|
|
$display("FAILED");
|
|
end
|
|
|
|
endmodule
|