diff --git a/lib/ieee.08/Makemodule.am b/lib/ieee.08/Makemodule.am index 8dc6c4473..624cd8b88 100644 --- a/lib/ieee.08/Makemodule.am +++ b/lib/ieee.08/Makemodule.am @@ -133,8 +133,5 @@ gen-deps-ieee-08: include lib/ieee.08/deps.mk -# Empty package does not depend on STD.STANDARD -lib/nvc.08/NVC.POLYFILL: lib/std.08/STD.STANDARD - # Code generation dependency for predefined operators lib/ieee.08/IEEE.STD_LOGIC_1164-body: lib/nvc.08/NVC.IEEE_SUPPORT diff --git a/lib/ieee.08/deps.mk b/lib/ieee.08/deps.mk index 01479d1b8..68761b98f 100644 --- a/lib/ieee.08/deps.mk +++ b/lib/ieee.08/deps.mk @@ -1,4 +1,4 @@ -# Generated by nvc 1.10-devel +# Generated by nvc 1.11-devel lib/ieee.08/IEEE.FIXED_FLOAT_TYPES: lib/std.08/STD.STANDARD $(top_srcdir)/lib/ieee.08/fixed_float_types.vhdl @@ -64,9 +64,9 @@ lib/ieee.08/IEEE.STD_LOGIC_UNSIGNED-body: lib/std.08/STD.STANDARD lib/ieee.08/IE lib/ieee.08/IEEE.STD_LOGIC_UNSIGNED: lib/std.08/STD.STANDARD lib/ieee.08/IEEE.STD_LOGIC_ARITH lib/ieee.08/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/synopsys/std_logic_unsigned.vhd -lib/ieee.08/IEEE.VITAL_MEMORY-body: lib/std.08/STD.TEXTIO lib/std.08/STD.STANDARD lib/ieee.08/IEEE.VITAL_TIMING lib/ieee.08/IEEE.VITAL_MEMORY lib/ieee.08/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/vital/memory_b.vhdl +lib/ieee.08/IEEE.VITAL_MEMORY-body: lib/std.08/STD.TEXTIO lib/std.08/STD.STANDARD lib/ieee.08/IEEE.VITAL_TIMING lib/ieee.08/IEEE.VITAL_PRIMITIVES lib/ieee.08/IEEE.VITAL_MEMORY lib/ieee.08/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/vital/memory_b.vhdl -lib/ieee.08/IEEE.VITAL_MEMORY: lib/std.08/STD.STANDARD lib/ieee.08/IEEE.VITAL_TIMING lib/ieee.08/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/vital/memory_p.vhdl +lib/ieee.08/IEEE.VITAL_MEMORY: lib/std.08/STD.TEXTIO lib/std.08/STD.STANDARD lib/ieee.08/IEEE.VITAL_TIMING lib/ieee.08/IEEE.VITAL_PRIMITIVES lib/ieee.08/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/vital/memory_p.vhdl lib/ieee.08/IEEE.VITAL_PRIMITIVES-body: lib/std.08/STD.TEXTIO lib/std.08/STD.STANDARD lib/ieee.08/IEEE.VITAL_TIMING lib/ieee.08/IEEE.VITAL_PRIMITIVES lib/ieee.08/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/vital/prmtvs_b.vhdl diff --git a/lib/ieee.19/Makemodule.am b/lib/ieee.19/Makemodule.am index eeb769cf4..b8bbc1c59 100644 --- a/lib/ieee.19/Makemodule.am +++ b/lib/ieee.19/Makemodule.am @@ -111,8 +111,5 @@ gen-deps-ieee-19: include lib/ieee.19/deps.mk -# Empty package does not depend on STD.STANDARD -lib/nvc.19/NVC.POLYFILL: lib/std.19/STD.STANDARD - # Code generation dependency for predefined operators lib/ieee.19/IEEE.STD_LOGIC_1164-body: lib/nvc.19/NVC.IEEE_SUPPORT diff --git a/lib/ieee/deps.mk b/lib/ieee/deps.mk index 79fcff33f..8e7db1510 100644 --- a/lib/ieee/deps.mk +++ b/lib/ieee/deps.mk @@ -1,4 +1,4 @@ -# Generated by nvc 1.10-devel +# Generated by nvc 1.11-devel lib/ieee/IEEE.MATH_COMPLEX-body: lib/std/STD.STANDARD lib/ieee/IEEE.MATH_REAL lib/ieee/IEEE.MATH_COMPLEX $(top_srcdir)/lib/ieee/math_complex-body.vhdl @@ -40,9 +40,9 @@ lib/ieee/IEEE.STD_LOGIC_UNSIGNED-body: lib/std/STD.STANDARD lib/ieee/IEEE.STD_LO lib/ieee/IEEE.STD_LOGIC_UNSIGNED: lib/std/STD.STANDARD lib/ieee/IEEE.STD_LOGIC_ARITH lib/ieee/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/synopsys/std_logic_unsigned.vhd -lib/ieee/IEEE.VITAL_MEMORY-body: lib/std/STD.TEXTIO lib/std/STD.STANDARD lib/ieee/IEEE.VITAL_TIMING lib/ieee/IEEE.VITAL_MEMORY lib/ieee/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/vital/memory_b.vhdl +lib/ieee/IEEE.VITAL_MEMORY-body: lib/std/STD.TEXTIO lib/std/STD.STANDARD lib/ieee/IEEE.VITAL_TIMING lib/ieee/IEEE.VITAL_PRIMITIVES lib/ieee/IEEE.VITAL_MEMORY lib/ieee/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/vital/memory_b.vhdl -lib/ieee/IEEE.VITAL_MEMORY: lib/std/STD.STANDARD lib/ieee/IEEE.VITAL_TIMING lib/ieee/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/vital/memory_p.vhdl +lib/ieee/IEEE.VITAL_MEMORY: lib/std/STD.TEXTIO lib/std/STD.STANDARD lib/ieee/IEEE.VITAL_TIMING lib/ieee/IEEE.VITAL_PRIMITIVES lib/ieee/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/vital/memory_p.vhdl lib/ieee/IEEE.VITAL_PRIMITIVES-body: lib/std/STD.TEXTIO lib/std/STD.STANDARD lib/ieee/IEEE.VITAL_TIMING lib/ieee/IEEE.VITAL_PRIMITIVES lib/ieee/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/vital/prmtvs_b.vhdl diff --git a/lib/nvc.08/deps.mk b/lib/nvc.08/deps.mk index 753049fdd..eeb490cdb 100644 --- a/lib/nvc.08/deps.mk +++ b/lib/nvc.08/deps.mk @@ -2,9 +2,9 @@ lib/nvc.08/NVC.IEEE_SUPPORT-body: lib/std.08/STD.STANDARD lib/nvc.08/NVC.IEEE_SUPPORT lib/ieee.08/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/nvc.08/ieee_support-body.vhd -lib/nvc.08/NVC.IEEE_SUPPORT: lib/ieee.08/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/nvc.08/ieee_support.vhd +lib/nvc.08/NVC.IEEE_SUPPORT: lib/std.08/STD.STANDARD lib/ieee.08/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/nvc.08/ieee_support.vhd -lib/nvc.08/NVC.POLYFILL: $(top_srcdir)/lib/nvc.08/polyfill.vhd +lib/nvc.08/NVC.POLYFILL: lib/std.08/STD.STANDARD $(top_srcdir)/lib/nvc.08/polyfill.vhd lib/nvc.08/NVC.PSL_SUPPORT-body: lib/std.08/STD.STANDARD lib/nvc.08/NVC.PSL_SUPPORT lib/ieee.08/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/nvc/psl_support-body.vhd diff --git a/lib/nvc.19/deps.mk b/lib/nvc.19/deps.mk index 04b2cab87..40727d1fc 100644 --- a/lib/nvc.19/deps.mk +++ b/lib/nvc.19/deps.mk @@ -2,9 +2,9 @@ lib/nvc.19/NVC.IEEE_SUPPORT-body: lib/std.19/STD.STANDARD lib/nvc.19/NVC.IEEE_SUPPORT lib/ieee.19/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/nvc.08/ieee_support-body.vhd -lib/nvc.19/NVC.IEEE_SUPPORT: lib/ieee.19/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/nvc.08/ieee_support.vhd +lib/nvc.19/NVC.IEEE_SUPPORT: lib/std.19/STD.STANDARD lib/ieee.19/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/nvc.08/ieee_support.vhd -lib/nvc.19/NVC.POLYFILL: $(top_srcdir)/lib/nvc.08/polyfill.vhd +lib/nvc.19/NVC.POLYFILL: lib/std.19/STD.STANDARD $(top_srcdir)/lib/nvc.08/polyfill.vhd lib/nvc.19/NVC.PSL_SUPPORT-body: lib/std.19/STD.STANDARD lib/nvc.19/NVC.PSL_SUPPORT lib/ieee.19/IEEE.STD_LOGIC_1164 $(top_srcdir)/lib/nvc/psl_support-body.vhd diff --git a/lib/std.08/deps.mk b/lib/std.08/deps.mk index 90f0c83a3..5dfa6e142 100644 --- a/lib/std.08/deps.mk +++ b/lib/std.08/deps.mk @@ -1,4 +1,4 @@ -# Generated by nvc 1.10-devel +# Generated by nvc 1.11-devel lib/std.08/STD.ENV-body: lib/std.08/STD.STANDARD lib/std.08/STD.ENV $(top_srcdir)/lib/std.08/env-body.vhd @@ -8,5 +8,5 @@ lib/std.08/STD.STANDARD: $(top_srcdir)/lib/std.08/standard.vhd lib/std.08/STD.TEXTIO: lib/std.08/STD.STANDARD $(top_srcdir)/lib/std.08/textio.vhd -lib/std.08/STD.TEXTIO-body: lib/std.08/STD.TEXTIO lib/std.08/STD.STANDARD $(top_srcdir)/lib/std/textio-body.vhd +lib/std.08/STD.TEXTIO-body: lib/std.08/STD.TEXTIO lib/std.08/STD.STANDARD lib/nvc.08/NVC.POLYFILL $(top_srcdir)/lib/std/textio-body.vhd diff --git a/lib/std.19/deps.mk b/lib/std.19/deps.mk index dd6126756..8936de1a9 100644 --- a/lib/std.19/deps.mk +++ b/lib/std.19/deps.mk @@ -12,5 +12,5 @@ lib/std.19/STD.STANDARD: $(top_srcdir)/lib/std.19/standard.vhd lib/std.19/STD.TEXTIO: lib/std.19/STD.STANDARD $(top_srcdir)/lib/std.19/textio.vhdl -lib/std.19/STD.TEXTIO-body: lib/std.19/STD.TEXTIO lib/std.19/STD.STANDARD lib/std.19/STD.ENV $(top_srcdir)/lib/std/textio-body.vhd +lib/std.19/STD.TEXTIO-body: lib/std.19/STD.TEXTIO lib/std.19/STD.STANDARD lib/std.19/STD.ENV lib/nvc.19/NVC.POLYFILL $(top_srcdir)/lib/std/textio-body.vhd diff --git a/lib/vital/Makemodule.am b/lib/vital/Makemodule.am index 91d12226f..9af6b4b96 100644 --- a/lib/vital/Makemodule.am +++ b/lib/vital/Makemodule.am @@ -77,7 +77,3 @@ lib/ieee.08/IEEE.VITAL_MEMORY: $(srcdir)/lib/vital/memory_p.vhdl @ifGNUmake@ | $ lib/ieee.08/IEEE.VITAL_MEMORY-body: $(srcdir)/lib/vital/memory_b.vhdl @ifGNUmake@ | $(DRIVER) $(nvc) --std=2008 -L lib/ --work=lib/ieee.08 -a $(srcdir)/lib/vital/memory_b.vhdl - -lib/ieee/IEEE.VITAL_MEMORY: lib/ieee/IEEE.VITAL_PRIMITIVES - -lib/ieee.08/IEEE.VITAL_MEMORY: lib/ieee.08/IEEE.VITAL_PRIMITIVES diff --git a/src/names.c b/src/names.c index 2dd39d38b..9b9c71f8c 100644 --- a/src/names.c +++ b/src/names.c @@ -1465,7 +1465,7 @@ tree_t resolve_name(nametab_t *tab, const loc_t *loc, ident_t name) else if (tab->top_scope->overload == NULL) { diag_t *d = diag_new(DIAG_ERROR, loc); - ident_t prefix = ident_until(name, '.'); + ident_t prefix = ident_runtil(name, '.'); const symbol_t *psym = prefix ? iterate_symbol_for(tab, prefix) : NULL; if (psym != NULL && psym->ndecls == 1) { if (psym->decls[0].kind == T_LIBRARY) { @@ -1480,8 +1480,11 @@ tree_t resolve_name(nametab_t *tab, const loc_t *loc, ident_t name) istr(ident_rfrom(name, '.')), istr(psym->name)); } else - diag_printf(d, "name %s not found in object %s", - istr(ident_rfrom(name, '.')), istr(psym->name)); + diag_printf(d, "name %s not found in %s %s", + istr(ident_rfrom(name, '.')), + (is_design_unit(psym->decls[0].tree) + ? "design unit" : "object"), + istr(psym->name)); } else diag_printf(d, "no visible declaration for %s", istr(name)); @@ -1757,11 +1760,11 @@ void insert_names_from_use(nametab_t *tab, tree_t use) { assert(tree_kind(use) == T_USE); - if (!tree_has_ref(use)) + if (!tree_has_ref(use) || !tree_has_ident2(use)) return; // Was earlier error tree_t unit = tree_ref(use); - ident_t unit_name = tree_ident(use); + ident_t what = tree_ident2(use); if (tree_kind(unit) == T_GENERIC_DECL) { assert(tree_class(unit) == C_PACKAGE); @@ -1773,21 +1776,18 @@ void insert_names_from_use(nametab_t *tab, tree_t use) assert(is_uninstantiated_package(unit)); } - const bool lib_import = tree_kind(unit) == T_LIBRARY; - - if (lib_import) { - ident_t lib_name = tree_ident(unit); + if (tree_kind(unit) == T_LIBRARY) { + ident_t lib_name = tree_ident2(unit); + ident_t unit_name = ident_prefix(lib_name, what, '.'); lib_t lib = lib_require(lib_name); bool error; - if (lib_name == unit_name || unit_name == well_known(W_WORK)) { + if (what == well_known(W_ALL)) { make_library_visible(tab->top_scope, lib); return; } - else if (unit_name == well_known(W_ERROR)) - return; // Was earlier parse error else if ((unit = lib_get_allow_error(lib, unit_name, &error)) == NULL) { - error_at(tree_loc(use), "unit %s not found in library %s", - istr(unit_name), istr(ident_until(unit_name, '.'))); + error_at(tree_loc(use), "design unit %s not found in library %s", + istr(what), istr(lib_name)); return; } else if (error) { @@ -1796,79 +1796,62 @@ void insert_names_from_use(nametab_t *tab, tree_t use) return; } - unit_name = tree_ident(unit); + make_visible(tab->top_scope, what, unit, POTENTIAL, tab->top_scope); + return; } - ident_t tag = unit_name; - if (tree_has_ident2(use)) - tag = ident_prefix(tag, tree_ident2(use), '.'); - - if (tree_has_ident2(use)) { - if (!is_package(unit)) { - error_at(tree_loc(use), "design unit %s is not a package", - istr(unit_name)); - return; - } - else if (lib_import && is_uninstantiated_package(unit)) { - error_at(tree_loc(use), "cannot use an uninstantiated package"); - return; - } + assert(is_package(unit)); - scope_t *s = private_scope_for(tab, unit); - assert(s->container == unit); + scope_t *s = private_scope_for(tab, unit); + assert(s->container == unit); - ident_t what = tree_ident2(use); - if (what == well_known(W_ALL)) { - for (int i = 0; i < tab->top_scope->imported.count; i++) { - if (tab->top_scope->imported.items[i] == unit) - return; - } + if (what == well_known(W_ALL)) { + for (int i = 0; i < tab->top_scope->imported.count; i++) { + if (tab->top_scope->imported.items[i] == unit) + return; + } - merge_scopes(tab->top_scope, s); - APUSH(tab->top_scope->imported, unit); + merge_scopes(tab->top_scope, s); + APUSH(tab->top_scope->imported, unit); + } + else { + const symbol_t *sym = symbol_for(s, what); + if (sym == NULL) { + error_at(tree_loc(use), "name %s not found in %s %s", + istr(what), is_design_unit(unit) ? "design unit" : "object", + istr(tree_ident(unit))); + return; } - else { - const symbol_t *sym = symbol_for(s, what); - if (sym == NULL) { - error_at(tree_loc(use), "object %s not found in unit %s", - istr(what), istr(tree_ident(unit))); - return; - } - merge_symbol(tab->top_scope, sym); + merge_symbol(tab->top_scope, sym); - // If this is an enumeration or physical type then also make - // the literals visible - // TODO: for VHDL-2008, also predefined functions - for (int i = 0; i < sym->ndecls; i++) { - const decl_t *dd = get_decl(sym, i); - if (dd->kind == T_TYPE_DECL) { - type_t type = tree_type(dd->tree); - if (type_is_enum(type)) { - const int nlits = type_enum_literals(type); - for (int i = 0; i < nlits; i++) { - tree_t lit = type_enum_literal(type, i); - make_visible(tab->top_scope, tree_ident(lit), lit, - POTENTIAL, s); - } + // If this is an enumeration or physical type then also make + // the literals visible + // TODO: for VHDL-2008, also predefined functions + for (int i = 0; i < sym->ndecls; i++) { + const decl_t *dd = get_decl(sym, i); + if (dd->kind == T_TYPE_DECL) { + type_t type = tree_type(dd->tree); + if (type_is_enum(type)) { + const int nlits = type_enum_literals(type); + for (int i = 0; i < nlits; i++) { + tree_t lit = type_enum_literal(type, i); + make_visible(tab->top_scope, tree_ident(lit), lit, + POTENTIAL, s); } - else if (type_is_physical(type)) { - const int nunits = type_units(type); - for (int i = 0; i < nunits; i++) { - tree_t u = type_unit(type, i); - make_visible(tab->top_scope, tree_ident(u), u, - POTENTIAL, s); - } + } + else if (type_is_physical(type)) { + const int nunits = type_units(type); + for (int i = 0; i < nunits; i++) { + tree_t u = type_unit(type, i); + make_visible(tab->top_scope, tree_ident(u), u, + POTENTIAL, s); } } } - - merge_symbol(tab->top_scope, symbol_for(s, unit_bare_name(unit))); } - } - else { - ident_t bare_name = unit_bare_name(unit); - make_visible(tab->top_scope, bare_name, unit, POTENTIAL, tab->top_scope); + + merge_symbol(tab->top_scope, symbol_for(s, unit_bare_name(unit))); } } @@ -1937,7 +1920,7 @@ void insert_names_for_psl(nametab_t *tab) lib_t lnvc = lib_require(nvc_i); tree_t psl_support = lib_get(lnvc, psl_support_i); if (psl_support == NULL) - fatal("cannot find %s package", istr(psl_support_i)); + fatal("required package %s not found", istr(psl_support_i)); tree_t u = tree_new(T_USE); tree_set_ident(u, psl_support_i); diff --git a/src/parse.c b/src/parse.c index 9c3491558..00a324128 100644 --- a/src/parse.c +++ b/src/parse.c @@ -2508,71 +2508,56 @@ static void p_use_clause(tree_t unit, add_func_t addf) do { tree_t u = tree_new(T_USE); - ident_t i1 = p_identifier(); - tree_t head = resolve_name(nametab, CURRENT_LOC, i1); + ident_t i1 = p_identifier(), i2 = NULL; consume(tDOT); - switch (peek()) { - case tID: - i1 = ident_prefix(i1, p_identifier(), '.'); - tree_set_ident(u, i1); - - if (optional(tDOT)) { - if (head != NULL) - head = resolve_name(nametab, CURRENT_LOC, i1); - - switch (peek()) { - case tID: - tree_set_ident2(u, p_identifier()); - break; - - case tSTRING: - tree_set_ident2(u, p_operator_symbol()); - break; - - case tALL: - consume(tALL); - tree_set_ident2(u, well_known(W_ALL)); - break; + do { + i1 = ident_prefix(i1, i2, '.'); - default: - expect(tID, tSTRING, tALL); - } + switch (peek()) { + case tID: + i2 = p_identifier(); + break; + case tSTRING: + i2 = p_operator_symbol(); + break; + case tALL: + consume(tALL); + i2 = well_known(W_ALL); + break; + default: + expect(tID, tSTRING, tALL); + i2 = NULL; + break; } - break; - - case tALL: - consume(tALL); - tree_set_ident(u, i1); - tree_set_ident2(u, well_known(W_ALL)); - break; + } while (optional(tDOT)); - default: - expect(tID, tALL); - tree_set_ident(u, error_marker()); - } + tree_set_ident(u, i1); + tree_set_ident2(u, i2); tree_set_loc(u, CURRENT_LOC); (*addf)(unit, u); - if (head != NULL) { - const tree_kind_t kind = tree_kind(head); - if (kind == T_LIBRARY && !tree_has_ident2(head)) { - // Library declaration had an error - } - else if (is_uninstantiated_package(head)) - parse_error(CURRENT_LOC, "cannot use an uninstantiated package"); - else if (kind == T_LIBRARY || kind == T_PACKAGE - || kind == T_PACK_INST - || (kind == T_GENERIC_DECL - && tree_class(head) == C_PACKAGE)) { - tree_set_ref(u, head); - insert_names_from_use(nametab, u); - } - else - parse_error(CURRENT_LOC, "%s is not a library or %spackage", - istr(i1), standard() >= STD_08 ? "instantiated " : ""); + tree_t head = resolve_name(nametab, CURRENT_LOC, i1); + if (head == NULL) + continue; + + const tree_kind_t kind = tree_kind(head); + if (kind == T_LIBRARY && !tree_has_ident2(head)) { + // Library declaration had an error } + else if (is_uninstantiated_package(head)) + parse_error(CURRENT_LOC, "cannot use an uninstantiated package"); + else if (kind == T_LIBRARY || kind == T_PACKAGE + || kind == T_PACK_INST + || (kind == T_GENERIC_DECL + && tree_class(head) == C_PACKAGE)) { + tree_set_ref(u, head); + insert_names_from_use(nametab, u); + } + else + parse_error(CURRENT_LOC, "%s is not a library or %spackage", + istr(i1), standard() >= STD_08 ? "instantiated " : ""); } while (optional(tCOMMA)); consume(tSEMI); @@ -12533,14 +12518,14 @@ static tree_t p_design_unit(void) if (!bootstrapping) { lib_t lstd = lib_require(std_i); ident_t standard_i = well_known(W_STD_STANDARD); - tree_t standard = lib_get(lstd, standard_i); - if (standard == NULL) + tree_t std_pkg = lib_get(lstd, standard_i); + if (std_pkg == NULL) fatal("cannot find %s package", istr(standard_i)); tree_t u = tree_new(T_USE); tree_set_ident(u, standard_i); tree_set_ident2(u, well_known(W_ALL)); - tree_set_ref(u, standard); + tree_set_ref(u, std_pkg); tree_add_context(unit, u); insert_names_from_use(nametab, u); diff --git a/test/parse/error7.vhd b/test/parse/error7.vhd index 65c161f37..652be3bfb 100644 --- a/test/parse/error7.vhd +++ b/test/parse/error7.vhd @@ -13,3 +13,5 @@ use work.error7.all; -- Error package other is constant x : integer := bad; -- Error (suppressed) end package; + +use work; -- Error diff --git a/test/sem/genpack2.vhd b/test/sem/genpack2.vhd index 07cb05eff..eb1a35475 100644 --- a/test/sem/genpack2.vhd +++ b/test/sem/genpack2.vhd @@ -105,4 +105,5 @@ use work.data_type_pkg_bv.all; package data_type_test is constant test : bit_vector(1 to 8) := inst.c_val; -- OK + use work.data_type_pkg_bv.inst.all; -- OK end package; diff --git a/test/sem/use.vhd b/test/sem/use.vhd index 8e2243d40..7c0e7ccd8 100644 --- a/test/sem/use.vhd +++ b/test/sem/use.vhd @@ -30,4 +30,6 @@ end package body; entity ent is use work.pkg1.my_int1; -- OK constant c : my_int1 := 2; -- OK + use work.spam; -- Error + use work.1; -- Error end entity; diff --git a/test/test_parse.c b/test/test_parse.c index c7abbb064..60991080a 100644 --- a/test/test_parse.c +++ b/test/test_parse.c @@ -4473,7 +4473,8 @@ START_TEST(test_error7) const error_t expect[] = { { 4, "FOO already declared in this region" }, { 7, "depends on WORK.ERROR7 which was analysed with errors" }, - { 11, " depends on WORK.ERROR7 which was analysed with errors" }, + { 11, "depends on WORK.ERROR7 which was analysed with errors" }, + { 17, "unexpected ; while parsing use clause, expecting ." }, { -1, NULL } }; expect_errors(expect); diff --git a/test/test_sem.c b/test/test_sem.c index b7650dd35..72783a3b2 100644 --- a/test/test_sem.c +++ b/test/test_sem.c @@ -160,7 +160,7 @@ START_TEST(test_scope) { 114, "no visible declaration for MY_INT1" }, { 137, "no visible declaration for E1" }, { 160, "no visible subprogram declaration for FUNC2" }, - { 167, "object NOT_HERE not found in unit WORK.PACK5" }, + { 167, "name NOT_HERE not found in design unit WORK.PACK5" }, { 189, "no visible declaration for MY_INT1" }, { 236, "no visible declaration for FOO" }, { 306, "name X not found in L1" }, @@ -1450,6 +1450,8 @@ START_TEST(test_use) const error_t expect[] = { { 25, "no visible declaration for MY_INT3" }, + { 33, "design unit SPAM not found in library WORK" }, + { 34, "unexpected integer while parsing use clause" }, { -1, NULL } }; expect_errors(expect);