Add a regression test to check enum elaboration order
Test that enums are elaborated in declaration order and a enum declaration can reference a item of an enum that was declared before it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
e75ad281fc
commit
67b29ab5d4
|
|
@ -0,0 +1,25 @@
|
|||
// Verify that enums can reference items from enums declared before them
|
||||
|
||||
module test;
|
||||
|
||||
enum logic {
|
||||
A = 1
|
||||
} a;
|
||||
|
||||
enum logic {
|
||||
B = A
|
||||
} b;
|
||||
|
||||
enum logic {
|
||||
C = B
|
||||
} c;
|
||||
|
||||
initial begin
|
||||
if (A == B && A == C) begin
|
||||
$display("PASSED");
|
||||
end else begin
|
||||
$display("FAILED");
|
||||
end
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
|
@ -237,6 +237,7 @@ enum_in_struct normal,-g2005-sv ivltests
|
|||
enum_in_class normal,-g2005-sv ivltests
|
||||
enum_in_class_name_coll CE,-g2005-sv ivltests
|
||||
enum_next normal,-g2005-sv ivltests
|
||||
enum_order normal,-g2005-sv ivltests
|
||||
enum_ports normal,-g2005-sv ivltests
|
||||
enum_test1 normal,-g2005-sv ivltests
|
||||
enum_test2 normal,-g2005-sv ivltests
|
||||
|
|
|
|||
Loading…
Reference in New Issue