diff --git a/ivtest/gold/enum_line_info.gold b/ivtest/gold/enum_line_info.gold new file mode 100644 index 000000000..55c71d642 --- /dev/null +++ b/ivtest/gold/enum_line_info.gold @@ -0,0 +1,5 @@ +./ivltests/enum_line_info.v:7: error: Enumeration name B and A have the same value: 1'd0 +./ivltests/enum_line_info.v:12: error: Enumeration name D and C have the same value: 1'd0 +./ivltests/enum_line_info.v:17: error: Enumeration name F and E have the same value: 1'd0 +./ivltests/enum_line_info.v:22: error: Enumeration name H and G have the same value: 1'd0 +5 error(s) during elaboration. diff --git a/ivtest/gold/struct_line_info.gold b/ivtest/gold/struct_line_info.gold new file mode 100644 index 000000000..81ea6baff --- /dev/null +++ b/ivtest/gold/struct_line_info.gold @@ -0,0 +1,4 @@ +./ivltests/struct_line_info.v:7: error: Member r of packed struct/union must be packed. +./ivltests/struct_line_info.v:12: error: Member r of packed struct/union must be packed. +./ivltests/struct_line_info.v:17: error: Member r of packed struct/union must be packed. +3 error(s) during elaboration. diff --git a/ivtest/ivltests/enum_line_info.v b/ivtest/ivltests/enum_line_info.v new file mode 100644 index 000000000..db19ae741 --- /dev/null +++ b/ivtest/ivltests/enum_line_info.v @@ -0,0 +1,32 @@ +// Checks that the line and file information is correctly attached to a enum +// data type and will be used when printing an error message about the enum. + +module test; + +// Direct +enum logic { + A, B = A +} e1; + +// Used in a struct +typedef enum logic { + C, D = C +} enum1_type; + +// Used as a signal type +typedef enum logic { + E, F = E +} enum2_type; + +// Unreferenced +typedef enum logic { + G, H = G +} enum3_type; + +struct packed { + enum1_type e; +} s; + +enum2_type e2; + +endmodule diff --git a/ivtest/ivltests/struct_line_info.v b/ivtest/ivltests/struct_line_info.v new file mode 100644 index 000000000..b3ce55a0e --- /dev/null +++ b/ivtest/ivltests/struct_line_info.v @@ -0,0 +1,24 @@ +// Checks that the line and file information is correctly attached to a struct +// data type and will be used when printing an error message about the struct. + +module test; + +// Direct +struct packed { + real r; +} s1; + +// Used in a struct +typedef struct packed { + real r; +} struct1_type; + +// Used as a signal type +typedef struct packed { + struct1_type s; + real r; +} struct2_type; + +struct2_type s2; + +endmodule diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index b5d223bca..b65e12961 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -236,6 +236,7 @@ enum_dims_invalid CE,-g2005-sv ivltests enum_in_struct normal,-g2005-sv ivltests enum_in_class normal,-g2005-sv ivltests enum_in_class_name_coll CE,-g2005-sv ivltests +enum_line_info CE,-g2005-sv ivltests gold=enum_line_info.gold enum_next normal,-g2005-sv ivltests enum_order normal,-g2005-sv ivltests enum_ports normal,-g2005-sv ivltests @@ -381,6 +382,7 @@ struct6 normal,-g2009 ivltests struct7 normal,-g2009 ivltests struct8 normal,-g2009 ivltests struct9 normal,-g2009 ivltests +struct_line_info CE,-g2009 ivltests gold=struct_line_info.gold struct_packed_array normal,-g2009 ivltests struct_packed_array2 normal,-g2009 ivltests struct_packed_sysfunct normal,-g2009 ivltests