From 7ded56ef3537aa41cf4c41a00aeadeed7ae1aee2 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Wed, 24 Jul 2024 12:56:17 -0700 Subject: [PATCH] Improve namespace handling in imports. (#4153) This implements a few closely related features: - Starts merging namespaces discovered inside imports. - Stores results of cross-package name lookup as an entry inside the scope. - Note this is particularly visible with `i32`. - Moves more of the imported instructions to the import scope. Note this is primarily for executing the namespace TODO in check.cpp, which is removed here. `testdata/namespace/merging_with_indirections.carbon` tests key behavior. --------- Co-authored-by: Richard Smith --- toolchain/check/BUILD | 20 +- toolchain/check/check.cpp | 8 - toolchain/check/context.cpp | 97 +-- toolchain/check/import.cpp | 221 ++++++- toolchain/check/import.h | 17 + .../testdata/alias/fail_bool_value.carbon | 23 +- .../check/testdata/alias/fail_builtins.carbon | 26 +- .../testdata/alias/fail_control_flow.carbon | 12 + .../alias/no_prelude/import_access.carbon | 13 +- .../testdata/array/array_in_place.carbon | 28 +- .../testdata/array/array_vs_tuple.carbon | 24 +- .../testdata/array/assign_return_value.carbon | 24 +- .../check/testdata/array/assign_var.carbon | 26 +- toolchain/check/testdata/array/base.carbon | 28 +- .../testdata/array/canonicalize_index.carbon | 29 +- .../testdata/array/fail_bound_negative.carbon | 25 +- .../testdata/array/fail_bound_overflow.carbon | 23 +- .../array/fail_incomplete_element.carbon | 21 +- .../testdata/array/fail_invalid_type.carbon | 17 +- .../testdata/array/fail_out_of_bound.carbon | 21 +- .../fail_out_of_bound_non_literal.carbon | 24 +- .../testdata/array/fail_type_mismatch.carbon | 37 +- .../testdata/array/function_param.carbon | 26 +- .../check/testdata/array/generic_empty.carbon | 17 +- .../testdata/array/index_not_literal.carbon | 24 +- .../check/testdata/array/nine_elements.carbon | 21 +- .../testdata/as/adapter_conversion.carbon | 130 ++-- toolchain/check/testdata/as/as_type.carbon | 22 +- toolchain/check/testdata/as/basic.carbon | 22 +- .../testdata/as/fail_no_conversion.carbon | 24 +- .../check/testdata/as/fail_not_type.carbon | 21 +- toolchain/check/testdata/as/identity.carbon | 25 +- .../testdata/basics/builtin_types.carbon | 31 +- .../check/testdata/basics/fail_bad_run.carbon | 17 +- .../testdata/basics/fail_bad_run_2.carbon | 21 +- .../basics/fail_non_type_as_type.carbon | 17 +- .../fail_numeric_literal_overflow.carbon | 35 +- .../basics/fail_qualifier_unsupported.carbon | 24 +- .../check/testdata/basics/multifile.carbon | 34 +- .../multifile_raw_and_textual_ir.carbon | 19 +- .../basics/no_prelude/multifile_raw_ir.carbon | 8 +- .../testdata/basics/numeric_literals.carbon | 24 +- toolchain/check/testdata/basics/parens.carbon | 24 +- toolchain/check/testdata/basics/run.carbon | 17 +- .../check/testdata/basics/run_i32.carbon | 21 +- .../testdata/basics/type_literals.carbon | 118 ++-- .../testdata/builtins/bool/make_type.carbon | 39 +- .../check/testdata/builtins/float/add.carbon | 74 +-- .../check/testdata/builtins/float/div.carbon | 80 +-- .../check/testdata/builtins/float/eq.carbon | 59 +- .../testdata/builtins/float/greater.carbon | 40 +- .../testdata/builtins/float/greater_eq.carbon | 40 +- .../check/testdata/builtins/float/less.carbon | 40 +- .../testdata/builtins/float/less_eq.carbon | 40 +- .../testdata/builtins/float/make_type.carbon | 77 +-- .../check/testdata/builtins/float/mul.carbon | 74 +-- .../testdata/builtins/float/negate.carbon | 69 +- .../check/testdata/builtins/float/neq.carbon | 59 +- .../check/testdata/builtins/float/sub.carbon | 74 +-- .../check/testdata/builtins/int/and.carbon | 34 +- .../testdata/builtins/int/complement.carbon | 37 +- .../check/testdata/builtins/int/eq.carbon | 59 +- .../testdata/builtins/int/greater.carbon | 40 +- .../testdata/builtins/int/greater_eq.carbon | 40 +- .../testdata/builtins/int/left_shift.carbon | 69 +- .../check/testdata/builtins/int/less.carbon | 40 +- .../testdata/builtins/int/less_eq.carbon | 40 +- .../testdata/builtins/int/make_type_32.carbon | 39 +- .../builtins/int/make_type_signed.carbon | 122 ++-- .../builtins/int/make_type_unsigned.carbon | 122 ++-- .../check/testdata/builtins/int/neq.carbon | 36 +- .../check/testdata/builtins/int/or.carbon | 34 +- .../testdata/builtins/int/right_shift.carbon | 112 ++-- .../check/testdata/builtins/int/sadd.carbon | 110 ++-- .../check/testdata/builtins/int/sdiv.carbon | 104 ++- .../check/testdata/builtins/int/smod.carbon | 104 ++- .../check/testdata/builtins/int/smul.carbon | 63 +- .../testdata/builtins/int/snegate.carbon | 112 ++-- .../check/testdata/builtins/int/ssub.carbon | 66 +- .../check/testdata/builtins/int/uadd.carbon | 110 ++-- .../check/testdata/builtins/int/udiv.carbon | 104 ++- .../check/testdata/builtins/int/umod.carbon | 104 ++- .../check/testdata/builtins/int/umul.carbon | 63 +- .../testdata/builtins/int/unegate.carbon | 112 ++-- .../check/testdata/builtins/int/usub.carbon | 66 +- .../check/testdata/builtins/int/xor.carbon | 34 +- .../check/testdata/builtins/print.carbon | 28 +- toolchain/check/testdata/class/adapt.carbon | 49 +- toolchain/check/testdata/class/base.carbon | 30 +- .../check/testdata/class/base_field.carbon | 30 +- .../class/base_function_unqualified.carbon | 19 +- .../check/testdata/class/base_method.carbon | 25 +- .../class/base_method_qualified.carbon | 36 +- .../testdata/class/base_method_shadow.carbon | 25 +- toolchain/check/testdata/class/basic.carbon | 30 +- .../class/complete_in_member_fn.carbon | 22 +- .../testdata/class/compound_field.carbon | 39 +- .../class/cross_package_import.carbon | 177 ++--- .../testdata/class/derived_to_base.carbon | 25 +- .../check/testdata/class/extend_adapt.carbon | 98 +-- toolchain/check/testdata/class/extern.carbon | 371 ++++++----- .../check/testdata/class/fail_abstract.carbon | 30 +- .../testdata/class/fail_adapt_bad_decl.carbon | 76 ++- .../testdata/class/fail_adapt_bad_type.carbon | 19 +- .../class/fail_adapt_modifiers.carbon | 27 +- .../class/fail_adapt_with_subobjects.carbon | 74 ++- .../testdata/class/fail_addr_not_self.carbon | 17 +- .../testdata/class/fail_addr_self.carbon | 19 +- .../testdata/class/fail_base_bad_type.carbon | 37 +- .../class/fail_base_method_define.carbon | 19 +- .../testdata/class/fail_base_modifiers.carbon | 25 +- .../testdata/class/fail_base_no_extend.carbon | 19 +- .../testdata/class/fail_base_repeated.carbon | 23 +- .../testdata/class/fail_base_unbound.carbon | 21 +- .../class/fail_compound_type_mismatch.carbon | 27 +- .../class/fail_convert_to_invalid.carbon | 19 +- .../class/fail_derived_to_base.carbon | 33 +- .../testdata/class/fail_extend_cycle.carbon | 19 +- .../class/fail_field_modifiers.carbon | 24 +- .../testdata/class/fail_generic_method.carbon | 21 +- .../testdata/class/fail_import_misuses.carbon | 45 +- .../testdata/class/fail_incomplete.carbon | 24 +- .../check/testdata/class/fail_init.carbon | 24 +- .../class/fail_init_as_inplace.carbon | 26 +- .../class/fail_memaccess_category.carbon | 21 +- .../testdata/class/fail_member_of_let.carbon | 23 +- .../check/testdata/class/fail_method.carbon | 21 +- .../class/fail_method_modifiers.carbon | 21 +- .../class/fail_method_redefinition.carbon | 17 +- .../testdata/class/fail_modifiers.carbon | 23 +- .../class/fail_out_of_line_decl.carbon | 17 +- .../fail_redeclaration_introducer.carbon | 102 +-- .../class/fail_redeclaration_scope.carbon | 21 +- .../testdata/class/fail_redefinition.carbon | 17 +- .../check/testdata/class/fail_scope.carbon | 24 +- .../check/testdata/class/fail_self.carbon | 21 +- .../testdata/class/fail_todo_modifiers.carbon | 26 +- .../testdata/class/fail_unbound_field.carbon | 25 +- .../testdata/class/fail_unknown_member.carbon | 24 +- .../check/testdata/class/field_access.carbon | 26 +- .../class/field_access_in_value.carbon | 26 +- .../testdata/class/forward_declared.carbon | 19 +- toolchain/check/testdata/class/generic.carbon | 17 +- .../check/testdata/class/generic/basic.carbon | 19 +- .../check/testdata/class/generic/call.carbon | 115 ++-- .../class/generic/fail_todo_use.carbon | 24 +- .../check/testdata/class/generic/field.carbon | 28 +- .../testdata/class/generic/import.carbon | 205 +++--- .../class/generic/member_inline.carbon | 17 +- .../class/generic/member_out_of_line.carbon | 102 +-- .../testdata/class/generic/redeclare.carbon | 114 ++-- .../check/testdata/class/generic/self.carbon | 17 +- .../testdata/class/generic_method.carbon | 17 +- toolchain/check/testdata/class/import.carbon | 47 +- .../check/testdata/class/import_base.carbon | 64 +- .../testdata/class/import_forward_decl.carbon | 39 +- .../testdata/class/import_indirect.carbon | 153 ++--- .../testdata/class/import_member_cycle.carbon | 43 +- .../testdata/class/import_struct_cyle.carbon | 47 +- toolchain/check/testdata/class/init.carbon | 27 +- .../check/testdata/class/init_adapt.carbon | 48 +- toolchain/check/testdata/class/init_as.carbon | 25 +- .../check/testdata/class/init_nested.carbon | 28 +- toolchain/check/testdata/class/method.carbon | 34 +- toolchain/check/testdata/class/nested.carbon | 19 +- .../check/testdata/class/nested_name.carbon | 26 +- .../class/no_prelude/import_access.carbon | 39 +- .../check/testdata/class/raw_self.carbon | 29 +- .../check/testdata/class/raw_self_type.carbon | 19 +- .../check/testdata/class/redeclaration.carbon | 22 +- .../class/redeclaration_introducer.carbon | 21 +- .../check/testdata/class/reenter_scope.carbon | 23 +- toolchain/check/testdata/class/reorder.carbon | 22 +- .../testdata/class/reorder_qualified.carbon | 24 +- toolchain/check/testdata/class/scope.carbon | 29 +- toolchain/check/testdata/class/self.carbon | 25 +- .../testdata/class/self_conversion.carbon | 28 +- .../check/testdata/class/self_type.carbon | 22 +- .../check/testdata/class/static_method.carbon | 24 +- .../class/syntactic_merge_literal.carbon | 46 +- toolchain/check/testdata/const/basic.carbon | 26 +- .../check/testdata/const/collapse.carbon | 22 +- .../check/testdata/const/fail_collapse.carbon | 22 +- toolchain/check/testdata/const/import.carbon | 65 +- .../check/testdata/eval/aggregate.carbon | 40 +- .../check/testdata/eval/fail_aggregate.carbon | 23 +- .../check/testdata/eval/fail_symbolic.carbon | 22 +- toolchain/check/testdata/eval/symbolic.carbon | 17 +- .../expr_category/in_place_tuple_init.carbon | 31 +- .../testdata/function/builtin/call.carbon | 26 +- .../function/builtin/definition.carbon | 23 +- .../function/builtin/fail_redefined.carbon | 42 +- .../function/builtin/fail_unknown.carbon | 17 +- .../testdata/function/builtin/method.carbon | 27 +- .../no_prelude/call_from_operator.carbon | 19 +- .../function/builtin/no_prelude/import.carbon | 12 +- .../function/call/fail_not_callable.carbon | 21 +- .../function/call/fail_param_count.carbon | 29 +- .../function/call/fail_param_type.carbon | 23 +- .../call/fail_return_type_mismatch.carbon | 26 +- .../check/testdata/function/call/i32.carbon | 25 +- .../function/call/more_param_ir.carbon | 25 +- .../testdata/function/call/params_one.carbon | 23 +- .../function/call/params_one_comma.carbon | 23 +- .../testdata/function/call/params_two.carbon | 24 +- .../function/call/params_two_comma.carbon | 24 +- .../declaration/fail_param_in_type.carbon | 22 +- .../declaration/fail_param_redecl.carbon | 22 +- .../function/declaration/import.carbon | 611 +++++++++--------- .../declaration/param_same_name.carbon | 24 +- .../function/definition/import.carbon | 177 ++--- .../function/definition/import_access.carbon | 272 ++++---- .../function/definition/params_one.carbon | 21 +- .../definition/params_one_comma.carbon | 21 +- .../function/definition/params_two.carbon | 22 +- .../definition/params_two_comma.carbon | 22 +- .../generic/fail_todo_param_in_type.carbon | 22 +- .../function/generic/redeclare.carbon | 68 +- .../check/testdata/global/class_obj.carbon | 19 +- .../testdata/global/class_with_fun.carbon | 21 +- toolchain/check/testdata/global/decl.carbon | 21 +- .../check/testdata/global/simple_init.carbon | 21 +- .../testdata/global/simple_with_fun.carbon | 24 +- toolchain/check/testdata/if/else.carbon | 27 +- .../if/fail_reachable_fallthrough.carbon | 32 +- toolchain/check/testdata/if/fail_scope.carbon | 25 +- toolchain/check/testdata/if/no_else.carbon | 25 +- .../if/unreachable_fallthrough.carbon | 24 +- toolchain/check/testdata/if_expr/basic.carbon | 27 +- .../if_expr/constant_condition.carbon | 42 +- .../testdata/if_expr/control_flow.carbon | 30 +- .../if_expr/fail_not_in_function.carbon | 29 +- .../if_expr/fail_partial_constant.carbon | 47 +- .../check/testdata/if_expr/nested.carbon | 26 +- .../check/testdata/if_expr/struct.carbon | 29 +- toolchain/check/testdata/impl/compound.carbon | 34 +- .../check/testdata/impl/declaration.carbon | 21 +- toolchain/check/testdata/impl/empty.carbon | 21 +- .../check/testdata/impl/extend_impl.carbon | 21 +- .../testdata/impl/fail_call_invalid.carbon | 24 +- .../impl/fail_extend_impl_forall.carbon | 19 +- .../impl/fail_extend_impl_scope.carbon | 21 +- .../impl/fail_extend_impl_type_as.carbon | 27 +- .../impl/fail_extend_non_interface.carbon | 21 +- ..._extend_partially_defined_interface.carbon | 17 +- .../fail_extend_undefined_interface.carbon | 19 +- .../testdata/impl/fail_impl_as_scope.carbon | 17 +- .../impl/fail_impl_bad_assoc_const.carbon | 21 +- .../impl/fail_impl_bad_assoc_fn.carbon | 46 +- .../impl/fail_impl_bad_interface.carbon | 19 +- .../testdata/impl/fail_impl_bad_type.carbon | 17 +- .../testdata/impl/fail_redefinition.carbon | 22 +- .../impl/fail_todo_impl_assoc_const.carbon | 21 +- toolchain/check/testdata/impl/impl_as.carbon | 19 +- .../check/testdata/impl/impl_forall.carbon | 17 +- .../check/testdata/impl/lookup/alias.carbon | 21 +- .../lookup/fail_alias_impl_not_found.carbon | 21 +- .../lookup/fail_todo_undefined_impl.carbon | 25 +- .../check/testdata/impl/lookup/import.carbon | 53 +- .../impl/lookup/instance_method.carbon | 27 +- .../impl/lookup/no_prelude/import.carbon | 14 +- .../check/testdata/impl/redeclaration.carbon | 25 +- .../index/array_element_access.carbon | 30 +- .../check/testdata/index/expr_category.carbon | 30 +- .../index/fail_array_large_index.carbon | 27 +- .../index/fail_array_non_int_indexing.carbon | 24 +- .../fail_array_out_of_bound_access.carbon | 24 +- .../index/fail_empty_tuple_access.carbon | 19 +- .../testdata/index/fail_expr_category.carbon | 26 +- .../testdata/index/fail_invalid_base.carbon | 36 +- .../testdata/index/fail_name_not_found.carbon | 21 +- .../index/fail_negative_indexing.carbon | 44 +- .../index/fail_non_deterministic_type.carbon | 28 +- .../index/fail_non_tuple_access.carbon | 17 +- .../fail_out_of_bound_not_literal.carbon | 25 +- .../index/fail_tuple_index_error.carbon | 25 +- .../index/fail_tuple_large_index.carbon | 30 +- .../index/fail_tuple_non_int_indexing.carbon | 25 +- .../fail_tuple_out_of_bound_access.carbon | 25 +- .../testdata/index/index_not_literal.carbon | 25 +- .../index/tuple_element_access.carbon | 27 +- .../index/tuple_return_value_access.carbon | 24 +- .../testdata/interface/assoc_const.carbon | 21 +- .../fail_assoc_const_bad_default.carbon | 17 +- .../fail_todo_assoc_const_default.carbon | 23 +- .../fail_todo_define_default_fn_inline.carbon | 23 +- ..._todo_define_default_fn_out_of_line.carbon | 26 +- .../interface/no_prelude/import_access.carbon | 37 +- .../interface/todo_define_not_default.carbon | 26 +- .../ir/duplicate_name_same_line.carbon | 22 +- toolchain/check/testdata/let/convert.carbon | 27 +- .../testdata/let/fail_duplicate_decl.carbon | 22 +- .../check/testdata/let/fail_generic.carbon | 23 +- .../testdata/let/fail_generic_import.carbon | 45 +- .../testdata/let/fail_missing_value.carbon | 24 +- .../check/testdata/let/fail_modifiers.carbon | 30 +- .../testdata/let/fail_use_in_init.carbon | 21 +- toolchain/check/testdata/let/generic.carbon | 21 +- .../check/testdata/let/generic_import.carbon | 47 +- toolchain/check/testdata/let/global.carbon | 24 +- toolchain/check/testdata/let/local.carbon | 23 +- .../testdata/let/no_prelude/import.carbon | 11 +- .../let/no_prelude/import_access.carbon | 13 +- .../check/testdata/let/shadowed_decl.carbon | 23 +- .../testdata/namespace/add_to_import.carbon | 53 +- .../check/testdata/namespace/alias.carbon | 31 +- .../fail_conflict_after_merge.carbon | 36 +- ...l_conflict_imported_namespace_first.carbon | 38 +- ..._conflict_imported_namespace_second.carbon | 37 +- ...conflict_in_imports_namespace_first.carbon | 66 +- ...onflict_in_imports_namespace_second.carbon | 64 +- .../namespace/fail_decl_in_alias.carbon | 23 +- .../testdata/namespace/fail_duplicate.carbon | 17 +- .../testdata/namespace/fail_modifiers.carbon | 21 +- .../testdata/namespace/fail_params.carbon | 27 +- .../namespace/fail_unresolved_scope.carbon | 15 +- .../check/testdata/namespace/function.carbon | 21 +- .../check/testdata/namespace/imported.carbon | 79 +-- .../namespace/imported_indirect.carbon | 114 ++-- .../check/testdata/namespace/merging.carbon | 88 +-- .../merging_with_indirections.carbon | 225 +++++++ .../check/testdata/namespace/nested.carbon | 17 +- .../check/testdata/namespace/shadow.carbon | 24 +- .../namespace/unqualified_lookup.carbon | 21 +- .../testdata/operators/builtin/and.carbon | 37 +- .../operators/builtin/assignment.carbon | 26 +- .../fail_and_or_not_in_function.carbon | 12 + .../fail_and_or_partial_constant.carbon | 46 +- .../builtin/fail_assignment_to_error.carbon | 17 +- .../fail_assignment_to_non_assignable.carbon | 27 +- .../fail_redundant_compound_access.carbon | 24 +- .../builtin/fail_type_mismatch.carbon | 21 +- .../fail_type_mismatch_assignment.carbon | 21 +- .../builtin/fail_type_mismatch_once.carbon | 33 +- .../builtin/fail_unimplemented_op.carbon | 22 +- .../testdata/operators/builtin/or.carbon | 37 +- .../operators/builtin/unary_op.carbon | 32 +- .../testdata/operators/overloaded/add.carbon | 54 +- .../operators/overloaded/bit_and.carbon | 54 +- .../overloaded/bit_complement.carbon | 36 +- .../operators/overloaded/bit_or.carbon | 54 +- .../operators/overloaded/bit_xor.carbon | 54 +- .../testdata/operators/overloaded/dec.carbon | 36 +- .../testdata/operators/overloaded/div.carbon | 54 +- .../testdata/operators/overloaded/eq.carbon | 154 +++-- .../overloaded/fail_assign_non_ref.carbon | 54 +- .../operators/overloaded/fail_no_impl.carbon | 24 +- .../overloaded/fail_no_impl_for_arg.carbon | 56 +- .../testdata/operators/overloaded/inc.carbon | 36 +- .../operators/overloaded/left_shift.carbon | 54 +- .../testdata/operators/overloaded/mod.carbon | 54 +- .../testdata/operators/overloaded/mul.carbon | 54 +- .../operators/overloaded/negate.carbon | 36 +- .../operators/overloaded/ordered.carbon | 91 ++- .../operators/overloaded/right_shift.carbon | 54 +- .../testdata/operators/overloaded/sub.carbon | 54 +- .../package_expr/fail_not_found.carbon | 21 +- .../check/testdata/package_expr/syntax.carbon | 68 +- .../testdata/packages/explicit_imports.carbon | 92 +-- .../packages/fail_api_not_found.carbon | 57 +- .../fail_conflict_no_namespaces.carbon | 58 +- .../check/testdata/packages/fail_cycle.carbon | 107 +-- .../packages/fail_duplicate_api.carbon | 120 ++-- .../testdata/packages/fail_extension.carbon | 174 ++--- .../packages/fail_import_default.carbon | 68 +- .../packages/fail_import_invalid.carbon | 153 +++-- .../packages/fail_import_repeat.carbon | 75 ++- .../packages/fail_import_type_error.carbon | 65 +- .../fail_name_with_import_failure.carbon | 21 +- .../packages/fail_package_main.carbon | 60 +- .../packages/implicit_imports_prelude.carbon | 48 +- .../testdata/packages/loaded_global.carbon | 84 +-- .../no_prelude/cross_package_export.carbon | 159 ++--- .../no_prelude/cross_package_import.carbon | 134 ++-- .../packages/no_prelude/export_name.carbon | 304 ++++----- .../packages/no_prelude/fail_modifiers.carbon | 43 +- .../implicit_imports_entities.carbon | 132 ++-- .../packages/unused_lazy_import.carbon | 39 +- .../testdata/pointer/address_of_deref.carbon | 22 +- .../testdata/pointer/address_of_lvalue.carbon | 30 +- toolchain/check/testdata/pointer/arrow.carbon | 19 +- toolchain/check/testdata/pointer/basic.carbon | 23 +- .../pointer/fail_address_of_error.carbon | 17 +- .../pointer/fail_address_of_value.carbon | 28 +- .../testdata/pointer/fail_deref_error.carbon | 24 +- .../pointer/fail_deref_function.carbon | 17 +- .../pointer/fail_deref_namespace.carbon | 19 +- .../pointer/fail_deref_not_pointer.carbon | 21 +- .../testdata/pointer/fail_deref_type.carbon | 24 +- .../pointer/fail_type_mismatch.carbon | 17 +- .../check/testdata/pointer/import.carbon | 55 +- .../testdata/pointer/nested_const.carbon | 22 +- toolchain/check/testdata/pointer/types.carbon | 26 +- .../testdata/return/code_after_return.carbon | 21 +- .../return/code_after_return_value.carbon | 25 +- .../testdata/return/fail_call_in_type.carbon | 23 +- .../testdata/return/fail_error_in_type.carbon | 17 +- .../return/fail_missing_return.carbon | 21 +- .../fail_missing_return_empty_tuple.carbon | 17 +- .../fail_return_var_no_returned_var.carbon | 21 +- .../fail_return_with_returned_var.carbon | 28 +- .../fail_returned_var_no_return_type.carbon | 17 +- .../return/fail_returned_var_shadow.carbon | 28 +- .../return/fail_returned_var_type.carbon | 24 +- .../testdata/return/fail_type_mismatch.carbon | 21 +- .../return/fail_value_disallowed.carbon | 17 +- .../testdata/return/fail_value_missing.carbon | 21 +- .../testdata/return/fail_var_in_type.carbon | 23 +- .../missing_return_no_return_type.carbon | 17 +- .../check/testdata/return/no_value.carbon | 17 +- .../check/testdata/return/returned_var.carbon | 28 +- .../testdata/return/returned_var_scope.carbon | 31 +- toolchain/check/testdata/return/struct.carbon | 21 +- toolchain/check/testdata/return/tuple.carbon | 22 +- toolchain/check/testdata/return/value.carbon | 21 +- .../struct/fail_access_into_invalid.carbon | 17 +- .../testdata/struct/fail_assign_empty.carbon | 21 +- .../struct/fail_assign_to_empty.carbon | 17 +- .../struct/fail_duplicate_name.carbon | 39 +- .../struct/fail_field_name_mismatch.carbon | 24 +- .../struct/fail_field_type_mismatch.carbon | 21 +- .../struct/fail_member_access_type.carbon | 26 +- .../struct/fail_member_of_function.carbon | 17 +- .../struct/fail_non_member_access.carbon | 24 +- .../struct/fail_too_few_values.carbon | 22 +- .../testdata/struct/fail_type_assign.carbon | 22 +- .../testdata/struct/fail_value_as_type.carbon | 17 +- toolchain/check/testdata/struct/import.carbon | 160 +++-- .../struct/literal_member_access.carbon | 26 +- .../testdata/struct/member_access.carbon | 30 +- .../struct/nested_struct_in_place.carbon | 31 +- .../check/testdata/struct/one_entry.carbon | 24 +- .../testdata/struct/reorder_fields.carbon | 34 +- .../testdata/struct/tuple_as_element.carbon | 26 +- .../check/testdata/struct/two_entries.carbon | 34 +- .../testdata/tuples/fail_assign_nested.carbon | 24 +- .../tuples/fail_element_type_mismatch.carbon | 22 +- .../tuples/fail_nested_incomplete.carbon | 25 +- .../tuples/fail_too_few_element.carbon | 22 +- .../testdata/tuples/fail_type_assign.carbon | 22 +- .../testdata/tuples/fail_value_as_type.carbon | 17 +- toolchain/check/testdata/tuples/import.carbon | 162 +++-- .../check/testdata/tuples/nested_tuple.carbon | 23 +- .../tuples/nested_tuple_in_place.carbon | 38 +- .../check/testdata/tuples/one_element.carbon | 24 +- .../check/testdata/tuples/two_elements.carbon | 34 +- .../testdata/var/fail_not_copyable.carbon | 19 +- .../var/fail_storage_is_literal.carbon | 17 +- .../var/fail_todo_control_flow_init.carbon | 28 +- .../var/no_prelude/import_access.carbon | 13 +- .../testdata/while/break_continue.carbon | 30 +- .../testdata/while/fail_bad_condition.carbon | 17 +- .../testdata/while/fail_break_continue.carbon | 17 +- .../testdata/while/unreachable_end.carbon | 29 +- toolchain/check/testdata/while/while.carbon | 29 +- 455 files changed, 9570 insertions(+), 9238 deletions(-) create mode 100644 toolchain/check/testdata/namespace/merging_with_indirections.carbon diff --git a/toolchain/check/BUILD b/toolchain/check/BUILD index b77dc369a4bc..48c1e71597c2 100644 --- a/toolchain/check/BUILD +++ b/toolchain/check/BUILD @@ -22,6 +22,7 @@ cc_library( "function.cpp", "generic.cpp", "global_init.cpp", + "import.cpp", "import_ref.cpp", "inst_block_stack.cpp", "merge.cpp", @@ -40,6 +41,7 @@ cc_library( "function.h", "generic.h", "global_init.h", + "import.h", "import_ref.h", "inst_block_stack.h", "keyword_modifier_set.h", @@ -92,7 +94,6 @@ cc_library( ":call", ":context", ":impl", - ":import", ":interface", ":member_access", ":operator", @@ -183,23 +184,6 @@ cc_library( ], ) -cc_library( - name = "import", - srcs = ["import.cpp"], - hdrs = ["import.h"], - deps = [ - ":context", - "//common:check", - "//common:map", - "//toolchain/base:kind_switch", - "//toolchain/parse:node_kind", - "//toolchain/sem_ir:file", - "//toolchain/sem_ir:ids", - "//toolchain/sem_ir:inst", - "//toolchain/sem_ir:inst_kind", - ], -) - cc_library( name = "interface", srcs = ["interface.cpp"], diff --git a/toolchain/check/check.cpp b/toolchain/check/check.cpp index c2065efb386f..a88c7382821b 100644 --- a/toolchain/check/check.cpp +++ b/toolchain/check/check.cpp @@ -303,14 +303,6 @@ static auto ImportOtherPackages(Context& context, UnitInfo& unit_info, } // Add imports to the root block. -// TODO: Should this be importing all namespaces before anything else, including -// for imports from other packages? Otherwise, name conflict resolution -// involving something such as `fn F() -> Other.NS.A`, wherein `Other.NS` -// hasn't been imported yet (before `Other.NS` had a constant assigned), could -// result in an inconsistent scoping for `Other.NS.A` versus if it were imported -// as part of scanning `Other.NS` (after `Other.NS` had a constant assigned). -// This will probably require IRs separating out which namespaces they -// declare (or declare entities inside). static auto InitPackageScopeAndImports(Context& context, UnitInfo& unit_info, int total_ir_count) -> void { // First create the constant values map for all imported IRs. We'll populate diff --git a/toolchain/check/context.cpp b/toolchain/check/context.cpp index 203819fd45a8..7c871772ef46 100644 --- a/toolchain/check/context.cpp +++ b/toolchain/check/context.cpp @@ -15,6 +15,7 @@ #include "toolchain/check/eval.h" #include "toolchain/check/generic.h" #include "toolchain/check/generic_region_stack.h" +#include "toolchain/check/import.h" #include "toolchain/check/import_ref.h" #include "toolchain/check/inst_block_stack.h" #include "toolchain/check/merge.h" @@ -299,91 +300,6 @@ auto Context::LookupUnqualifiedName(Parse::NodeId node_id, .inst_id = SemIR::InstId::BuiltinError}; } -// Handles lookup through the import_ir_scopes for LookupNameInExactScope. -static auto LookupInImportIRScopes(Context& context, SemIRLoc loc, - SemIR::NameId name_id, - SemIR::NameScopeId scope_id, - const SemIR::NameScope& scope) - -> SemIR::InstId { - auto identifier_id = name_id.AsIdentifierId(); - llvm::StringRef identifier; - if (identifier_id.is_valid()) { - identifier = context.identifiers().Get(identifier_id); - } - - DiagnosticAnnotationScope annotate_diagnostics( - &context.emitter(), [&](auto& builder) { - CARBON_DIAGNOSTIC(InNameLookup, Note, "In name lookup for `{0}`.", - SemIR::NameId); - builder.Note(loc, InNameLookup, name_id); - }); - - auto result_id = SemIR::InstId::Invalid; - std::optional canonical_result_inst; - - for (auto [import_ir_id, import_scope_id] : scope.import_ir_scopes) { - auto& import_ir = context.import_irs().Get(import_ir_id); - - // Determine the NameId in the import IR. - SemIR::NameId import_name_id = name_id; - if (identifier_id.is_valid()) { - auto import_identifier_id = - import_ir.sem_ir->identifiers().Lookup(identifier); - if (!import_identifier_id.is_valid()) { - // Name doesn't exist in the import IR. - continue; - } - import_name_id = SemIR::NameId::ForIdentifier(import_identifier_id); - } - - // Look up the name in the import scope. - const auto& import_scope = - import_ir.sem_ir->name_scopes().Get(import_scope_id); - auto lookup = import_scope.name_map.Lookup(import_name_id); - if (!lookup) { - // Name doesn't exist in the import scope. - continue; - } - const auto& import_scope_entry = import_scope.names[lookup.value()]; - auto import_inst = - import_ir.sem_ir->insts().Get(import_scope_entry.inst_id); - if (import_inst.Is()) { - // This entity was added to name lookup by using an import, and is not - // exported. - continue; - } - - if (import_scope_entry.access_kind != SemIR::AccessKind::Public) { - // Ignore cross-package non-public names. - continue; - } - - if (result_id.is_valid()) { - // On a conflict, we verify the canonical instruction is the same. - if (!canonical_result_inst) { - canonical_result_inst = - GetCanonicalImportIRInst(context, &context.sem_ir(), result_id); - } - VerifySameCanonicalImportIRInst( - context, result_id, *canonical_result_inst, import_ir_id, - import_ir.sem_ir, import_scope_entry.inst_id); - } else { - // Add the first result found. - auto entity_name_id = context.entity_names().Add( - {.name_id = name_id, - .parent_scope_id = scope_id, - .bind_index = SemIR::CompileTimeBindIndex::Invalid}); - result_id = AddImportRef( - context, - {.ir_id = import_ir_id, .inst_id = import_scope_entry.inst_id}, - entity_name_id); - LoadImportRef(context, result_id); - } - } - - return result_id; -} - auto Context::LookupNameInExactScope(SemIRLoc loc, SemIR::NameId name_id, SemIR::NameScopeId scope_id, const SemIR::NameScope& scope) @@ -394,7 +310,8 @@ auto Context::LookupNameInExactScope(SemIRLoc loc, SemIR::NameId name_id, return inst_id; } if (!scope.import_ir_scopes.empty()) { - return LookupInImportIRScopes(*this, loc, name_id, scope_id, scope); + return ImportNameFromOtherPackage(*this, loc, scope_id, + scope.import_ir_scopes, name_id); } return SemIR::InstId::Invalid; } @@ -410,14 +327,14 @@ auto Context::LookupQualifiedName(Parse::NodeId node_id, SemIR::NameId name_id, // Walk this scope and, if nothing is found here, the scopes it extends. while (!scopes.empty()) { auto [scope_id, instance_id] = scopes.pop_back_val(); - const auto& scope = name_scopes().Get(scope_id); - has_error |= scope.has_error; + const auto& name_scope = name_scopes().Get(scope_id); + has_error |= name_scope.has_error; auto scope_result_id = - LookupNameInExactScope(node_id, name_id, scope_id, scope); + LookupNameInExactScope(node_id, name_id, scope_id, name_scope); if (!scope_result_id.is_valid()) { // Nothing found in this scope: also look in its extended scopes. - auto extended = scope.extended_scopes; + auto extended = name_scope.extended_scopes; scopes.reserve(scopes.size() + extended.size()); for (auto extended_id : llvm::reverse(extended)) { // TODO: Track a constant describing the extended scope, and substitute diff --git a/toolchain/check/import.cpp b/toolchain/check/import.cpp index 0e2140ffbe6a..d096d0bee2d9 100644 --- a/toolchain/check/import.cpp +++ b/toolchain/check/import.cpp @@ -84,7 +84,7 @@ static auto AddNamespace( Context& context, SemIR::TypeId namespace_type_id, SemIR::NameId name_id, SemIR::NameScopeId parent_scope_id, bool diagnose_duplicate_namespace, std::optional> make_import_id) - -> std::tuple { + -> std::tuple { auto* parent_scope = &context.name_scopes().Get(parent_scope_id); auto insert_result = parent_scope->name_map.Insert(name_id, parent_scope->names.size()); @@ -97,8 +97,7 @@ static auto AddNamespace( CARBON_CHECK(import_id.is_valid()); context.DiagnoseDuplicateName(import_id, prev_inst_id); } - return {namespace_inst->name_scope_id, - context.constant_values().Get(prev_inst_id), true}; + return {namespace_inst->name_scope_id, prev_inst_id, true}; } } @@ -107,8 +106,9 @@ static auto AddNamespace( auto namespace_inst = SemIR::Namespace{ namespace_type_id, SemIR::NameScopeId::Invalid, import_id}; auto namespace_id = - context.AddPlaceholderInst(SemIR::LocIdAndInst::ReusingLoc( + context.AddPlaceholderInstInNoBlock(SemIR::LocIdAndInst::ReusingLoc( context.insts().GetLocId(import_id), namespace_inst)); + context.import_ref_ids().push_back(namespace_id); namespace_inst.name_scope_id = context.name_scopes().Add(namespace_id, name_id, parent_scope_id); context.ReplaceInstBeforeConstantUse(namespace_id, namespace_inst); @@ -130,8 +130,7 @@ static auto AddNamespace( .access_kind = SemIR::AccessKind::Public}); } - return {namespace_inst.name_scope_id, - context.constant_values().Get(namespace_id), false}; + return {namespace_inst.name_scope_id, namespace_id, false}; } // Adds a copied namespace to the cache. @@ -153,7 +152,7 @@ static auto CopySingleNameScopeFromImportIR( Map* copied_namespaces, SemIR::ImportIRId ir_id, SemIR::InstId import_inst_id, SemIR::NameScopeId import_scope_id, SemIR::NameScopeId parent_scope_id, - SemIR::NameId name_id) -> SemIR::NameScopeId { + SemIR::NameId name_id) -> std::pair { // Produce the namespace for the entry. auto make_import_id = [&]() { auto entity_name_id = context.entity_names().Add( @@ -162,15 +161,18 @@ static auto CopySingleNameScopeFromImportIR( .bind_index = SemIR::CompileTimeBindIndex::Invalid}); auto import_ir_inst_id = context.import_ir_insts().Add( {.ir_id = ir_id, .inst_id = import_inst_id}); - return context.AddInst( + auto inst_id = context.AddInstInNoBlock( import_ir_inst_id, {.type_id = namespace_type_id, .import_ir_inst_id = import_ir_inst_id, .entity_name_id = entity_name_id}); + context.import_ref_ids().push_back(inst_id); + return inst_id; }; - auto [namespace_scope_id, namespace_const_id, _] = + auto [namespace_scope_id, namespace_inst_id, _] = AddNamespace(context, namespace_type_id, name_id, parent_scope_id, /*diagnose_duplicate_namespace=*/false, make_import_id); + auto namespace_const_id = context.constant_values().Get(namespace_inst_id); context.import_ir_constant_values()[ir_id.index].Set(import_inst_id, namespace_const_id); @@ -178,7 +180,7 @@ static auto CopySingleNameScopeFromImportIR( CacheCopiedNamespace(*copied_namespaces, import_scope_id, namespace_scope_id); } - return namespace_scope_id; + return {namespace_scope_id, namespace_inst_id}; } // Copies ancestor name scopes from the import IR. Handles the parent traversal. @@ -222,9 +224,11 @@ static auto CopyAncestorNameScopesFromImportIR( auto import_scope = import_sem_ir.name_scopes().Get(import_scope_id); auto name_id = CopyNameFromImportIR(context, import_sem_ir, import_scope.name_id); - scope_cursor = CopySingleNameScopeFromImportIR( - context, namespace_type_id, &copied_namespaces, ir_id, - import_scope.inst_id, import_scope_id, scope_cursor, name_id); + scope_cursor = + CopySingleNameScopeFromImportIR( + context, namespace_type_id, &copied_namespaces, ir_id, + import_scope.inst_id, import_scope_id, scope_cursor, name_id) + .first; } return scope_cursor; @@ -278,6 +282,25 @@ struct TodoScope { }; } // namespace +// Adds an ImportRef to a name scope. +static auto AddScopedImportRef(Context& context, + SemIR::NameScopeId parent_scope_id, + SemIR::NameScope& parent_scope, + SemIR::NameId name_id, + SemIR::ImportIRInst import_inst, + SemIR::AccessKind access_kind) -> SemIR::InstId { + // Add an ImportRef for other instructions. + auto impl_entity_name_id = context.entity_names().Add( + {.name_id = name_id, + .parent_scope_id = parent_scope_id, + .bind_index = SemIR::CompileTimeBindIndex::Invalid}); + auto import_ref_id = AddImportRef(context, import_inst, impl_entity_name_id); + parent_scope.AddRequired({.name_id = name_id, + .inst_id = import_ref_id, + .access_kind = access_kind}); + return import_ref_id; +} + // Imports entries in a specific scope into the current file. static auto ImportScopeFromApiFile(Context& context, const SemIR::File& api_sem_ir, @@ -310,17 +333,10 @@ static auto ImportScopeFromApiFile(Context& context, .impl_parent_scope_id = impl_scope_id}); } else { // Add an ImportRef for other instructions. - auto impl_entity_name_id = context.entity_names().Add( - {.name_id = impl_name_id, - .parent_scope_id = impl_scope_id, - .bind_index = SemIR::CompileTimeBindIndex::Invalid}); - auto import_ref_id = AddImportRef(context, - {.ir_id = SemIR::ImportIRId::ApiForImpl, - .inst_id = api_entry.inst_id}, - impl_entity_name_id); - impl_scope.AddRequired({.name_id = impl_name_id, - .inst_id = import_ref_id, - .access_kind = api_entry.access_kind}); + AddScopedImportRef(context, impl_scope_id, impl_scope, impl_name_id, + {.ir_id = SemIR::ImportIRId::ApiForImpl, + .inst_id = api_entry.inst_id}, + api_entry.access_kind); } } } @@ -336,11 +352,13 @@ auto ImportApiFile(Context& context, SemIR::TypeId namespace_type_id, SemIR::NameScopeId::Package, todo_scopes); while (!todo_scopes.empty()) { auto todo_scope = todo_scopes.pop_back_val(); - auto impl_scope_id = CopySingleNameScopeFromImportIR( - context, namespace_type_id, /*copied_namespaces=*/nullptr, - SemIR::ImportIRId::ApiForImpl, todo_scope.api_inst_id, - todo_scope.api_scope_id, todo_scope.impl_parent_scope_id, - todo_scope.impl_name_id); + auto impl_scope_id = + CopySingleNameScopeFromImportIR( + context, namespace_type_id, /*copied_namespaces=*/nullptr, + SemIR::ImportIRId::ApiForImpl, todo_scope.api_inst_id, + todo_scope.api_scope_id, todo_scope.impl_parent_scope_id, + todo_scope.impl_name_id) + .first; ImportScopeFromApiFile(context, api_sem_ir, todo_scope.api_scope_id, impl_scope_id, todo_scopes); } @@ -404,9 +422,10 @@ auto ImportLibrariesFromOtherPackage(Context& context, auto name_id = SemIR::NameId::ForIdentifier(package_id); - auto [namespace_scope_id, namespace_const_id, is_duplicate] = AddNamespace( + auto [namespace_scope_id, namespace_inst_id, is_duplicate] = AddNamespace( context, namespace_type_id, name_id, SemIR::NameScopeId::Package, /*diagnose_duplicate_namespace=*/true, [&] { return import_decl_id; }); + auto namespace_const_id = context.constant_values().Get(namespace_inst_id); auto& scope = context.name_scopes().Get(namespace_scope_id); scope.is_closed_import = !is_duplicate; @@ -421,4 +440,146 @@ auto ImportLibrariesFromOtherPackage(Context& context, } } +// Looks up a name in a scope imported from another package. An `identifier` is +// provided if `name_id` corresponds to an identifier in the current file; +// otherwise, `name_id` is file-agnostic and can be used directly. +static auto LookupNameInImport(const SemIR::File& import_ir, + SemIR::NameScopeId import_scope_id, + SemIR::NameId name_id, + llvm::StringRef identifier) + -> const Carbon::SemIR::NameScope::Entry* { + // Determine the NameId in the import IR. + SemIR::NameId import_name_id = name_id; + if (!identifier.empty()) { + auto import_identifier_id = import_ir.identifiers().Lookup(identifier); + if (!import_identifier_id.is_valid()) { + // Name doesn't exist in the import IR. + return nullptr; + } + import_name_id = SemIR::NameId::ForIdentifier(import_identifier_id); + } + + // Look up the name in the import scope. + const auto& import_scope = import_ir.name_scopes().Get(import_scope_id); + auto lookup = import_scope.name_map.Lookup(import_name_id); + if (!lookup) { + // Name doesn't exist in the import scope. + return nullptr; + } + + const auto& import_scope_entry = import_scope.names[lookup.value()]; + if (import_scope_entry.access_kind != SemIR::AccessKind::Public) { + // Ignore cross-package non-public names. + return nullptr; + } + + return &import_scope_entry; +} + +// Adds a namespace that points to one in another package. +static auto AddNamespaceFromOtherPackage(Context& context, + SemIR::ImportIRId import_ir_id, + SemIR::InstId import_inst_id, + SemIR::Namespace import_ns, + SemIR::NameScopeId parent_scope_id, + SemIR::NameId name_id) + -> SemIR::InstId { + auto namespace_type_id = + context.GetBuiltinType(SemIR::BuiltinInstKind::NamespaceType); + auto [new_scope_id, namespace_inst_id] = CopySingleNameScopeFromImportIR( + context, namespace_type_id, /*copied_namespaces=*/nullptr, import_ir_id, + import_inst_id, import_ns.name_scope_id, parent_scope_id, name_id); + context.name_scopes() + .Get(new_scope_id) + .import_ir_scopes.push_back({import_ir_id, import_ns.name_scope_id}); + return namespace_inst_id; +} + +auto ImportNameFromOtherPackage( + Context& context, SemIRLoc loc, SemIR::NameScopeId scope_id, + llvm::ArrayRef> + import_ir_scopes, + SemIR::NameId name_id) -> SemIR::InstId { + // If the name is an identifier, get the string first so that it can be shared + // when there are multiple IRs. + llvm::StringRef identifier; + if (auto identifier_id = name_id.AsIdentifierId(); identifier_id.is_valid()) { + identifier = context.identifiers().Get(identifier_id); + CARBON_CHECK(!identifier.empty()); + } + + // Annotate diagnostics as occurring during this name lookup. + DiagnosticAnnotationScope annotate_diagnostics( + &context.emitter(), [&](auto& builder) { + CARBON_DIAGNOSTIC(InNameLookup, Note, "In name lookup for `{0}`.", + SemIR::NameId); + builder.Note(loc, InNameLookup, name_id); + }); + + // Although we track the result here and look in each IR, we pretty much use + // the first result. + auto result_id = SemIR::InstId::Invalid; + // The canonical IR and inst_id for where `result_id` came from, which may be + // indirectly imported. This is only resolved on a conflict, when it can be + // used to determine the conflict is actually the same instruction. + std::optional canonical_result_inst; + + for (auto [import_ir_id, import_scope_id] : import_ir_scopes) { + auto& import_ir = context.import_irs().Get(import_ir_id); + + const auto* import_scope_entry = LookupNameInImport( + *import_ir.sem_ir, import_scope_id, name_id, identifier); + if (!import_scope_entry) { + continue; + } + auto import_inst = + import_ir.sem_ir->insts().Get(import_scope_entry->inst_id); + if (import_inst.Is()) { + // This entity was added to name lookup by using an import, and is not + // exported. + continue; + } + + // Add the first result found. + if (!result_id.is_valid()) { + // If the imported instruction is a namespace, we add it directly instead + // of as an ImportRef. + if (auto import_ns = import_inst.TryAs()) { + result_id = AddNamespaceFromOtherPackage(context, import_ir_id, + import_scope_entry->inst_id, + *import_ns, scope_id, name_id); + } else { + result_id = AddScopedImportRef( + context, scope_id, context.name_scopes().Get(scope_id), name_id, + {.ir_id = import_ir_id, .inst_id = import_scope_entry->inst_id}, + SemIR::AccessKind::Public); + LoadImportRef(context, result_id); + } + continue; + } + + // When namespaces collide between files, merge lookup in the scopes. + if (auto import_ns = import_inst.TryAs()) { + if (auto ns = context.insts().TryGetAs(result_id)) { + auto& name_scope = context.name_scopes().Get(ns->name_scope_id); + name_scope.import_ir_scopes.push_back( + {import_ir_id, import_ns->name_scope_id}); + continue; + } + } + + // When there's a name collision, they need to either be the same canonical + // instruction, or we'll diagnose. + if (!canonical_result_inst) { + canonical_result_inst = + GetCanonicalImportIRInst(context, &context.sem_ir(), result_id); + } + VerifySameCanonicalImportIRInst(context, result_id, *canonical_result_inst, + import_ir_id, import_ir.sem_ir, + import_scope_entry->inst_id); + } + + return result_id; +} + } // namespace Carbon::Check diff --git a/toolchain/check/import.h b/toolchain/check/import.h index 2c07c0a18fea..e126deab8f83 100644 --- a/toolchain/check/import.h +++ b/toolchain/check/import.h @@ -38,6 +38,23 @@ auto ImportLibrariesFromOtherPackage(Context& context, llvm::ArrayRef import_irs, bool has_load_error) -> void; +// Given a name scope that corresponds to another package (having one or more +// import_irs), looks for the name in imports. Name resolution results are added +// to the scope, and the InstId (possibly invalid) is returned. +// +// In general, this will add an ImportRef and load it; it's never left unloaded +// because the result is expected to be immediately used. Namespaces will be +// directly produced, similar to how they function for imports from the current +// package. Conflicts will be resolved and diagnosed. +// +// Arguments are all in the context of the current IR. Scope lookup is expected +// to be resolved first. +auto ImportNameFromOtherPackage( + Context& context, SemIRLoc loc, SemIR::NameScopeId scope_id, + llvm::ArrayRef> + import_ir_scopes, + SemIR::NameId name_id) -> SemIR::InstId; + } // namespace Carbon::Check #endif // CARBON_TOOLCHAIN_CHECK_IMPORT_H_ diff --git a/toolchain/check/testdata/alias/fail_bool_value.carbon b/toolchain/check/testdata/alias/fail_bool_value.carbon index 4a2b9b71c164..f7befe5beca3 100644 --- a/toolchain/check/testdata/alias/fail_bool_value.carbon +++ b/toolchain/check/testdata/alias/fail_bool_value.carbon @@ -24,17 +24,8 @@ let a_test: bool = a; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .a_test = @__global_init.%a_test -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +34,16 @@ let a_test: bool = a; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .a_test = @__global_init.%a_test +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc14: bool = bool_literal false [template = constants.%.1] // CHECK:STDOUT: %a: = bind_alias a, [template = ] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] diff --git a/toolchain/check/testdata/alias/fail_builtins.carbon b/toolchain/check/testdata/alias/fail_builtins.carbon index 4679d8dcd21b..7b58bb3177cf 100644 --- a/toolchain/check/testdata/alias/fail_builtins.carbon +++ b/toolchain/check/testdata/alias/fail_builtins.carbon @@ -30,18 +30,9 @@ alias b = bool; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +41,17 @@ alias b = bool; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %a: = bind_alias a, [template = ] // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] diff --git a/toolchain/check/testdata/alias/fail_control_flow.carbon b/toolchain/check/testdata/alias/fail_control_flow.carbon index 496d0986f4fb..ba75eaca5e23 100644 --- a/toolchain/check/testdata/alias/fail_control_flow.carbon +++ b/toolchain/check/testdata/alias/fail_control_flow.carbon @@ -28,6 +28,18 @@ alias a = true or false; // CHECK:STDOUT: %.2: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace .inst+1, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: %.loc22: bool = block_arg [template = constants.%.1] // CHECK:STDOUT: %a: = bind_alias a, [template = ] diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/no_prelude/import_access.carbon index 6535f131e2ef..c72f384034fe 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/no_prelude/import_access.carbon @@ -151,16 +151,19 @@ var inst: Test.A = {}; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { +// CHECK:STDOUT: import Test//def +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Test = %Test +// CHECK:STDOUT: .Test = imports.%Test // CHECK:STDOUT: .inst = %inst // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { -// CHECK:STDOUT: import Test//def -// CHECK:STDOUT: } -// CHECK:STDOUT: %Test.ref: = name_ref Test, %Test [template = %Test] +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %A.ref: = name_ref A, [template = ] // CHECK:STDOUT: %inst.var: ref = var inst // CHECK:STDOUT: %inst: ref = bind_name inst, %inst.var diff --git a/toolchain/check/testdata/array/array_in_place.carbon b/toolchain/check/testdata/array/array_in_place.carbon index 3d3693a0e90b..41a9a51dda4c 100644 --- a/toolchain/check/testdata/array/array_in_place.carbon +++ b/toolchain/check/testdata/array/array_in_place.carbon @@ -36,22 +36,8 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -60,6 +46,16 @@ fn G() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/array/array_vs_tuple.carbon b/toolchain/check/testdata/array/array_vs_tuple.carbon index 60c12820ec3b..66c77eb2bcbd 100644 --- a/toolchain/check/testdata/array/array_vs_tuple.carbon +++ b/toolchain/check/testdata/array/array_vs_tuple.carbon @@ -36,19 +36,8 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -57,6 +46,15 @@ fn G() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/array/assign_return_value.carbon b/toolchain/check/testdata/array/assign_return_value.carbon index 48ae52d50076..4b1a4168432a 100644 --- a/toolchain/check/testdata/array/assign_return_value.carbon +++ b/toolchain/check/testdata/array/assign_return_value.carbon @@ -34,18 +34,8 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -54,6 +44,16 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_16.1: %.2 = tuple_literal (%int.make_type_32) diff --git a/toolchain/check/testdata/array/assign_var.carbon b/toolchain/check/testdata/array/assign_var.carbon index 5f83552879e1..b1e19c20cafe 100644 --- a/toolchain/check/testdata/array/assign_var.carbon +++ b/toolchain/check/testdata/array/assign_var.carbon @@ -30,20 +30,8 @@ var b: [i32; 3] = a; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -52,6 +40,16 @@ var b: [i32; 3] = a; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_19: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/array/base.carbon b/toolchain/check/testdata/array/base.carbon index 36a7d6dd11d3..884886506bd4 100644 --- a/toolchain/check/testdata/array/base.carbon +++ b/toolchain/check/testdata/array/base.carbon @@ -45,19 +45,9 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Float = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -66,6 +56,18 @@ var c: [(); 5] = ((), (), (), (), (),); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/array/canonicalize_index.carbon b/toolchain/check/testdata/array/canonicalize_index.carbon index 200c20ed8627..44adce5a07b0 100644 --- a/toolchain/check/testdata/array/canonicalize_index.carbon +++ b/toolchain/check/testdata/array/canonicalize_index.carbon @@ -32,22 +32,8 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .a = %a.loc13 -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -56,6 +42,17 @@ let b: [i32; 3]* = &a; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Add = %Add.decl +// CHECK:STDOUT: .a = %a.loc13 +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/array/fail_bound_negative.carbon b/toolchain/check/testdata/array/fail_bound_negative.carbon index 9e05e81ac875..065151aefa5b 100644 --- a/toolchain/check/testdata/array/fail_bound_negative.carbon +++ b/toolchain/check/testdata/array/fail_bound_negative.carbon @@ -28,19 +28,8 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -49,6 +38,16 @@ var a: [i32; Negate(1)]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] diff --git a/toolchain/check/testdata/array/fail_bound_overflow.carbon b/toolchain/check/testdata/array/fail_bound_overflow.carbon index cae8c4c474d7..205e058148dc 100644 --- a/toolchain/check/testdata/array/fail_bound_overflow.carbon +++ b/toolchain/check/testdata/array/fail_bound_overflow.carbon @@ -36,17 +36,8 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -55,6 +46,16 @@ var b: [1; 39999999999999999993]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_9.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc18_9.2: type = converted %int.make_type_32, %.loc18_9.1 [template = i32] diff --git a/toolchain/check/testdata/array/fail_incomplete_element.carbon b/toolchain/check/testdata/array/fail_incomplete_element.carbon index 70f5cd938b48..e2699c3effe5 100644 --- a/toolchain/check/testdata/array/fail_incomplete_element.carbon +++ b/toolchain/check/testdata/array/fail_incomplete_element.carbon @@ -30,15 +30,8 @@ var p: Incomplete* = &a[0]; // CHECK:STDOUT: %.4: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Incomplete = %Incomplete.decl -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .p = %p -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -47,6 +40,16 @@ var p: Incomplete* = &a[0]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Incomplete = %Incomplete.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .p = %p +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} // CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] // CHECK:STDOUT: %.loc19_21: i32 = int_literal 1 [template = constants.%.1] diff --git a/toolchain/check/testdata/array/fail_invalid_type.carbon b/toolchain/check/testdata/array/fail_invalid_type.carbon index 20a5c2b46cd3..b4a6eef10c6b 100644 --- a/toolchain/check/testdata/array/fail_invalid_type.carbon +++ b/toolchain/check/testdata/array/fail_invalid_type.carbon @@ -19,13 +19,8 @@ var a: [1; 1]; // CHECK:STDOUT: %.1: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -34,6 +29,14 @@ var a: [1; 1]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc14_9: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc14_12: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc14_13: type = array_type %.loc14_12, [template = ] diff --git a/toolchain/check/testdata/array/fail_out_of_bound.carbon b/toolchain/check/testdata/array/fail_out_of_bound.carbon index ddd4df1dd41e..9ad57ebaf317 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound.carbon @@ -28,16 +28,8 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +38,15 @@ var a: [i32; 1] = (1, 2, 3); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon index 4d1cfc1d148d..aaee0b9f57f0 100644 --- a/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon +++ b/toolchain/check/testdata/array/fail_out_of_bound_non_literal.carbon @@ -33,18 +33,8 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -53,6 +43,16 @@ var b: i32 = a[{.index = 3}.index]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/array/fail_type_mismatch.carbon b/toolchain/check/testdata/array/fail_type_mismatch.carbon index 6f671178e8cf..9eba79f71b06 100644 --- a/toolchain/check/testdata/array/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/array/fail_type_mismatch.carbon @@ -58,27 +58,8 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .t1 = %t1 -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: .t2 = %t2 -// CHECK:STDOUT: .d = %d -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -87,6 +68,20 @@ var d: [i32; 3] = t2; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .t1 = %t1 +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .t2 = %t2 +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_14: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] diff --git a/toolchain/check/testdata/array/function_param.carbon b/toolchain/check/testdata/array/function_param.carbon index 3f90be7c7932..9e4046a137a9 100644 --- a/toolchain/check/testdata/array/function_param.carbon +++ b/toolchain/check/testdata/array/function_param.carbon @@ -37,20 +37,8 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -59,6 +47,16 @@ fn G() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17: i32 = int_literal 3 [template = constants.%.2] diff --git a/toolchain/check/testdata/array/generic_empty.carbon b/toolchain/check/testdata/array/generic_empty.carbon index 6bd1cedca78f..74e48924a2f5 100644 --- a/toolchain/check/testdata/array/generic_empty.carbon +++ b/toolchain/check/testdata/array/generic_empty.carbon @@ -26,13 +26,8 @@ fn G(T:! type) { // CHECK:STDOUT: %array: %.3 = tuple_value () [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -41,6 +36,14 @@ fn G(T:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %T.loc11_6.1: type = param T // CHECK:STDOUT: @G.%T.loc11: type = bind_symbolic_name T 0, %T.loc11_6.1 [symbolic = @G.%T.1 (constants.%T)] diff --git a/toolchain/check/testdata/array/index_not_literal.carbon b/toolchain/check/testdata/array/index_not_literal.carbon index 9fd5db75a8bc..d5c55b78fffd 100644 --- a/toolchain/check/testdata/array/index_not_literal.carbon +++ b/toolchain/check/testdata/array/index_not_literal.carbon @@ -30,18 +30,8 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +40,16 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 3 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/array/nine_elements.carbon b/toolchain/check/testdata/array/nine_elements.carbon index e0d46e4d9922..7b8fb2fa215a 100644 --- a/toolchain/check/testdata/array/nine_elements.carbon +++ b/toolchain/check/testdata/array/nine_elements.carbon @@ -33,16 +33,8 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,6 +43,15 @@ var a: [i32; 9] = (1, 2, 3, 4, 5, 6, 7, 8, 9); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 9 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/as/adapter_conversion.carbon b/toolchain/check/testdata/as/adapter_conversion.carbon index 23e90e9c262d..4ded9a1f9d2b 100644 --- a/toolchain/check/testdata/as/adapter_conversion.carbon +++ b/toolchain/check/testdata/as/adapter_conversion.carbon @@ -122,13 +122,22 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .a_ref = %a_ref @@ -138,15 +147,6 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: .b_factory = %b_factory // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %A.ref.loc17: type = name_ref A, %A.decl [template = constants.%A] @@ -254,21 +254,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .n = @__global_init.%n -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -277,6 +264,17 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .n = @__global_init.%n +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] @@ -328,17 +326,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: %struct: %.1 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: .d = @__global_init.%d -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -347,6 +336,18 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .d = @__global_init.%d +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} @@ -415,20 +416,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .b_value = @__global_init.%b_value -// CHECK:STDOUT: .b_init = %b_init -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -437,6 +426,18 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .b_value = @__global_init.%b_value +// CHECK:STDOUT: .b_init = %b_init +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %B.ref.loc13: type = name_ref B, %B.decl [template = constants.%B] @@ -525,18 +526,8 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -545,6 +536,17 @@ var b: B = {.x = 1} as B; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] diff --git a/toolchain/check/testdata/as/as_type.carbon b/toolchain/check/testdata/as/as_type.carbon index cb016fb4018e..192f9dec6aa6 100644 --- a/toolchain/check/testdata/as/as_type.carbon +++ b/toolchain/check/testdata/as/as_type.carbon @@ -21,17 +21,8 @@ let t: type = (i32, i32) as type; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .t = @__global_init.%t -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -40,6 +31,15 @@ let t: type = (i32, i32) as type; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .t = @__global_init.%t +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/as/basic.carbon b/toolchain/check/testdata/as/basic.carbon index fc2fae2815a8..07c3601d7fa4 100644 --- a/toolchain/check/testdata/as/basic.carbon +++ b/toolchain/check/testdata/as/basic.carbon @@ -24,17 +24,8 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +34,15 @@ fn Main() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/as/fail_no_conversion.carbon b/toolchain/check/testdata/as/fail_no_conversion.carbon index ff22e974f46b..6ba3acc455fd 100644 --- a/toolchain/check/testdata/as/fail_no_conversion.carbon +++ b/toolchain/check/testdata/as/fail_no_conversion.carbon @@ -26,19 +26,8 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .n = @__global_init.%n -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -47,6 +36,15 @@ let n: (i32, i32) = 1 as (i32, i32); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .n = @__global_init.%n +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc14_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_17.1: %.2 = tuple_literal (%int.make_type_32.loc14_9, %int.make_type_32.loc14_14) diff --git a/toolchain/check/testdata/as/fail_not_type.carbon b/toolchain/check/testdata/as/fail_not_type.carbon index 1989ddecde1a..a0f59fe3792a 100644 --- a/toolchain/check/testdata/as/fail_not_type.carbon +++ b/toolchain/check/testdata/as/fail_not_type.carbon @@ -24,16 +24,8 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .n = @__global_init.%n -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -42,6 +34,15 @@ let n: i32 = 1 as 2; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .n = @__global_init.%n +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_8.2: type = converted %int.make_type_32, %.loc14_8.1 [template = i32] diff --git a/toolchain/check/testdata/as/identity.carbon b/toolchain/check/testdata/as/identity.carbon index 75810bbf78e6..2605182bcf0f 100644 --- a/toolchain/check/testdata/as/identity.carbon +++ b/toolchain/check/testdata/as/identity.carbon @@ -46,17 +46,8 @@ fn Initializing() { // CHECK:STDOUT: %Initializing: %Initializing.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .X = %X.decl -// CHECK:STDOUT: .Value = %Value.decl -// CHECK:STDOUT: .Reference = %Reference.decl -// CHECK:STDOUT: .Make = %Make.decl -// CHECK:STDOUT: .Initializing = %Initializing.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -65,6 +56,18 @@ fn Initializing() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .X = %X.decl +// CHECK:STDOUT: .Value = %Value.decl +// CHECK:STDOUT: .Reference = %Reference.decl +// CHECK:STDOUT: .Make = %Make.decl +// CHECK:STDOUT: .Initializing = %Initializing.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} // CHECK:STDOUT: %Value.decl: %Value.type = fn_decl @Value [template = constants.%Value] { // CHECK:STDOUT: %X.ref.loc17: type = name_ref X, %X.decl [template = constants.%X] diff --git a/toolchain/check/testdata/basics/builtin_types.carbon b/toolchain/check/testdata/basics/builtin_types.carbon index ebbbf1461cd0..3556e01d82a1 100644 --- a/toolchain/check/testdata/basics/builtin_types.carbon +++ b/toolchain/check/testdata/basics/builtin_types.carbon @@ -29,21 +29,9 @@ var test_type: type = i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .test_i32 = %test_i32 -// CHECK:STDOUT: .test_f64 = %test_f64 -// CHECK:STDOUT: .test_str = @__global_init.%test_str -// CHECK:STDOUT: .test_type = %test_type -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Float = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -52,6 +40,19 @@ var test_type: type = i32; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .test_i32 = %test_i32 +// CHECK:STDOUT: .test_f64 = %test_f64 +// CHECK:STDOUT: .test_str = @__global_init.%test_str +// CHECK:STDOUT: .test_type = %test_type +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_15.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc11_15.2: type = converted %int.make_type_32, %.loc11_15.1 [template = i32] diff --git a/toolchain/check/testdata/basics/fail_bad_run.carbon b/toolchain/check/testdata/basics/fail_bad_run.carbon index e76ccfd7abee..9dd55dc5b36d 100644 --- a/toolchain/check/testdata/basics/fail_bad_run.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run.carbon @@ -26,13 +26,8 @@ fn Run() -> String {} // CHECK:STDOUT: %.2: type = ptr_type String [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -41,6 +36,14 @@ fn Run() -> String {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { // CHECK:STDOUT: @Run.%return: ref String = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_bad_run_2.carbon b/toolchain/check/testdata/basics/fail_bad_run_2.carbon index 068df3189e64..0d8ae5f3718a 100644 --- a/toolchain/check/testdata/basics/fail_bad_run_2.carbon +++ b/toolchain/check/testdata/basics/fail_bad_run_2.carbon @@ -24,16 +24,8 @@ fn Run(n: i32) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -42,6 +34,15 @@ fn Run(n: i32) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon index da5e021ea7fe..070a8a458079 100644 --- a/toolchain/check/testdata/basics/fail_non_type_as_type.carbon +++ b/toolchain/check/testdata/basics/fail_non_type_as_type.carbon @@ -19,13 +19,8 @@ var x: type = 42; // CHECK:STDOUT: %.1: i32 = int_literal 42 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -34,6 +29,14 @@ var x: type = 42; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %x.var: ref type = var x // CHECK:STDOUT: %x: ref type = bind_name x, %x.var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon index 95d3243062ed..ec6b0744341b 100644 --- a/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon +++ b/toolchain/check/testdata/basics/fail_numeric_literal_overflow.carbon @@ -49,24 +49,9 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: .d = @__global_init.%d -// CHECK:STDOUT: .e = @__global_init.%e -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Float = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -75,6 +60,20 @@ let e: f64 = 5.0e39999999999999999993; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: .c = @__global_init.%c +// CHECK:STDOUT: .d = @__global_init.%d +// CHECK:STDOUT: .e = @__global_init.%e +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon index 1f58a54501bc..5fc7bc71a7f7 100644 --- a/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon +++ b/toolchain/check/testdata/basics/fail_qualifier_unsupported.carbon @@ -23,18 +23,8 @@ var y: i32 = x.b; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +33,16 @@ var y: i32 = x.b; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] diff --git a/toolchain/check/testdata/basics/multifile.carbon b/toolchain/check/testdata/basics/multifile.carbon index ae33ffa2febf..7369eb5422f0 100644 --- a/toolchain/check/testdata/basics/multifile.carbon +++ b/toolchain/check/testdata/basics/multifile.carbon @@ -26,13 +26,8 @@ fn B() {} // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -41,6 +36,14 @@ fn B() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -57,13 +60,8 @@ fn B() {} // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -72,6 +70,14 @@ fn B() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon b/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon index dd6a1b2147ad..6ffacea27876 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon @@ -106,7 +106,7 @@ fn B() { // CHECK:STDOUT: import_ir_inst1: {ir_id: ir1, inst_id: inst+1} // CHECK:STDOUT: name_scopes: // CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name1: inst+2, name0: inst+3}} -// CHECK:STDOUT: name_scope1: {inst: inst+2, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope1: {inst: inst+2, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst+8}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope1, index: comp_time_bind} // CHECK:STDOUT: functions: @@ -159,7 +159,8 @@ fn B() { // CHECK:STDOUT: exports: // CHECK:STDOUT: 0: inst+3 // CHECK:STDOUT: import_refs: -// CHECK:STDOUT: 0: inst+8 +// CHECK:STDOUT: 0: inst+2 +// CHECK:STDOUT: 1: inst+8 // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: block4: // CHECK:STDOUT: 0: inst+7 @@ -170,8 +171,7 @@ fn B() { // CHECK:STDOUT: block6: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+1 -// CHECK:STDOUT: 2: inst+2 -// CHECK:STDOUT: 3: inst+3 +// CHECK:STDOUT: 2: inst+3 // CHECK:STDOUT: ... // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon @@ -185,24 +185,25 @@ fn B() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %A: = namespace file.%A.import, [template] { +// CHECK:STDOUT: .A = %import_ref +// CHECK:STDOUT: import A//default +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref: %A.type = import_ref A//default, inst+1, loaded [template = constants.%A] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A +// CHECK:STDOUT: .A = imports.%A // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: } // CHECK:STDOUT: %A.import = import A -// CHECK:STDOUT: %A: = namespace %A.import, [template] { -// CHECK:STDOUT: import A//default -// CHECK:STDOUT: } // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @B() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref.loc6_3: = name_ref A, file.%A [template = file.%A] +// CHECK:STDOUT: %A.ref.loc6_3: = name_ref A, imports.%A [template = imports.%A] // CHECK:STDOUT: %A.ref.loc6_4: %A.type = name_ref A, imports.%import_ref [template = constants.%A] // CHECK:STDOUT: %A.call: init %.1 = call %A.ref.loc6_4() // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon b/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon index d2e51c371da0..5990fdffb75c 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon +++ b/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon @@ -85,7 +85,7 @@ fn B() { // CHECK:STDOUT: import_ir_inst1: {ir_id: ir1, inst_id: inst+1} // CHECK:STDOUT: name_scopes: // CHECK:STDOUT: name_scope0: {inst: inst+0, parent_scope: name_scope, has_error: false, extended_scopes: [], names: {name1: inst+2, name0: inst+3}} -// CHECK:STDOUT: name_scope1: {inst: inst+2, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {}} +// CHECK:STDOUT: name_scope1: {inst: inst+2, parent_scope: name_scope0, has_error: false, extended_scopes: [], names: {name1: inst+8}} // CHECK:STDOUT: entity_names: // CHECK:STDOUT: entity_name0: {name: name1, parent_scope: name_scope1, index: comp_time_bind} // CHECK:STDOUT: functions: @@ -138,7 +138,8 @@ fn B() { // CHECK:STDOUT: exports: // CHECK:STDOUT: 0: inst+3 // CHECK:STDOUT: import_refs: -// CHECK:STDOUT: 0: inst+8 +// CHECK:STDOUT: 0: inst+2 +// CHECK:STDOUT: 1: inst+8 // CHECK:STDOUT: global_init: {} // CHECK:STDOUT: block4: // CHECK:STDOUT: 0: inst+7 @@ -149,6 +150,5 @@ fn B() { // CHECK:STDOUT: block6: // CHECK:STDOUT: 0: inst+0 // CHECK:STDOUT: 1: inst+1 -// CHECK:STDOUT: 2: inst+2 -// CHECK:STDOUT: 3: inst+3 +// CHECK:STDOUT: 2: inst+3 // CHECK:STDOUT: ... diff --git a/toolchain/check/testdata/basics/numeric_literals.carbon b/toolchain/check/testdata/basics/numeric_literals.carbon index f655aeb908ab..89ce18b69138 100644 --- a/toolchain/check/testdata/basics/numeric_literals.carbon +++ b/toolchain/check/testdata/basics/numeric_literals.carbon @@ -67,17 +67,9 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Float = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -86,6 +78,16 @@ fn F() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/parens.carbon b/toolchain/check/testdata/basics/parens.carbon index 6bf93ac7eaa6..9e163a732274 100644 --- a/toolchain/check/testdata/basics/parens.carbon +++ b/toolchain/check/testdata/basics/parens.carbon @@ -22,18 +22,8 @@ var b: i32 = ((2)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -42,6 +32,16 @@ var b: i32 = ((2)); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] diff --git a/toolchain/check/testdata/basics/run.carbon b/toolchain/check/testdata/basics/run.carbon index 563063fd6165..a8eeded6cb04 100644 --- a/toolchain/check/testdata/basics/run.carbon +++ b/toolchain/check/testdata/basics/run.carbon @@ -18,13 +18,8 @@ fn Run() {} // CHECK:STDOUT: %Run: %Run.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -33,6 +28,14 @@ fn Run() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/run_i32.carbon b/toolchain/check/testdata/basics/run_i32.carbon index a5b998738b3e..f0b6c64491a1 100644 --- a/toolchain/check/testdata/basics/run_i32.carbon +++ b/toolchain/check/testdata/basics/run_i32.carbon @@ -22,16 +22,8 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -40,6 +32,15 @@ fn Run() -> i32 { return 0; } // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/basics/type_literals.carbon b/toolchain/check/testdata/basics/type_literals.carbon index 449c6bf83b73..d63824213170 100644 --- a/toolchain/check/testdata/basics/type_literals.carbon +++ b/toolchain/check/testdata/basics/type_literals.carbon @@ -126,20 +126,8 @@ var test_f128: f128; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Core//prelude/types, inst+14, loaded [template = constants.%Int] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+14, loaded [template = constants.%Int] -// CHECK:STDOUT: %import_ref.3: %Int.type = import_ref Core//prelude/types, inst+14, loaded [template = constants.%Int] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .test_i8 = %test_i8 -// CHECK:STDOUT: .test_i16 = %test_i16 -// CHECK:STDOUT: .test_i64 = %test_i64 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -148,6 +136,17 @@ var test_f128: f128; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int.type = import_ref Core//prelude/types, inst+14, loaded [template = constants.%Int] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .test_i8 = %test_i8 +// CHECK:STDOUT: .test_i16 = %test_i16 +// CHECK:STDOUT: .test_i64 = %test_i64 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 8 [template = constants.%.1] // CHECK:STDOUT: %int.make_type_signed.loc3: init type = call constants.%Int(%.loc3_14.1) [template = constants.%.3] // CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_signed.loc3 [template = constants.%.3] @@ -184,23 +183,8 @@ var test_f128: f128; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Core//prelude/types, inst+14, loaded [template = constants.%Int] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Core//prelude/types, inst+14, loaded [template = constants.%Int] -// CHECK:STDOUT: %import_ref.3: %Int.type = import_ref Core//prelude/types, inst+14, loaded [template = constants.%Int] -// CHECK:STDOUT: %import_ref.4: %Int.type = import_ref Core//prelude/types, inst+14, loaded [template = constants.%Int] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .test_i0 = %test_i0 -// CHECK:STDOUT: .test_i1 = %test_i1 -// CHECK:STDOUT: .test_i15 = %test_i15 -// CHECK:STDOUT: .test_i1000000000 = %test_i1000000000 -// CHECK:STDOUT: .test_i10000000000000000000 = %test_i10000000000000000000 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -209,6 +193,19 @@ var test_f128: f128; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int.type = import_ref Core//prelude/types, inst+14, loaded [template = constants.%Int] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .test_i0 = %test_i0 +// CHECK:STDOUT: .test_i1 = %test_i1 +// CHECK:STDOUT: .test_i15 = %test_i15 +// CHECK:STDOUT: .test_i1000000000 = %test_i1000000000 +// CHECK:STDOUT: .test_i10000000000000000000 = %test_i10000000000000000000 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %i0.ref: = name_ref i0, [template = ] // CHECK:STDOUT: %test_i0.var: ref = var test_i0 // CHECK:STDOUT: %test_i0: ref = bind_name test_i0, %test_i0.var @@ -254,20 +251,8 @@ var test_f128: f128; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%UInt] -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%UInt] -// CHECK:STDOUT: %import_ref.3: %UInt.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%UInt] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .test_u8 = %test_u8 -// CHECK:STDOUT: .test_u16 = %test_u16 -// CHECK:STDOUT: .test_u64 = %test_u64 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .UInt = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -276,6 +261,17 @@ var test_f128: f128; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .test_u8 = %test_u8 +// CHECK:STDOUT: .test_u16 = %test_u16 +// CHECK:STDOUT: .test_u64 = %test_u64 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc3_14.1: i32 = int_literal 8 [template = constants.%.1] // CHECK:STDOUT: %int.make_type_unsigned.loc3: init type = call constants.%UInt(%.loc3_14.1) [template = constants.%.3] // CHECK:STDOUT: %.loc3_14.2: type = value_of_initializer %int.make_type_unsigned.loc3 [template = constants.%.3] @@ -312,23 +308,8 @@ var test_f128: f128; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%UInt] -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%UInt] -// CHECK:STDOUT: %import_ref.3: %UInt.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%UInt] -// CHECK:STDOUT: %import_ref.4: %UInt.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%UInt] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .test_u0 = %test_u0 -// CHECK:STDOUT: .test_u1 = %test_u1 -// CHECK:STDOUT: .test_u15 = %test_u15 -// CHECK:STDOUT: .test_u1000000000 = %test_u1000000000 -// CHECK:STDOUT: .test_u10000000000000000000 = %test_u10000000000000000000 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .UInt = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -337,6 +318,19 @@ var test_f128: f128; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %UInt.type = import_ref Core//prelude/types, inst+23, loaded [template = constants.%UInt] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .test_u0 = %test_u0 +// CHECK:STDOUT: .test_u1 = %test_u1 +// CHECK:STDOUT: .test_u15 = %test_u15 +// CHECK:STDOUT: .test_u1000000000 = %test_u1000000000 +// CHECK:STDOUT: .test_u10000000000000000000 = %test_u10000000000000000000 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %u0.ref: = name_ref u0, [template = ] // CHECK:STDOUT: %test_u0.var: ref = var test_u0 // CHECK:STDOUT: %test_u0: ref = bind_name test_u0, %test_u0.var diff --git a/toolchain/check/testdata/builtins/bool/make_type.carbon b/toolchain/check/testdata/builtins/bool/make_type.carbon index f44a2a8350e6..6943ed39b64a 100644 --- a/toolchain/check/testdata/builtins/bool/make_type.carbon +++ b/toolchain/check/testdata/builtins/bool/make_type.carbon @@ -30,13 +30,8 @@ var b: Bool() = false; // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Bool = %Bool.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +40,14 @@ var b: Bool() = false; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Bool = %Bool.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Bool.decl: %Bool.type = fn_decl @Bool [template = constants.%Bool] { // CHECK:STDOUT: @Bool.%return: ref type = var // CHECK:STDOUT: } @@ -63,17 +66,7 @@ var b: Bool() = false; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %Bool.type = import_ref Main//types, inst+4, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Bool = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -82,6 +75,16 @@ var b: Bool() = false; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Bool = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Bool.ref: %Bool.type = name_ref Bool, imports.%import_ref [template = constants.%Bool] // CHECK:STDOUT: %bool.make_type: init type = call %Bool.ref() [template = bool] // CHECK:STDOUT: %.loc6_13.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/check/testdata/builtins/float/add.carbon b/toolchain/check/testdata/builtins/float/add.carbon index aa7ce9394294..37ebfb3a8230 100644 --- a/toolchain/check/testdata/builtins/float/add.carbon +++ b/toolchain/check/testdata/builtins/float/add.carbon @@ -67,24 +67,8 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -93,6 +77,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Add = %Add.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] @@ -190,32 +185,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .TooFew = %TooFew.decl // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl @@ -225,15 +212,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/div.carbon b/toolchain/check/testdata/builtins/float/div.carbon index 634b854c334f..c2bd335cd52e 100644 --- a/toolchain/check/testdata/builtins/float/div.carbon +++ b/toolchain/check/testdata/builtins/float/div.carbon @@ -73,28 +73,8 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.9: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: .a = %a.loc8 -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -103,6 +83,19 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Div = %Div.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .a = %a.loc8 +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: .c = @__global_init.%c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] @@ -222,32 +215,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .TooFew = %TooFew.decl // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl @@ -257,15 +242,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/eq.carbon b/toolchain/check/testdata/builtins/float/eq.carbon index 2e4b0f6a2e0f..27d74beea41d 100644 --- a/toolchain/check/testdata/builtins/float/eq.carbon +++ b/toolchain/check/testdata/builtins/float/eq.carbon @@ -59,25 +59,9 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Eq = %Eq.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -86,6 +70,20 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Eq = %Eq.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Eq.decl: %Eq.type = fn_decl @Eq [template = constants.%Eq] { // CHECK:STDOUT: %.loc2_10.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_10: init type = call constants.%Float(%.loc2_10.1) [template = f64] @@ -216,18 +214,8 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .WrongResult = %WrongResult.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -236,6 +224,15 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .WrongResult = %WrongResult.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %WrongResult.decl: %WrongResult.type = fn_decl @WrongResult [template = constants.%WrongResult] { // CHECK:STDOUT: %.loc7_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%.loc7_19.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/greater.carbon b/toolchain/check/testdata/builtins/float/greater.carbon index 2807be51a227..371d3aee8bad 100644 --- a/toolchain/check/testdata/builtins/float/greater.carbon +++ b/toolchain/check/testdata/builtins/float/greater.carbon @@ -58,28 +58,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Greater = %Greater.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -88,6 +69,21 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Greater = %Greater.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Greater.decl: %Greater.type = fn_decl @Greater [template = constants.%Greater] { // CHECK:STDOUT: %.loc2_15.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_15: init type = call constants.%Float(%.loc2_15.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/greater_eq.carbon b/toolchain/check/testdata/builtins/float/greater_eq.carbon index 473ace235d63..b384b20bb480 100644 --- a/toolchain/check/testdata/builtins/float/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/float/greater_eq.carbon @@ -58,28 +58,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .GreaterEq = %GreaterEq.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -88,6 +69,21 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .GreaterEq = %GreaterEq.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %GreaterEq.decl: %GreaterEq.type = fn_decl @GreaterEq [template = constants.%GreaterEq] { // CHECK:STDOUT: %.loc2_17.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_17: init type = call constants.%Float(%.loc2_17.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/less.carbon b/toolchain/check/testdata/builtins/float/less.carbon index c1d58c13b8d7..cb463da777d3 100644 --- a/toolchain/check/testdata/builtins/float/less.carbon +++ b/toolchain/check/testdata/builtins/float/less.carbon @@ -58,28 +58,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Less = %Less.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -88,6 +69,21 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Less = %Less.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Less.decl: %Less.type = fn_decl @Less [template = constants.%Less] { // CHECK:STDOUT: %.loc2_12.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_12: init type = call constants.%Float(%.loc2_12.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/less_eq.carbon b/toolchain/check/testdata/builtins/float/less_eq.carbon index d7452b153697..ed31da0154fa 100644 --- a/toolchain/check/testdata/builtins/float/less_eq.carbon +++ b/toolchain/check/testdata/builtins/float/less_eq.carbon @@ -58,28 +58,9 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .LessEq = %LessEq.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -88,6 +69,21 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .LessEq = %LessEq.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %LessEq.decl: %LessEq.type = fn_decl @LessEq [template = constants.%LessEq] { // CHECK:STDOUT: %.loc2_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_14: init type = call constants.%Float(%.loc2_14.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/make_type.carbon b/toolchain/check/testdata/builtins/float/make_type.carbon index fa162604fe56..428bd5e08935 100644 --- a/toolchain/check/testdata/builtins/float/make_type.carbon +++ b/toolchain/check/testdata/builtins/float/make_type.carbon @@ -55,16 +55,8 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Float = %Float.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -73,6 +65,15 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Float = %Float.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Float.decl: %Float.type = fn_decl @Float [template = constants.%Float] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_16.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -103,19 +104,8 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+15, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Float = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .f = %f -// CHECK:STDOUT: .GetFloat = %GetFloat.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -124,6 +114,18 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Float = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .f = %f +// CHECK:STDOUT: .GetFloat = %GetFloat.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Float.ref: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] // CHECK:STDOUT: %.loc6_14: i32 = int_literal 64 [template = constants.%.2] // CHECK:STDOUT: %float.make_type: init type = call %Float.ref(%.loc6_14) [template = f64] @@ -176,20 +178,8 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Main//types, inst+15, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Float = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .invalid_float = %invalid_float -// CHECK:STDOUT: .dyn_size = %dyn_size -// CHECK:STDOUT: .dyn = %dyn -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -198,6 +188,19 @@ var dyn: Float(dyn_size); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Float = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .invalid_float = %invalid_float +// CHECK:STDOUT: .dyn_size = %dyn_size +// CHECK:STDOUT: .dyn = %dyn +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Float.ref.loc10: %Float.type = name_ref Float, imports.%import_ref.1 [template = constants.%Float] // CHECK:STDOUT: %.loc10_26: i32 = int_literal 32 [template = constants.%.2] // CHECK:STDOUT: %float.make_type.loc10: init type = call %Float.ref.loc10(%.loc10_26) [template = ] diff --git a/toolchain/check/testdata/builtins/float/mul.carbon b/toolchain/check/testdata/builtins/float/mul.carbon index e56cf13d852d..d14de7f54cba 100644 --- a/toolchain/check/testdata/builtins/float/mul.carbon +++ b/toolchain/check/testdata/builtins/float/mul.carbon @@ -67,24 +67,8 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mul = %Mul.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -93,6 +77,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mul = %Mul.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] @@ -190,32 +185,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .TooFew = %TooFew.decl // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl @@ -225,15 +212,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/negate.carbon b/toolchain/check/testdata/builtins/float/negate.carbon index c6d4e0cb8dc8..8692ce51c1b1 100644 --- a/toolchain/check/testdata/builtins/float/negate.carbon +++ b/toolchain/check/testdata/builtins/float/negate.carbon @@ -87,23 +87,8 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -112,6 +97,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %.loc2_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_14: init type = call constants.%Float(%.loc2_14.1) [template = f64] @@ -201,28 +197,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.9: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.17: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .TooFew = %TooFew.decl // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl @@ -232,15 +224,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %.loc8_16.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8: init type = call constants.%Float(%.loc8_16.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/neq.carbon b/toolchain/check/testdata/builtins/float/neq.carbon index edd4b128b182..67129d16cf9d 100644 --- a/toolchain/check/testdata/builtins/float/neq.carbon +++ b/toolchain/check/testdata/builtins/float/neq.carbon @@ -59,25 +59,9 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Neq = %Neq.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -86,6 +70,20 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Neq = %Neq.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Neq.decl: %Neq.type = fn_decl @Neq [template = constants.%Neq] { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] @@ -216,18 +214,8 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .WrongResult = %WrongResult.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -236,6 +224,15 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .WrongResult = %WrongResult.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %WrongResult.decl: %WrongResult.type = fn_decl @WrongResult [template = constants.%WrongResult] { // CHECK:STDOUT: %.loc7_19.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc7_19: init type = call constants.%Float(%.loc7_19.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/float/sub.carbon b/toolchain/check/testdata/builtins/float/sub.carbon index d9242d16c3ac..22c8f0af1ed6 100644 --- a/toolchain/check/testdata/builtins/float/sub.carbon +++ b/toolchain/check/testdata/builtins/float/sub.carbon @@ -67,24 +67,8 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -93,6 +77,17 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Sub = %Sub.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %.loc2_11.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc2_11: init type = call constants.%Float(%.loc2_11.1) [template = f64] @@ -190,32 +185,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.10: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.11: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.12: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.13: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.14: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.15: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.16: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.17: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.18: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.19: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.20: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .TooFew = %TooFew.decl // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl @@ -225,15 +212,6 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %.loc8_14.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type.loc8_14: init type = call constants.%Float(%.loc8_14.1) [template = f64] diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index 54d35c397bb2..1329e43f1f74 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -37,26 +37,8 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .And = %And.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -65,6 +47,18 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .And = %And.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index 7b75eb0f838b..e36cce8fa38e 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -41,28 +41,8 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Complement = %Complement.decl -// CHECK:STDOUT: .And = %And.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -71,6 +51,19 @@ fn RuntimeCall(a: i32) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Complement = %Complement.decl +// CHECK:STDOUT: .And = %And.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Complement.decl: %Complement.type = fn_decl @Complement [template = constants.%Complement] { // CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index 077b7bc38837..c0a25cc208f1 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -58,25 +58,9 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Eq = %Eq.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -85,6 +69,20 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Eq = %Eq.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Eq.decl: %Eq.type = fn_decl @Eq [template = constants.%Eq] { // CHECK:STDOUT: %int.make_type_32.loc2_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %int.make_type_32.loc2_10 [template = i32] @@ -210,18 +208,8 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .WrongResult = %WrongResult.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -230,6 +218,15 @@ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .WrongResult = %WrongResult.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %WrongResult.decl: %WrongResult.type = fn_decl @WrongResult [template = constants.%WrongResult] { // CHECK:STDOUT: %int.make_type_32.loc7_19: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc7_19.1: type = value_of_initializer %int.make_type_32.loc7_19 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index 55aab396eabf..2e2428b75ac0 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -57,28 +57,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Greater = %Greater.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -87,6 +68,21 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Greater = %Greater.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Greater.decl: %Greater.type = fn_decl @Greater [template = constants.%Greater] { // CHECK:STDOUT: %int.make_type_32.loc2_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_15.1: type = value_of_initializer %int.make_type_32.loc2_15 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index 468ff10294ed..286f36805f3f 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -57,28 +57,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .GreaterEq = %GreaterEq.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -87,6 +68,21 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .GreaterEq = %GreaterEq.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %GreaterEq.decl: %GreaterEq.type = fn_decl @GreaterEq [template = constants.%GreaterEq] { // CHECK:STDOUT: %int.make_type_32.loc2_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %int.make_type_32.loc2_17 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index fa07c55d1e8d..9491b72a7034 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -81,26 +81,8 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .LeftShift = %LeftShift.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -109,6 +91,18 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .LeftShift = %LeftShift.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %LeftShift.decl: %LeftShift.type = fn_decl @LeftShift [template = constants.%LeftShift] { // CHECK:STDOUT: %int.make_type_32.loc2_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_17.1: type = value_of_initializer %int.make_type_32.loc2_17 [template = i32] @@ -203,24 +197,22 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .LeftShift = %LeftShift.decl // CHECK:STDOUT: .Negate = %Negate.decl // CHECK:STDOUT: .size_1 = @__global_init.%size_1 @@ -233,15 +225,6 @@ let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDOUT: .negative = @__global_init.%negative // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %LeftShift.decl: %LeftShift.type = fn_decl @LeftShift [template = constants.%LeftShift] { // CHECK:STDOUT: %int.make_type_32.loc4_17: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_32.loc4_17 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index 2614d0f43f2f..19c7fafb8be4 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -57,28 +57,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Less = %Less.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -87,6 +68,21 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Less = %Less.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Less.decl: %Less.type = fn_decl @Less [template = constants.%Less] { // CHECK:STDOUT: %int.make_type_32.loc2_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_12.1: type = value_of_initializer %int.make_type_32.loc2_12 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 605a650de6fd..849fe02f9f8b 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -57,28 +57,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .LessEq = %LessEq.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -87,6 +68,21 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .LessEq = %LessEq.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %LessEq.decl: %LessEq.type = fn_decl @LessEq [template = constants.%LessEq] { // CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/make_type_32.carbon b/toolchain/check/testdata/builtins/int/make_type_32.carbon index f2db0284b64a..66442138fea4 100644 --- a/toolchain/check/testdata/builtins/int/make_type_32.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_32.carbon @@ -30,13 +30,8 @@ var i: Int() = 0; // CHECK:STDOUT: %Int: %Int.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Int = %Int.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +40,14 @@ var i: Int() = 0; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Int = %Int.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { // CHECK:STDOUT: @Int.%return: ref type = var // CHECK:STDOUT: } @@ -63,17 +66,7 @@ var i: Int() = 0; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %Int.type = import_ref Main//types, inst+4, loaded [template = constants.%Int] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .i = %i -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -82,6 +75,16 @@ var i: Int() = 0; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Int = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .i = %i +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref [template = constants.%Int] // CHECK:STDOUT: %int.make_type_32: init type = call %Int.ref() [template = i32] // CHECK:STDOUT: %.loc6_12.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 33d43c1e09e1..b0c4a1778a3d 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -80,16 +80,8 @@ var m: Int(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Int = %Int.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -98,6 +90,15 @@ var m: Int(1000000000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Int = %Int.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -136,20 +137,8 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+15, loaded [template = constants.%Int] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .Symbolic = %Symbolic.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -158,6 +147,19 @@ var m: Int(1000000000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Int = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .Symbolic = %Symbolic.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Int.ref.loc6_9: %Int.type = name_ref Int, imports.%import_ref.1 [template = constants.%Int] // CHECK:STDOUT: %.loc6_13: i32 = int_literal 64 [template = constants.%.2] @@ -255,17 +257,7 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %Int.type = import_ref Main//types, inst+15, loaded [template = constants.%Int] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .n = %n -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -274,6 +266,16 @@ var m: Int(1000000000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Int = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .n = %n +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref [template = constants.%Int] // CHECK:STDOUT: %.loc10_12: i32 = int_literal 0 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc10_12) [template = ] @@ -301,20 +303,8 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Int.type = import_ref Main//types, inst+15, loaded [template = constants.%Int] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .n = %n.loc12 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -323,6 +313,18 @@ var m: Int(1000000000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Int = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .n = %n.loc12 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] @@ -364,17 +366,7 @@ var m: Int(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %Int.type = import_ref Main//types, inst+15, loaded [template = constants.%Int] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Int = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .m = %m -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -383,6 +375,16 @@ var m: Int(1000000000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Int = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .m = %m +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%import_ref [template = constants.%Int] // CHECK:STDOUT: %.loc9_12: i32 = int_literal 1000000000 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_signed: init type = call %Int.ref(%.loc9_12) [template = ] diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index 370740881c14..2cc311cfbd04 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -80,16 +80,8 @@ var m: UInt(1000000000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .UInt = %UInt.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -98,6 +90,15 @@ var m: UInt(1000000000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .UInt = %UInt.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %UInt.decl: %UInt.type = fn_decl @UInt [template = constants.%UInt] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_12.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -136,20 +137,8 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+15, loaded [template = constants.%UInt] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .Symbolic = %Symbolic.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -158,6 +147,19 @@ var m: UInt(1000000000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .UInt = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .Symbolic = %Symbolic.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %UInt.ref.loc6_9: %UInt.type = name_ref UInt, imports.%import_ref.1 [template = constants.%UInt] // CHECK:STDOUT: %.loc6_14: i32 = int_literal 64 [template = constants.%.2] @@ -255,17 +257,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %UInt.type = import_ref Main//types, inst+15, loaded [template = constants.%UInt] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .n = %n -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -274,6 +266,16 @@ var m: UInt(1000000000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .UInt = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .n = %n +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref [template = constants.%UInt] // CHECK:STDOUT: %.loc10_13: i32 = int_literal 0 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc10_13) [template = ] @@ -301,20 +303,8 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %UInt.type = import_ref Main//types, inst+15, loaded [template = constants.%UInt] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .n = %n.loc12 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -323,6 +313,18 @@ var m: UInt(1000000000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .UInt = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .n = %n.loc12 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc6_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_14.1: type = value_of_initializer %int.make_type_32.loc6_14 [template = i32] @@ -364,17 +366,7 @@ var m: UInt(1000000000); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %UInt.type = import_ref Main//types, inst+15, loaded [template = constants.%UInt] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .UInt = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .m = %m -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -383,6 +375,16 @@ var m: UInt(1000000000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .UInt = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .m = %m +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %UInt.ref: %UInt.type = name_ref UInt, imports.%import_ref [template = constants.%UInt] // CHECK:STDOUT: %.loc9_13: i32 = int_literal 1000000000 [template = constants.%.2] // CHECK:STDOUT: %int.make_type_unsigned: init type = call %UInt.ref(%.loc9_13) [template = ] diff --git a/toolchain/check/testdata/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index ceff2901ea6d..139851962b4b 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -49,25 +49,9 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Neq = %Neq.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -76,6 +60,20 @@ fn RuntimeCall(a: i32, b: i32) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Neq = %Neq.decl +// CHECK:STDOUT: .True = %True.decl +// CHECK:STDOUT: .False = %False.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Neq.decl: %Neq.type = fn_decl @Neq [template = constants.%Neq] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/or.carbon b/toolchain/check/testdata/builtins/int/or.carbon index e520f00d2489..2513ef39c29a 100644 --- a/toolchain/check/testdata/builtins/int/or.carbon +++ b/toolchain/check/testdata/builtins/int/or.carbon @@ -37,26 +37,8 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Or = %Or.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -65,6 +47,18 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Or = %Or.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Or.decl: %Or.type = fn_decl @Or [template = constants.%Or] { // CHECK:STDOUT: %int.make_type_32.loc2_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_10.1: type = value_of_initializer %int.make_type_32.loc2_10 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index 0e4b5fdf7402..bfdad0bb1ff4 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -82,26 +82,8 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .RightShift = %RightShift.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -110,6 +92,18 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .RightShift = %RightShift.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { // CHECK:STDOUT: %int.make_type_32.loc2_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_18.1: type = value_of_initializer %int.make_type_32.loc2_18 [template = i32] @@ -207,29 +201,8 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .RightShift = %RightShift.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .arr1 = %arr1 -// CHECK:STDOUT: .arr1_p = @__global_init.%arr1_p -// CHECK:STDOUT: .arr2 = %arr2 -// CHECK:STDOUT: .arr2_p = @__global_init.%arr2_p -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -238,6 +211,20 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .RightShift = %RightShift.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .arr1 = %arr1 +// CHECK:STDOUT: .arr1_p = @__global_init.%arr1_p +// CHECK:STDOUT: .arr2 = %arr2 +// CHECK:STDOUT: .arr2_p = @__global_init.%arr2_p +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { // CHECK:STDOUT: %int.make_type_32.loc6_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_18.1: type = value_of_initializer %int.make_type_32.loc6_18 [template = i32] @@ -351,29 +338,8 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .RightShift = %RightShift.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .size_1 = @__global_init.%size_1 -// CHECK:STDOUT: .size_2 = @__global_init.%size_2 -// CHECK:STDOUT: .size_3 = @__global_init.%size_3 -// CHECK:STDOUT: .negative = @__global_init.%negative -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -382,6 +348,20 @@ let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .RightShift = %RightShift.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .size_1 = @__global_init.%size_1 +// CHECK:STDOUT: .size_2 = @__global_init.%size_2 +// CHECK:STDOUT: .size_3 = @__global_init.%size_3 +// CHECK:STDOUT: .negative = @__global_init.%negative +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %RightShift.decl: %RightShift.type = fn_decl @RightShift [template = constants.%RightShift] { // CHECK:STDOUT: %int.make_type_32.loc4_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_18.1: type = value_of_initializer %int.make_type_32.loc4_18 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index bf929f46ab93..e538ef5737a8 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -107,26 +107,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -135,6 +117,18 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Add = %Add.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -236,36 +230,24 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.21: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.22: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.23: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.24: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.25: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .TooFew = %TooFew.decl // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl @@ -279,15 +261,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %int.make_type_32.loc8_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %int.make_type_32.loc8_14 [template = i32] @@ -494,22 +467,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -518,6 +477,17 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Add = %Add.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index f290012836dd..8bb4a8331a3e 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -75,26 +75,8 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -103,6 +85,18 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Div = %Div.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -196,31 +190,8 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -229,6 +200,20 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Div = %Div.decl +// CHECK:STDOUT: .Sub = %Sub.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: .c = @__global_init.%c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -360,22 +345,8 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -384,6 +355,17 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Div = %Div.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index 74be1a20e6ca..3e3658c405ec 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -78,26 +78,8 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -106,6 +88,18 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mod = %Mod.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -200,31 +194,8 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -233,6 +204,20 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mod = %Mod.decl +// CHECK:STDOUT: .Sub = %Sub.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: .c = @__global_init.%c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -364,22 +349,8 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -388,6 +359,17 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mod = %Mod.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index d93853637220..a319768b9cce 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -49,26 +49,8 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mul = %Mul.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -77,6 +59,18 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mul = %Mul.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -166,22 +160,8 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mul = %Mul.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -190,6 +170,17 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mul = %Mul.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index 74f403c8b2c8..5b8c0d64cb19 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -135,27 +135,8 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .n = @__global_init.%n -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -164,6 +145,19 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .n = @__global_init.%n +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] @@ -270,32 +264,24 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .TooFew = %TooFew.decl // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl @@ -309,15 +295,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] @@ -502,25 +479,8 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -529,6 +489,18 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .Sub = %Sub.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc4_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32.loc4_14 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index c6a8461d30bc..fa3d025e599e 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -50,26 +50,8 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -78,6 +60,18 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Sub = %Sub.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -168,24 +162,8 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -194,6 +172,18 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Sub = %Sub.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: .c = @__global_init.%c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index e2862aa648db..b1cca2ac9744 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -104,26 +104,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -132,6 +114,18 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Add = %Add.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -233,36 +227,24 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.21: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.22: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.23: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.24: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.25: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .TooFew = %TooFew.decl // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl @@ -276,15 +258,6 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %int.make_type_32.loc8_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_14.1: type = value_of_initializer %int.make_type_32.loc8_14 [template = i32] @@ -491,22 +464,8 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -515,6 +474,17 @@ let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Add = %Add.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index 935f2a4d0a55..0b1b9357d8a8 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -71,26 +71,8 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -99,6 +81,18 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Div = %Div.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -193,31 +187,8 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -226,6 +197,20 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Div = %Div.decl +// CHECK:STDOUT: .Sub = %Sub.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: .c = @__global_init.%c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -357,22 +342,8 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -381,6 +352,17 @@ let b: i32 = Div(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Div = %Div.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Div.decl: %Div.type = fn_decl @Div [template = constants.%Div] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index 303ff3ebf387..9ec86e9b4f80 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -73,26 +73,8 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -101,6 +83,18 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mod = %Mod.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -195,31 +189,8 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -228,6 +199,20 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mod = %Mod.decl +// CHECK:STDOUT: .Sub = %Sub.decl +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: .c = @__global_init.%c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] @@ -359,22 +344,8 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -383,6 +354,17 @@ let b: i32 = Mod(0, 0); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mod = %Mod.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mod.decl: %Mod.type = fn_decl @Mod [template = constants.%Mod] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/umul.carbon b/toolchain/check/testdata/builtins/int/umul.carbon index fbe002e06250..219a40a3c479 100644 --- a/toolchain/check/testdata/builtins/int/umul.carbon +++ b/toolchain/check/testdata/builtins/int/umul.carbon @@ -46,26 +46,8 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mul = %Mul.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -74,6 +56,18 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mul = %Mul.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -163,22 +157,8 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mul = %Mul.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -187,6 +167,17 @@ let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mul = %Mul.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mul.decl: %Mul.type = fn_decl @Mul [template = constants.%Mul] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index c58e831f3b98..4ed7f168394e 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -131,27 +131,8 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .n = @__global_init.%n -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -160,6 +141,19 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .n = @__global_init.%n +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc2_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_14.1: type = value_of_initializer %int.make_type_32.loc2_14 [template = i32] @@ -266,32 +260,24 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.19: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.20: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .TooFew = %TooFew.decl // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl @@ -305,15 +291,6 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { // CHECK:STDOUT: %int.make_type_32.loc8: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc8_16.1: type = value_of_initializer %int.make_type_32.loc8 [template = i32] @@ -498,25 +475,8 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -525,6 +485,18 @@ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Negate = %Negate.decl +// CHECK:STDOUT: .Sub = %Sub.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Negate.decl: %Negate.type = fn_decl @Negate [template = constants.%Negate] { // CHECK:STDOUT: %int.make_type_32.loc4_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32.loc4_14 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/usub.carbon b/toolchain/check/testdata/builtins/int/usub.carbon index 24f5108bfaaa..5d20bb25721e 100644 --- a/toolchain/check/testdata/builtins/int/usub.carbon +++ b/toolchain/check/testdata/builtins/int/usub.carbon @@ -47,26 +47,8 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -75,6 +57,18 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Sub = %Sub.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] @@ -165,24 +159,8 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -191,6 +169,18 @@ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Sub = %Sub.decl +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: .c = @__global_init.%c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Sub.decl: %Sub.type = fn_decl @Sub [template = constants.%Sub] { // CHECK:STDOUT: %int.make_type_32.loc4_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/int/xor.carbon b/toolchain/check/testdata/builtins/int/xor.carbon index 2deea7ee5059..88838ffe9724 100644 --- a/toolchain/check/testdata/builtins/int/xor.carbon +++ b/toolchain/check/testdata/builtins/int/xor.carbon @@ -37,26 +37,8 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Xor = %Xor.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -65,6 +47,18 @@ fn RuntimeCall(a: i32, b: i32) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Xor = %Xor.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .arr_p = @__global_init.%arr_p +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Xor.decl: %Xor.type = fn_decl @Xor [template = constants.%Xor] { // CHECK:STDOUT: %int.make_type_32.loc2_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_11.1: type = value_of_initializer %int.make_type_32.loc2_11 [template = i32] diff --git a/toolchain/check/testdata/builtins/print.carbon b/toolchain/check/testdata/builtins/print.carbon index a11322c37536..f021aad05115 100644 --- a/toolchain/check/testdata/builtins/print.carbon +++ b/toolchain/check/testdata/builtins/print.carbon @@ -33,18 +33,9 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Print.type.2 = import_ref Core//prelude, inst+43, loaded [template = constants.%Print.2] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Print = %Print.decl -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Print = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -53,6 +44,17 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Print.type.2 = import_ref Core//prelude, inst+43, loaded [template = constants.%Print.2] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Print = %Print.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Print.decl: %Print.type.1 = fn_decl @Print.1 [template = constants.%Print.1] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -72,7 +74,7 @@ fn Main() { // CHECK:STDOUT: %Print.ref.loc14: %Print.type.1 = name_ref Print, file.%Print.decl [template = constants.%Print.1] // CHECK:STDOUT: %.loc14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %print.int.loc14: init %.1 = call %Print.ref.loc14(%.loc14) -// CHECK:STDOUT: %Core.ref: = name_ref Core, file.%Core [template = file.%Core] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Print.ref.loc16: %Print.type.2 = name_ref Print, imports.%import_ref.2 [template = constants.%Print.2] // CHECK:STDOUT: %.loc16: i32 = int_literal 2 [template = constants.%.3] // CHECK:STDOUT: %print.int.loc16: init %.1 = call %Print.ref.loc16(%.loc16) diff --git a/toolchain/check/testdata/class/adapt.carbon b/toolchain/check/testdata/class/adapt.carbon index e374278ccbe2..83a53dd8c07b 100644 --- a/toolchain/check/testdata/class/adapt.carbon +++ b/toolchain/check/testdata/class/adapt.carbon @@ -60,21 +60,8 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .SomeClass = %SomeClass.decl -// CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl -// CHECK:STDOUT: .StructAdapter = %StructAdapter.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -83,6 +70,17 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .SomeClass = %SomeClass.decl +// CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl +// CHECK:STDOUT: .StructAdapter = %StructAdapter.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} // CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} // CHECK:STDOUT: %StructAdapter.decl: type = class_decl @StructAdapter [template = constants.%StructAdapter] {} @@ -142,15 +140,8 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Adapted = %Adapted.decl -// CHECK:STDOUT: .AdaptNotExtend = %AdaptNotExtend.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -159,6 +150,16 @@ fn F(a: AdaptNotExtend) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Adapted = %Adapted.decl +// CHECK:STDOUT: .AdaptNotExtend = %AdaptNotExtend.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Adapted.decl: type = class_decl @Adapted [template = constants.%Adapted] {} // CHECK:STDOUT: %AdaptNotExtend.decl: type = class_decl @AdaptNotExtend [template = constants.%AdaptNotExtend] {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { diff --git a/toolchain/check/testdata/class/base.carbon b/toolchain/check/testdata/class/base.carbon index d73a8d437d3b..ec02ce127f41 100644 --- a/toolchain/check/testdata/class/base.carbon +++ b/toolchain/check/testdata/class/base.carbon @@ -58,22 +58,8 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Base = %Base.decl -// CHECK:STDOUT: .Derived = %Derived.decl -// CHECK:STDOUT: .Make = %Make.decl -// CHECK:STDOUT: .Access = %Access.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -82,6 +68,18 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .Derived = %Derived.decl +// CHECK:STDOUT: .Make = %Make.decl +// CHECK:STDOUT: .Access = %Access.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { diff --git a/toolchain/check/testdata/class/base_field.carbon b/toolchain/check/testdata/class/base_field.carbon index 6c025c7fa4c1..cbd36c7cd58b 100644 --- a/toolchain/check/testdata/class/base_field.carbon +++ b/toolchain/check/testdata/class/base_field.carbon @@ -49,23 +49,8 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Base = %Base.decl -// CHECK:STDOUT: .Derived = %Derived.decl -// CHECK:STDOUT: .Access = %Access.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -74,6 +59,17 @@ fn Access(p: Derived*) -> i32* { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .Derived = %Derived.decl +// CHECK:STDOUT: .Access = %Access.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] { diff --git a/toolchain/check/testdata/class/base_function_unqualified.carbon b/toolchain/check/testdata/class/base_function_unqualified.carbon index e8315f6516ee..d7f6b4d20850 100644 --- a/toolchain/check/testdata/class/base_function_unqualified.carbon +++ b/toolchain/check/testdata/class/base_function_unqualified.carbon @@ -41,14 +41,8 @@ fn Derived.H() { // CHECK:STDOUT: %.5: type = struct_type {.base: %Base} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Base = %Base.decl -// CHECK:STDOUT: .Derived = %Derived.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -57,6 +51,15 @@ fn Derived.H() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .Derived = %Derived.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} diff --git a/toolchain/check/testdata/class/base_method.carbon b/toolchain/check/testdata/class/base_method.carbon index edb7a0c87c9e..816ff9af0125 100644 --- a/toolchain/check/testdata/class/base_method.carbon +++ b/toolchain/check/testdata/class/base_method.carbon @@ -51,18 +51,8 @@ fn Call(p: Derived*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Base = %Base.decl -// CHECK:STDOUT: .Derived = %Derived.decl -// CHECK:STDOUT: .Call = %Call.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -71,6 +61,17 @@ fn Call(p: Derived*) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .Derived = %Derived.decl +// CHECK:STDOUT: .Call = %Call.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Base [template = constants.%Base] diff --git a/toolchain/check/testdata/class/base_method_qualified.carbon b/toolchain/check/testdata/class/base_method_qualified.carbon index 7ad8d28e7b0c..e2ac1744f5d1 100644 --- a/toolchain/check/testdata/class/base_method_qualified.carbon +++ b/toolchain/check/testdata/class/base_method_qualified.carbon @@ -72,26 +72,8 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Derived = %Derived.decl.loc11 -// CHECK:STDOUT: .Base = %Base.decl -// CHECK:STDOUT: .Call = %Call.decl -// CHECK:STDOUT: .CallIndirect = %CallIndirect.decl -// CHECK:STDOUT: .PassDerivedToBase = %PassDerivedToBase.decl -// CHECK:STDOUT: .PassDerivedToBaseIndirect = %PassDerivedToBaseIndirect.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -100,6 +82,20 @@ fn PassDerivedToBaseIndirect(p: Derived*) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Derived = %Derived.decl.loc11 +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .Call = %Call.decl +// CHECK:STDOUT: .CallIndirect = %CallIndirect.decl +// CHECK:STDOUT: .PassDerivedToBase = %PassDerivedToBase.decl +// CHECK:STDOUT: .PassDerivedToBaseIndirect = %PassDerivedToBaseIndirect.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Derived.decl.loc11: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl.loc18: type = class_decl @Derived [template = constants.%Derived] {} diff --git a/toolchain/check/testdata/class/base_method_shadow.carbon b/toolchain/check/testdata/class/base_method_shadow.carbon index 1f8fac616235..172ec56cc07d 100644 --- a/toolchain/check/testdata/class/base_method_shadow.carbon +++ b/toolchain/check/testdata/class/base_method_shadow.carbon @@ -66,17 +66,8 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: %.16: type = ptr_type %.12 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: .Call = %Call.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -85,6 +76,18 @@ fn Call(a: A*, b: B*, c: C*, d: D*) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .Call = %Call.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} diff --git a/toolchain/check/testdata/class/basic.carbon b/toolchain/check/testdata/class/basic.carbon index dcf67f629e56..aa86e2b5900a 100644 --- a/toolchain/check/testdata/class/basic.carbon +++ b/toolchain/check/testdata/class/basic.carbon @@ -46,24 +46,8 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -72,6 +56,16 @@ fn Run() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc21_15: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/class/complete_in_member_fn.carbon b/toolchain/check/testdata/class/complete_in_member_fn.carbon index 5fcf2b10a43a..4b2e5f18ca65 100644 --- a/toolchain/check/testdata/class/complete_in_member_fn.carbon +++ b/toolchain/check/testdata/class/complete_in_member_fn.carbon @@ -29,17 +29,8 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -48,6 +39,15 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/compound_field.carbon b/toolchain/check/testdata/class/compound_field.carbon index 69ec672ea4bb..fd0b29280330 100644 --- a/toolchain/check/testdata/class/compound_field.carbon +++ b/toolchain/check/testdata/class/compound_field.carbon @@ -67,29 +67,8 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Base = %Base.decl -// CHECK:STDOUT: .Derived = %Derived.decl -// CHECK:STDOUT: .AccessDerived = %AccessDerived.decl -// CHECK:STDOUT: .AccessBase = %AccessBase.decl -// CHECK:STDOUT: .AccessDerivedIndirect = %AccessDerivedIndirect.decl -// CHECK:STDOUT: .AccessBaseIndirect = %AccessBaseIndirect.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -98,6 +77,20 @@ fn AccessBaseIndirect(p: Derived*) -> i32* { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .Derived = %Derived.decl +// CHECK:STDOUT: .AccessDerived = %AccessDerived.decl +// CHECK:STDOUT: .AccessBase = %AccessBase.decl +// CHECK:STDOUT: .AccessDerivedIndirect = %AccessDerivedIndirect.decl +// CHECK:STDOUT: .AccessBaseIndirect = %AccessBaseIndirect.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %AccessDerived.decl: %AccessDerived.type = fn_decl @AccessDerived [template = constants.%AccessDerived] { diff --git a/toolchain/check/testdata/class/cross_package_import.carbon b/toolchain/check/testdata/class/cross_package_import.carbon index d3383d074a88..27d246381b8e 100644 --- a/toolchain/check/testdata/class/cross_package_import.carbon +++ b/toolchain/check/testdata/class/cross_package_import.carbon @@ -116,13 +116,8 @@ var c: Other.C = {}; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -131,6 +126,14 @@ var c: Other.C = {}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -145,13 +148,8 @@ var c: Other.C = {}; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -160,6 +158,14 @@ var c: Other.C = {}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -173,13 +179,8 @@ var c: Other.C = {}; // CHECK:STDOUT: %C: %C.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -188,6 +189,14 @@ var c: Other.C = {}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -207,19 +216,7 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//define, inst+4, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -228,10 +225,23 @@ var c: Other.C = {}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//define // CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//define, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//define, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var @@ -259,18 +269,7 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: type = import_ref Other//extern, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -279,10 +278,22 @@ var c: Other.C = {}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref // CHECK:STDOUT: import Other//extern // CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %import_ref: type = import_ref Other//extern, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref [template = constants.%C] // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var @@ -308,20 +319,7 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//define, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//extern, inst+3, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -330,11 +328,25 @@ var c: Other.C = {}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//define // CHECK:STDOUT: import Other//extern // CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//define, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//define, inst+4, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Other//extern, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var @@ -365,20 +377,7 @@ var c: Other.C = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//define, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//define, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//conflict, inst+3, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -387,11 +386,25 @@ var c: Other.C = {}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//define // CHECK:STDOUT: import Other//conflict // CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//define, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//define, inst+4, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Other//conflict, inst+3, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var diff --git a/toolchain/check/testdata/class/derived_to_base.carbon b/toolchain/check/testdata/class/derived_to_base.carbon index 40f96fd281c3..dfa6906a812f 100644 --- a/toolchain/check/testdata/class/derived_to_base.carbon +++ b/toolchain/check/testdata/class/derived_to_base.carbon @@ -88,14 +88,22 @@ fn ConvertInit() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .C = %C.decl @@ -107,15 +115,6 @@ fn ConvertInit() { // CHECK:STDOUT: .ConvertInit = %ConvertInit.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} diff --git a/toolchain/check/testdata/class/extend_adapt.carbon b/toolchain/check/testdata/class/extend_adapt.carbon index c01f548774e3..9b9c4d94801e 100644 --- a/toolchain/check/testdata/class/extend_adapt.carbon +++ b/toolchain/check/testdata/class/extend_adapt.carbon @@ -112,20 +112,8 @@ class StructAdapter { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl.loc4 -// CHECK:STDOUT: .SomeClass = %SomeClass.decl -// CHECK:STDOUT: .TestStaticMemberFunction = %TestStaticMemberFunction.decl -// CHECK:STDOUT: .TestAdapterMethod = %TestAdapterMethod.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -134,6 +122,18 @@ class StructAdapter { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl.loc4 +// CHECK:STDOUT: .SomeClass = %SomeClass.decl +// CHECK:STDOUT: .TestStaticMemberFunction = %TestStaticMemberFunction.decl +// CHECK:STDOUT: .TestAdapterMethod = %TestAdapterMethod.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %SomeClassAdapter.decl.loc4: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} // CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} // CHECK:STDOUT: %SomeClassAdapter.decl.loc15: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} @@ -219,15 +219,8 @@ class StructAdapter { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .SomeClass = %SomeClass.decl -// CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -236,6 +229,16 @@ class StructAdapter { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .SomeClass = %SomeClass.decl +// CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} // CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { @@ -293,20 +296,8 @@ class StructAdapter { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .SomeClass = %SomeClass.decl -// CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -315,6 +306,17 @@ class StructAdapter { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .SomeClass = %SomeClass.decl +// CHECK:STDOUT: .SomeClassAdapter = %SomeClassAdapter.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %SomeClass.decl: type = class_decl @SomeClass [template = constants.%SomeClass] {} // CHECK:STDOUT: %SomeClassAdapter.decl: type = class_decl @SomeClassAdapter [template = constants.%SomeClassAdapter] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { @@ -375,17 +377,8 @@ class StructAdapter { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .StructAdapter = %StructAdapter.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -394,6 +387,15 @@ class StructAdapter { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .StructAdapter = %StructAdapter.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %StructAdapter.decl: type = class_decl @StructAdapter [template = constants.%StructAdapter] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/extern.carbon b/toolchain/check/testdata/class/extern.carbon index 4fab3f5d07e6..7dfc8a5511d3 100644 --- a/toolchain/check/testdata/class/extern.carbon +++ b/toolchain/check/testdata/class/extern.carbon @@ -276,13 +276,8 @@ extern class C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -291,6 +286,14 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -302,13 +305,8 @@ extern class C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -317,6 +315,14 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -328,13 +334,8 @@ extern class C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -343,6 +344,14 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -355,13 +364,8 @@ extern class C; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -370,6 +374,14 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -387,13 +399,8 @@ extern class C; // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -402,6 +409,14 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} // CHECK:STDOUT: } @@ -417,13 +432,8 @@ extern class C; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -432,6 +442,14 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -446,13 +464,8 @@ extern class C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -461,6 +474,14 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } @@ -473,13 +494,8 @@ extern class C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -488,6 +504,14 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } @@ -502,13 +526,8 @@ extern class C; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -517,6 +536,14 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -537,13 +564,8 @@ extern class C; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -552,6 +574,14 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %C.decl.loc5: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } @@ -567,13 +597,8 @@ extern class C; // CHECK:STDOUT: %C: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -582,6 +607,14 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } @@ -593,16 +626,7 @@ extern class C; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, inst+3, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Main//decl, inst+3, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -613,21 +637,21 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_decl_then_extern_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//decl, inst+3, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_decl, inst+3, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -638,21 +662,21 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_extern_decl_then_def.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, inst+3, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Main//def, inst+3, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -663,22 +687,22 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_ownership_conflict.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, inst+3, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Main//decl, inst+3, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Main//def, inst+3, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -689,21 +713,21 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_import_extern_decl_copy.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_decl, inst+3, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_decl_copy, inst+3, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -714,6 +738,15 @@ extern class C; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- extern_decl_after_import_extern_decl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -722,16 +755,7 @@ extern class C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: type = import_ref Main//extern_decl, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -740,6 +764,15 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -753,16 +786,7 @@ extern class C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: type = import_ref Main//decl, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -771,6 +795,15 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -785,17 +818,7 @@ extern class C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//def, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//def, inst+4, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -804,6 +827,16 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2 = import_ref Main//def, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -821,17 +854,7 @@ extern class C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//def, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//def, inst+4, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -840,6 +863,16 @@ extern class C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2 = import_ref Main//def, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_abstract.carbon b/toolchain/check/testdata/class/fail_abstract.carbon index 890315c37de3..2ce28ef8469d 100644 --- a/toolchain/check/testdata/class/fail_abstract.carbon +++ b/toolchain/check/testdata/class/fail_abstract.carbon @@ -60,22 +60,8 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Abstract = %Abstract.decl -// CHECK:STDOUT: .Derived = %Derived.decl -// CHECK:STDOUT: .Make = %Make.decl -// CHECK:STDOUT: .Access = %Access.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -84,6 +70,18 @@ fn Access(d: Derived) -> (i32, i32) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Abstract = %Abstract.decl +// CHECK:STDOUT: .Derived = %Derived.decl +// CHECK:STDOUT: .Make = %Make.decl +// CHECK:STDOUT: .Access = %Access.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { diff --git a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon index 8e4ea7d9b7df..631c69a8205b 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_decl.carbon @@ -106,14 +106,8 @@ class C { // CHECK:STDOUT: %Use: %Use.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Bad = %Bad.decl -// CHECK:STDOUT: .Use = %Use.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -122,6 +116,15 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Bad = %Bad.decl +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Bad.decl: type = class_decl @Bad [template = constants.%Bad] {} // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { // CHECK:STDOUT: %Bad.ref: type = name_ref Bad, %Bad.decl [template = constants.%Bad] @@ -155,14 +158,8 @@ class C { // CHECK:STDOUT: %Use: %Use.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Bad = %Bad.decl -// CHECK:STDOUT: .Use = %Use.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -171,6 +168,15 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Bad = %Bad.decl +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Bad.decl: type = class_decl @Bad [template = constants.%Bad] {} // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { // CHECK:STDOUT: %Bad.ref: type = name_ref Bad, %Bad.decl [template = constants.%Bad] @@ -204,14 +210,8 @@ class C { // CHECK:STDOUT: %MultipleAdaptsSameType: type = class_type @MultipleAdaptsSameType [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .MultipleAdapts = %MultipleAdapts.decl -// CHECK:STDOUT: .MultipleAdaptsSameType = %MultipleAdaptsSameType.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -220,6 +220,15 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .MultipleAdapts = %MultipleAdapts.decl +// CHECK:STDOUT: .MultipleAdaptsSameType = %MultipleAdaptsSameType.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %MultipleAdapts.decl: type = class_decl @MultipleAdapts [template = constants.%MultipleAdapts] {} // CHECK:STDOUT: %MultipleAdaptsSameType.decl: type = class_decl @MultipleAdaptsSameType [template = constants.%MultipleAdaptsSameType] {} // CHECK:STDOUT: } @@ -255,14 +264,8 @@ class C { // CHECK:STDOUT: %Self.2: %.3 = bind_symbolic_name Self 0 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -271,6 +274,15 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc8: %.1 = struct_literal () // CHECK:STDOUT: %I.decl: type = interface_decl @I.1 [template = constants.%.2] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} diff --git a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon index 61949829bdbd..1d9badbf82fa 100644 --- a/toolchain/check/testdata/class/fail_adapt_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_adapt_bad_type.carbon @@ -31,14 +31,8 @@ class AdaptIncomplete { // CHECK:STDOUT: %AdaptIncomplete: type = class_type @AdaptIncomplete [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Incomplete = %Incomplete.decl -// CHECK:STDOUT: .AdaptIncomplete = %AdaptIncomplete.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -47,6 +41,15 @@ class AdaptIncomplete { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Incomplete = %Incomplete.decl +// CHECK:STDOUT: .AdaptIncomplete = %AdaptIncomplete.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} // CHECK:STDOUT: %AdaptIncomplete.decl: type = class_decl @AdaptIncomplete [template = constants.%AdaptIncomplete] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon index fa815fe8af2d..b20a4292563b 100644 --- a/toolchain/check/testdata/class/fail_adapt_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_adapt_modifiers.carbon @@ -69,18 +69,8 @@ class C5 { // CHECK:STDOUT: %C5: type = class_type @C5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C1 = %C1.decl -// CHECK:STDOUT: .C2 = %C2.decl -// CHECK:STDOUT: .C3 = %C3.decl -// CHECK:STDOUT: .C4 = %C4.decl -// CHECK:STDOUT: .C5 = %C5.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -89,6 +79,19 @@ class C5 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C1 = %C1.decl +// CHECK:STDOUT: .C2 = %C2.decl +// CHECK:STDOUT: .C3 = %C3.decl +// CHECK:STDOUT: .C4 = %C4.decl +// CHECK:STDOUT: .C5 = %C5.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C1.decl: type = class_decl @C1 [template = constants.%C1] {} // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} diff --git a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon index e03664f31a99..5791597494a2 100644 --- a/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon +++ b/toolchain/check/testdata/class/fail_adapt_with_subobjects.carbon @@ -88,17 +88,8 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Base = %Base.decl -// CHECK:STDOUT: .AdaptWithBase = %AdaptWithBase.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -107,6 +98,16 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .AdaptWithBase = %AdaptWithBase.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %AdaptWithBase.decl: type = class_decl @AdaptWithBase [template = constants.%AdaptWithBase] {} // CHECK:STDOUT: } @@ -145,22 +146,8 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .AdaptWithField = %AdaptWithField.decl -// CHECK:STDOUT: .AdaptWithFields = %AdaptWithFields.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -169,6 +156,16 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .AdaptWithField = %AdaptWithField.decl +// CHECK:STDOUT: .AdaptWithFields = %AdaptWithFields.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %AdaptWithField.decl: type = class_decl @AdaptWithField [template = constants.%AdaptWithField] {} // CHECK:STDOUT: %AdaptWithFields.decl: type = class_decl @AdaptWithFields [template = constants.%AdaptWithFields] {} // CHECK:STDOUT: } @@ -230,17 +227,8 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Base = %Base.decl -// CHECK:STDOUT: .AdaptWithBaseAndFields = %AdaptWithBaseAndFields.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -249,6 +237,16 @@ class AdaptWithBaseAndFields { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .AdaptWithBaseAndFields = %AdaptWithBaseAndFields.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %AdaptWithBaseAndFields.decl: type = class_decl @AdaptWithBaseAndFields [template = constants.%AdaptWithBaseAndFields] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_addr_not_self.carbon b/toolchain/check/testdata/class/fail_addr_not_self.carbon index 5733016b22c8..036ed7cddeaf 100644 --- a/toolchain/check/testdata/class/fail_addr_not_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_not_self.carbon @@ -34,13 +34,8 @@ class Class { // CHECK:STDOUT: %.3: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -49,6 +44,14 @@ class Class { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_addr_self.carbon b/toolchain/check/testdata/class/fail_addr_self.carbon index 01ed05705af2..b064765a39f0 100644 --- a/toolchain/check/testdata/class/fail_addr_self.carbon +++ b/toolchain/check/testdata/class/fail_addr_self.carbon @@ -60,14 +60,8 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: %.4: type = ptr_type %.3 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -76,6 +70,15 @@ fn F(c: Class, p: Class*) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %Class.ref.loc16_9: type = name_ref Class, %Class.decl [template = constants.%Class] diff --git a/toolchain/check/testdata/class/fail_base_bad_type.carbon b/toolchain/check/testdata/class/fail_base_bad_type.carbon index c729b875cd12..8df97e0fca5b 100644 --- a/toolchain/check/testdata/class/fail_base_bad_type.carbon +++ b/toolchain/check/testdata/class/fail_base_bad_type.carbon @@ -203,26 +203,22 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Base = %Base.decl // CHECK:STDOUT: .Final = %Final.decl // CHECK:STDOUT: .DeriveFromError = %DeriveFromError.decl @@ -248,15 +244,6 @@ fn AccessMemberWithInvalidBaseFinal_NoMember(p: DeriveFromFinal*) -> i32 { // CHECK:STDOUT: .AccessMemberWithInvalidBaseFinal_NoMember = %AccessMemberWithInvalidBaseFinal_NoMember.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Final.decl: type = class_decl @Final [template = constants.%Final] {} // CHECK:STDOUT: %DeriveFromError.decl: type = class_decl @DeriveFromError [template = constants.%DeriveFromError] {} diff --git a/toolchain/check/testdata/class/fail_base_method_define.carbon b/toolchain/check/testdata/class/fail_base_method_define.carbon index 43267aca7334..3495921af1f7 100644 --- a/toolchain/check/testdata/class/fail_base_method_define.carbon +++ b/toolchain/check/testdata/class/fail_base_method_define.carbon @@ -52,14 +52,8 @@ fn D.C.F() {} // CHECK:STDOUT: %.6: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -68,6 +62,15 @@ fn D.C.F() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} // CHECK:STDOUT: %F.decl: %F.type.3 = fn_decl @F.3 [template = constants.%F.3] {} diff --git a/toolchain/check/testdata/class/fail_base_modifiers.carbon b/toolchain/check/testdata/class/fail_base_modifiers.carbon index ea71a0fbd796..6aa98311fc15 100644 --- a/toolchain/check/testdata/class/fail_base_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_base_modifiers.carbon @@ -69,17 +69,8 @@ class C4 { // CHECK:STDOUT: %.8: type = unbound_element_type %C4, %B [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C1 = %C1.decl -// CHECK:STDOUT: .C2 = %C2.decl -// CHECK:STDOUT: .C3 = %C3.decl -// CHECK:STDOUT: .C4 = %C4.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -88,6 +79,18 @@ class C4 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C1 = %C1.decl +// CHECK:STDOUT: .C2 = %C2.decl +// CHECK:STDOUT: .C3 = %C3.decl +// CHECK:STDOUT: .C4 = %C4.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C1.decl: type = class_decl @C1 [template = constants.%C1] {} // CHECK:STDOUT: %C2.decl: type = class_decl @C2 [template = constants.%C2] {} diff --git a/toolchain/check/testdata/class/fail_base_no_extend.carbon b/toolchain/check/testdata/class/fail_base_no_extend.carbon index 92b9a1065b94..d75a752da445 100644 --- a/toolchain/check/testdata/class/fail_base_no_extend.carbon +++ b/toolchain/check/testdata/class/fail_base_no_extend.carbon @@ -29,14 +29,8 @@ class C { // CHECK:STDOUT: %.5: type = struct_type {.base: %B} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +39,15 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_base_repeated.carbon b/toolchain/check/testdata/class/fail_base_repeated.carbon index 4d710ad86dd0..99ddcef07981 100644 --- a/toolchain/check/testdata/class/fail_base_repeated.carbon +++ b/toolchain/check/testdata/class/fail_base_repeated.carbon @@ -50,16 +50,8 @@ class D { // CHECK:STDOUT: %.6: type = unbound_element_type %D, %B1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B1 = %B1.decl -// CHECK:STDOUT: .B2 = %B2.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -68,6 +60,17 @@ class D { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B1 = %B1.decl +// CHECK:STDOUT: .B2 = %B2.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B1.decl: type = class_decl @B1 [template = constants.%B1] {} // CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} diff --git a/toolchain/check/testdata/class/fail_base_unbound.carbon b/toolchain/check/testdata/class/fail_base_unbound.carbon index 21f33dd0f9d8..d4cbad3f8e0e 100644 --- a/toolchain/check/testdata/class/fail_base_unbound.carbon +++ b/toolchain/check/testdata/class/fail_base_unbound.carbon @@ -33,15 +33,8 @@ let b: B = C.base; // CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +43,16 @@ let b: B = C.base; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .b = @__global_init.%b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %B.ref: type = name_ref B, %B.decl [template = constants.%B] diff --git a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon index 61b3bdedaebb..b01146065ffc 100644 --- a/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon +++ b/toolchain/check/testdata/class/fail_compound_type_mismatch.carbon @@ -42,20 +42,8 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .AccessBInA = %AccessBInA.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -64,6 +52,17 @@ fn AccessBInA(a: A) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .AccessBInA = %AccessBInA.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %AccessBInA.decl: %AccessBInA.type = fn_decl @AccessBInA [template = constants.%AccessBInA] { diff --git a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon index 47bdd090fe03..b146d5a9a443 100644 --- a/toolchain/check/testdata/class/fail_convert_to_invalid.carbon +++ b/toolchain/check/testdata/class/fail_convert_to_invalid.carbon @@ -30,14 +30,8 @@ fn Make() -> C { // CHECK:STDOUT: %.3: type = struct_type {.a: i32} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .Make = %Make.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +40,15 @@ fn Make() -> C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .Make = %Make.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] diff --git a/toolchain/check/testdata/class/fail_derived_to_base.carbon b/toolchain/check/testdata/class/fail_derived_to_base.carbon index 2d1765635ec0..c12c076ee17d 100644 --- a/toolchain/check/testdata/class/fail_derived_to_base.carbon +++ b/toolchain/check/testdata/class/fail_derived_to_base.carbon @@ -65,23 +65,8 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A1 = %A1.decl -// CHECK:STDOUT: .A2 = %A2.decl -// CHECK:STDOUT: .B2 = %B2.decl -// CHECK:STDOUT: .ConvertUnrelated = %ConvertUnrelated.decl -// CHECK:STDOUT: .Incomplete = %Incomplete.decl -// CHECK:STDOUT: .ConvertIncomplete = %ConvertIncomplete.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -90,6 +75,20 @@ fn ConvertIncomplete(p: Incomplete*) -> A2* { return p; } // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A1 = %A1.decl +// CHECK:STDOUT: .A2 = %A2.decl +// CHECK:STDOUT: .B2 = %B2.decl +// CHECK:STDOUT: .ConvertUnrelated = %ConvertUnrelated.decl +// CHECK:STDOUT: .Incomplete = %Incomplete.decl +// CHECK:STDOUT: .ConvertIncomplete = %ConvertIncomplete.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A1.decl: type = class_decl @A1 [template = constants.%A1] {} // CHECK:STDOUT: %A2.decl: type = class_decl @A2 [template = constants.%A2] {} // CHECK:STDOUT: %B2.decl: type = class_decl @B2 [template = constants.%B2] {} diff --git a/toolchain/check/testdata/class/fail_extend_cycle.carbon b/toolchain/check/testdata/class/fail_extend_cycle.carbon index e5fb0857202c..4b9fe9c77a2c 100644 --- a/toolchain/check/testdata/class/fail_extend_cycle.carbon +++ b/toolchain/check/testdata/class/fail_extend_cycle.carbon @@ -45,14 +45,8 @@ base class A { // CHECK:STDOUT: %.7: type = unbound_element_type %.6, %A [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -61,6 +55,15 @@ base class A { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.6] {} diff --git a/toolchain/check/testdata/class/fail_field_modifiers.carbon b/toolchain/check/testdata/class/fail_field_modifiers.carbon index 14847eaac260..9e3bef245c1d 100644 --- a/toolchain/check/testdata/class/fail_field_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_field_modifiers.carbon @@ -48,19 +48,8 @@ class Class { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -69,6 +58,15 @@ class Class { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_generic_method.carbon b/toolchain/check/testdata/class/fail_generic_method.carbon index aaf6a8a99197..e16cc13e1111 100644 --- a/toolchain/check/testdata/class/fail_generic_method.carbon +++ b/toolchain/check/testdata/class/fail_generic_method.carbon @@ -51,16 +51,8 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -69,6 +61,15 @@ fn Class(N:! i32).F[self: Self](n: T) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc11_13.1: type = param T // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] diff --git a/toolchain/check/testdata/class/fail_import_misuses.carbon b/toolchain/check/testdata/class/fail_import_misuses.carbon index 066f8aa1e843..04ee287d48d4 100644 --- a/toolchain/check/testdata/class/fail_import_misuses.carbon +++ b/toolchain/check/testdata/class/fail_import_misuses.carbon @@ -55,14 +55,8 @@ var a: Incomplete; // CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Empty = %Empty.decl -// CHECK:STDOUT: .Incomplete = %Incomplete.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -71,6 +65,15 @@ var a: Incomplete; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Empty = %Empty.decl +// CHECK:STDOUT: .Incomplete = %Incomplete.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Empty.decl: type = class_decl @Empty [template = constants.%Empty] {} // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} // CHECK:STDOUT: } @@ -94,19 +97,7 @@ var a: Incomplete; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%Empty] // CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+6, loaded [template = constants.%Incomplete] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Empty = imports.%import_ref.1 -// CHECK:STDOUT: .Incomplete = imports.%import_ref.2 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -115,6 +106,18 @@ var a: Incomplete; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Empty = imports.%import_ref.1 +// CHECK:STDOUT: .Incomplete = imports.%import_ref.2 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.2] {} // CHECK:STDOUT: %Incomplete.ref: type = name_ref Incomplete, imports.%import_ref.2 [template = constants.%Incomplete] // CHECK:STDOUT: %a.var: ref = var a diff --git a/toolchain/check/testdata/class/fail_incomplete.carbon b/toolchain/check/testdata/class/fail_incomplete.carbon index 986fd1e4ec59..016600b7d9bf 100644 --- a/toolchain/check/testdata/class/fail_incomplete.carbon +++ b/toolchain/check/testdata/class/fail_incomplete.carbon @@ -169,13 +169,22 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .CallClassFunction = %CallClassFunction.decl // CHECK:STDOUT: .global_var = %global_var @@ -190,15 +199,6 @@ fn CallReturnIncomplete() { // CHECK:STDOUT: .CallReturnIncomplete = %CallReturnIncomplete.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} // CHECK:STDOUT: %CallClassFunction.decl: %CallClassFunction.type = fn_decl @CallClassFunction [template = constants.%CallClassFunction] {} diff --git a/toolchain/check/testdata/class/fail_init.carbon b/toolchain/check/testdata/class/fail_init.carbon index fe0ed6fae838..75a37433fd02 100644 --- a/toolchain/check/testdata/class/fail_init.carbon +++ b/toolchain/check/testdata/class/fail_init.carbon @@ -51,18 +51,8 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -71,6 +61,16 @@ fn F() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_init_as_inplace.carbon b/toolchain/check/testdata/class/fail_init_as_inplace.carbon index 84becfc31932..a7f8786e139a 100644 --- a/toolchain/check/testdata/class/fail_init_as_inplace.carbon +++ b/toolchain/check/testdata/class/fail_init_as_inplace.carbon @@ -47,19 +47,8 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -68,6 +57,17 @@ fn F() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] diff --git a/toolchain/check/testdata/class/fail_memaccess_category.carbon b/toolchain/check/testdata/class/fail_memaccess_category.carbon index 1b5783fe667f..43a8a2172f52 100644 --- a/toolchain/check/testdata/class/fail_memaccess_category.carbon +++ b/toolchain/check/testdata/class/fail_memaccess_category.carbon @@ -57,15 +57,8 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: %.8: type = ptr_type %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -74,6 +67,16 @@ fn F(s: {.a: A}, b: B) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { diff --git a/toolchain/check/testdata/class/fail_member_of_let.carbon b/toolchain/check/testdata/class/fail_member_of_let.carbon index ae2e081b8b7b..c30a09e70c7b 100644 --- a/toolchain/check/testdata/class/fail_member_of_let.carbon +++ b/toolchain/check/testdata/class/fail_member_of_let.carbon @@ -40,17 +40,8 @@ fn T.F() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .T = @__global_init.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -59,6 +50,16 @@ fn T.F() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .T = @__global_init.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_method.carbon b/toolchain/check/testdata/class/fail_method.carbon index 431379b7f7e1..52a4fdfa0b7a 100644 --- a/toolchain/check/testdata/class/fail_method.carbon +++ b/toolchain/check/testdata/class/fail_method.carbon @@ -61,15 +61,8 @@ fn F(c: Class) { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .A = %A -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -78,6 +71,16 @@ fn F(c: Class) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .A = %A +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Class.ref.loc16: type = name_ref Class, %Class.decl [template = constants.%Class] // CHECK:STDOUT: %WithSelf.ref: %WithSelf.type = name_ref WithSelf, @Class.%WithSelf.decl [template = constants.%WithSelf] diff --git a/toolchain/check/testdata/class/fail_method_modifiers.carbon b/toolchain/check/testdata/class/fail_method_modifiers.carbon index df1b751896fb..b773fbff2ae5 100644 --- a/toolchain/check/testdata/class/fail_method_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_method_modifiers.carbon @@ -75,15 +75,8 @@ base class BaseClass { // CHECK:STDOUT: %Abstract.2: %Abstract.type.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .FinalClass = %FinalClass.decl -// CHECK:STDOUT: .AbstractClass = %AbstractClass.decl -// CHECK:STDOUT: .BaseClass = %BaseClass.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -92,6 +85,16 @@ base class BaseClass { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .FinalClass = %FinalClass.decl +// CHECK:STDOUT: .AbstractClass = %AbstractClass.decl +// CHECK:STDOUT: .BaseClass = %BaseClass.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %FinalClass.decl: type = class_decl @FinalClass [template = constants.%FinalClass] {} // CHECK:STDOUT: %AbstractClass.decl: type = class_decl @AbstractClass [template = constants.%AbstractClass] {} // CHECK:STDOUT: %BaseClass.decl: type = class_decl @BaseClass [template = constants.%BaseClass] {} diff --git a/toolchain/check/testdata/class/fail_method_redefinition.carbon b/toolchain/check/testdata/class/fail_method_redefinition.carbon index e6f146b4bfee..243326798422 100644 --- a/toolchain/check/testdata/class/fail_method_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_method_redefinition.carbon @@ -29,13 +29,8 @@ class Class { // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +39,14 @@ class Class { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/fail_modifiers.carbon b/toolchain/check/testdata/class/fail_modifiers.carbon index a815229d51b6..d90888257d32 100644 --- a/toolchain/check/testdata/class/fail_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_modifiers.carbon @@ -88,9 +88,21 @@ extern class ExternDefined {} // CHECK:STDOUT: %ExternDefined: type = class_type @ExternDefined [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .DuplicatePrivate [private] = %DuplicatePrivate.decl // CHECK:STDOUT: .TwoAccess [private] = %TwoAccess.decl // CHECK:STDOUT: .TwoAbstract = %TwoAbstract.decl @@ -100,15 +112,6 @@ extern class ExternDefined {} // CHECK:STDOUT: .ExternDefined = %ExternDefined.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %DuplicatePrivate.decl: type = class_decl @DuplicatePrivate [template = constants.%DuplicatePrivate] {} // CHECK:STDOUT: %TwoAccess.decl: type = class_decl @TwoAccess [template = constants.%TwoAccess] {} // CHECK:STDOUT: %TwoAbstract.decl: type = class_decl @TwoAbstract [template = constants.%TwoAbstract] {} diff --git a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon index e33027b444c0..d35f5477e81e 100644 --- a/toolchain/check/testdata/class/fail_out_of_line_decl.carbon +++ b/toolchain/check/testdata/class/fail_out_of_line_decl.carbon @@ -25,13 +25,8 @@ fn C.F() {} // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -40,6 +35,14 @@ fn C.F() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon index a26eb784f1a2..660a18d5f00a 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_introducer.carbon @@ -98,13 +98,8 @@ base class F {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -113,6 +108,14 @@ base class F {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl.loc4: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %A.decl.loc12: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: } @@ -129,13 +132,8 @@ base class F {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B = %B.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -144,6 +142,14 @@ base class F {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl.loc4: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %B.decl.loc12: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: } @@ -160,13 +166,8 @@ base class F {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -175,6 +176,14 @@ base class F {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl.loc4: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %C.decl.loc12: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } @@ -191,13 +200,8 @@ base class F {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .D = %D.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -206,6 +210,14 @@ base class F {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .D = %D.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %D.decl.loc4: type = class_decl @D [template = constants.%D] {} // CHECK:STDOUT: %D.decl.loc12: type = class_decl @D [template = constants.%D] {} // CHECK:STDOUT: } @@ -222,13 +234,8 @@ base class F {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .E = %E.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -237,6 +244,14 @@ base class F {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .E = %E.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %E.decl.loc4: type = class_decl @E [template = constants.%E] {} // CHECK:STDOUT: %E.decl.loc12: type = class_decl @E [template = constants.%E] {} // CHECK:STDOUT: } @@ -253,13 +268,8 @@ base class F {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -268,6 +278,14 @@ base class F {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl.loc4: type = class_decl @F [template = constants.%F] {} // CHECK:STDOUT: %F.decl.loc11: type = class_decl @F [template = constants.%F] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon index 8350a78880a5..808305c16d71 100644 --- a/toolchain/check/testdata/class/fail_redeclaration_scope.carbon +++ b/toolchain/check/testdata/class/fail_redeclaration_scope.carbon @@ -38,15 +38,8 @@ class Y { // CHECK:STDOUT: %.2: type = class_type @.1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl.loc11 -// CHECK:STDOUT: .X = %X.decl -// CHECK:STDOUT: .Y = %Y.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -55,6 +48,16 @@ class Y { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl.loc11 +// CHECK:STDOUT: .X = %X.decl +// CHECK:STDOUT: .Y = %Y.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl.loc11: type = class_decl @A.1 [template = constants.%A.1] {} // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} // CHECK:STDOUT: %A.decl.loc19: type = class_decl @A.1 [template = constants.%A.1] {} diff --git a/toolchain/check/testdata/class/fail_redefinition.carbon b/toolchain/check/testdata/class/fail_redefinition.carbon index e1644e76580c..75490c659c11 100644 --- a/toolchain/check/testdata/class/fail_redefinition.carbon +++ b/toolchain/check/testdata/class/fail_redefinition.carbon @@ -65,13 +65,8 @@ fn Class.I() {} // CHECK:STDOUT: %G.2: %G.type.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -80,6 +75,14 @@ fn Class.I() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %.decl: type = class_decl @.1 [template = constants.%.3] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} diff --git a/toolchain/check/testdata/class/fail_scope.carbon b/toolchain/check/testdata/class/fail_scope.carbon index 89f63b115615..720f9d4a6107 100644 --- a/toolchain/check/testdata/class/fail_scope.carbon +++ b/toolchain/check/testdata/class/fail_scope.carbon @@ -37,18 +37,8 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -57,6 +47,16 @@ fn G() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/class/fail_self.carbon b/toolchain/check/testdata/class/fail_self.carbon index 7ca78c3a663d..06bb84206b50 100644 --- a/toolchain/check/testdata/class/fail_self.carbon +++ b/toolchain/check/testdata/class/fail_self.carbon @@ -70,15 +70,8 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: %CallWrongSelf: %CallWrongSelf.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .WrongSelf = %WrongSelf.decl -// CHECK:STDOUT: .CallWrongSelf = %CallWrongSelf.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -87,6 +80,16 @@ fn CallWrongSelf(ws: WrongSelf) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .WrongSelf = %WrongSelf.decl +// CHECK:STDOUT: .CallWrongSelf = %CallWrongSelf.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type.1 = fn_decl @F.1 [template = constants.%F.1] { // CHECK:STDOUT: %Self.ref.loc25: type = name_ref Self, constants.%Class [template = constants.%Class] diff --git a/toolchain/check/testdata/class/fail_todo_modifiers.carbon b/toolchain/check/testdata/class/fail_todo_modifiers.carbon index 3ed03c0f983b..95a4bbc6ed7e 100644 --- a/toolchain/check/testdata/class/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/class/fail_todo_modifiers.carbon @@ -83,19 +83,8 @@ abstract class Abstract { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Access = %Access.decl -// CHECK:STDOUT: .Base = %Base.decl -// CHECK:STDOUT: .Abstract = %Abstract.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -104,6 +93,17 @@ abstract class Abstract { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Access = %Access.decl +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .Abstract = %Abstract.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Access.decl: type = class_decl @Access [template = constants.%Access] {} // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} diff --git a/toolchain/check/testdata/class/fail_unbound_field.carbon b/toolchain/check/testdata/class/fail_unbound_field.carbon index 9a459bc61393..29c48404bd17 100644 --- a/toolchain/check/testdata/class/fail_unbound_field.carbon +++ b/toolchain/check/testdata/class/fail_unbound_field.carbon @@ -43,19 +43,8 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -64,6 +53,16 @@ fn G() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/class/fail_unknown_member.carbon b/toolchain/check/testdata/class/fail_unknown_member.carbon index 3cb604cfb119..67882ea07b38 100644 --- a/toolchain/check/testdata/class/fail_unknown_member.carbon +++ b/toolchain/check/testdata/class/fail_unknown_member.carbon @@ -35,18 +35,8 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -55,6 +45,16 @@ fn G(c: Class) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %Class.ref: type = name_ref Class, %Class.decl [template = constants.%Class] diff --git a/toolchain/check/testdata/class/field_access.carbon b/toolchain/check/testdata/class/field_access.carbon index 1788431d8721..b65c2882d5a0 100644 --- a/toolchain/check/testdata/class/field_access.carbon +++ b/toolchain/check/testdata/class/field_access.carbon @@ -38,20 +38,8 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -60,6 +48,16 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/field_access_in_value.carbon b/toolchain/check/testdata/class/field_access_in_value.carbon index e81e405e5cfb..81570be7b624 100644 --- a/toolchain/check/testdata/class/field_access_in_value.carbon +++ b/toolchain/check/testdata/class/field_access_in_value.carbon @@ -39,20 +39,8 @@ fn Test() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .Test = %Test.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -61,6 +49,16 @@ fn Test() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .Test = %Test.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/class/forward_declared.carbon b/toolchain/check/testdata/class/forward_declared.carbon index 4f5395d5822e..82d285afd953 100644 --- a/toolchain/check/testdata/class/forward_declared.carbon +++ b/toolchain/check/testdata/class/forward_declared.carbon @@ -22,14 +22,8 @@ fn F(p: Class*) -> Class* { return p; } // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -38,6 +32,15 @@ fn F(p: Class*) -> Class* { return p; } // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Class.ref.loc13_9: type = name_ref Class, %Class.decl [template = constants.%Class] diff --git a/toolchain/check/testdata/class/generic.carbon b/toolchain/check/testdata/class/generic.carbon index 1d9f5cfbe0ed..52b77b34ead3 100644 --- a/toolchain/check/testdata/class/generic.carbon +++ b/toolchain/check/testdata/class/generic.carbon @@ -19,13 +19,8 @@ class C[](); // CHECK:STDOUT: %C.2: type = class_type @C [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -34,6 +29,14 @@ class C[](); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/generic/basic.carbon b/toolchain/check/testdata/class/generic/basic.carbon index a08d801ccc89..dedca54f1959 100644 --- a/toolchain/check/testdata/class/generic/basic.carbon +++ b/toolchain/check/testdata/class/generic/basic.carbon @@ -45,14 +45,8 @@ class Declaration(T:! type); // CHECK:STDOUT: %Declaration.2: type = class_type @Declaration, @Declaration(%T) [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .Declaration = %Declaration.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -61,6 +55,15 @@ class Declaration(T:! type); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .Declaration = %Declaration.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc11_13.1: type = param T // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] diff --git a/toolchain/check/testdata/class/generic/call.carbon b/toolchain/check/testdata/class/generic/call.carbon index 71adafceaab0..0b1b9c341e5a 100644 --- a/toolchain/check/testdata/class/generic/call.carbon +++ b/toolchain/check/testdata/class/generic/call.carbon @@ -103,19 +103,8 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -124,6 +113,17 @@ class Outer(T:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] @@ -204,18 +204,8 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -224,6 +214,16 @@ class Outer(T:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] @@ -282,18 +282,8 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -302,6 +292,16 @@ class Outer(T:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] @@ -361,18 +361,8 @@ class Outer(T:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -381,6 +371,16 @@ class Outer(T:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] @@ -453,13 +453,8 @@ class Outer(T:! type) { // CHECK:STDOUT: %struct.4: %Inner.4 = struct_value () [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Outer = %Outer.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -468,6 +463,14 @@ class Outer(T:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Outer = %Outer.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Outer.decl: %Outer.type = class_decl @Outer [template = constants.%Outer.1] { // CHECK:STDOUT: %T.loc2_13.1: type = param T // CHECK:STDOUT: %T.loc2_13.2: type = bind_symbolic_name T 0, %T.loc2_13.1 [symbolic = @Outer.%T (constants.%T)] diff --git a/toolchain/check/testdata/class/generic/fail_todo_use.carbon b/toolchain/check/testdata/class/generic/fail_todo_use.carbon index 1c6dda2bd640..05780dabad80 100644 --- a/toolchain/check/testdata/class/generic/fail_todo_use.carbon +++ b/toolchain/check/testdata/class/generic/fail_todo_use.carbon @@ -63,18 +63,8 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -83,6 +73,16 @@ fn Run() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc11_13.1: type = param T // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] diff --git a/toolchain/check/testdata/class/generic/field.carbon b/toolchain/check/testdata/class/generic/field.carbon index c19876162d2d..4c212a517688 100644 --- a/toolchain/check/testdata/class/generic/field.carbon +++ b/toolchain/check/testdata/class/generic/field.carbon @@ -51,20 +51,8 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .H = %H.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -73,6 +61,18 @@ fn H(U:! type, c: Class(U)) -> U { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .H = %H.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc11_13.1: type = param T // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] diff --git a/toolchain/check/testdata/class/generic/import.carbon b/toolchain/check/testdata/class/generic/import.carbon index 48c26b9489b9..30ec7a59c58e 100644 --- a/toolchain/check/testdata/class/generic/import.carbon +++ b/toolchain/check/testdata/class/generic/import.carbon @@ -112,20 +112,8 @@ class Class(U:! type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .CompleteClass = %CompleteClass.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -134,6 +122,17 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .CompleteClass = %CompleteClass.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] @@ -245,24 +244,9 @@ class Class(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+6, loaded [template = constants.%Class.1] // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+14, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//foo, inst+55, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+18, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+28, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+36, unloaded -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import.loc2_6.1 = import -// CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//foo, inst+53, loaded [template = constants.%F] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -271,6 +255,22 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+18, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+28, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+35, unloaded +// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import.loc2_6.1 = import +// CHECK:STDOUT: %default.import.loc2_6.2 = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = constants.%T] @@ -344,25 +344,9 @@ class Class(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+6, unloaded // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+14, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type.1 = import_ref Main//foo, inst+55, loaded [template = constants.%F.1] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+18, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+28, unloaded -// CHECK:STDOUT: %import_ref.7: %F.type.2 = import_ref Main//foo, inst+36, loaded [template = constants.%F.2] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Class = imports.%import_ref.1 -// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 -// CHECK:STDOUT: .F = imports.%import_ref.3 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Use = %Use.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.3: %F.type.1 = import_ref Main//foo, inst+53, loaded [template = constants.%F.1] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.4 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -371,6 +355,22 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+18, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+28, unloaded +// CHECK:STDOUT: %import_ref.7: %F.type.2 = import_ref Main//foo, inst+35, loaded [template = constants.%F.2] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Class = imports.%import_ref.1 +// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -442,25 +442,9 @@ class Class(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+6, unloaded // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+14, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//foo, inst+55, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+18, unloaded -// CHECK:STDOUT: %import_ref.6: %.4 = import_ref Main//foo, inst+28, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//foo, inst+36, unloaded -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Class = imports.%import_ref.1 -// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 -// CHECK:STDOUT: .F = imports.%import_ref.3 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Use = %Use.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//foo, inst+53, loaded [template = constants.%F] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.4 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -469,6 +453,22 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+18, unloaded +// CHECK:STDOUT: %import_ref.6: %.4 = import_ref Main//foo, inst+28, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//foo, inst+35, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Class = imports.%import_ref.1 +// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc5_13.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -537,24 +537,9 @@ class Class(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//foo, inst+6, unloaded // CHECK:STDOUT: %import_ref.2: %CompleteClass.type = import_ref Main//foo, inst+14, loaded [template = constants.%CompleteClass.1] -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//foo, inst+55, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+18, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+28, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+36, unloaded -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Class = imports.%import_ref.1 -// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 -// CHECK:STDOUT: .F = imports.%import_ref.3 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Use = %Use.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//foo, inst+53, loaded [template = constants.%F] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -563,6 +548,22 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.4 = import_ref Main//foo, inst+18, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//foo, inst+28, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//foo, inst+35, unloaded +// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Class = imports.%import_ref.1 +// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Use = %Use.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Use.decl: %Use.type = fn_decl @Use [template = constants.%Use] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -619,20 +620,8 @@ class Class(U:! type) { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %Class.type = import_ref Main//foo, inst+6, loaded [template = constants.%Class.1] // CHECK:STDOUT: %import_ref.2 = import_ref Main//foo, inst+14, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//foo, inst+55, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Class = imports.%import_ref.1 -// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 -// CHECK:STDOUT: .F = imports.%import_ref.3 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import.loc2_6.1 = import -// CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.3 = import_ref Main//foo, inst+53, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -641,6 +630,18 @@ class Class(U:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Class = imports.%import_ref.1 +// CHECK:STDOUT: .CompleteClass = imports.%import_ref.2 +// CHECK:STDOUT: .F = imports.%import_ref.3 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import.loc2_6.1 = import +// CHECK:STDOUT: %default.import.loc2_6.2 = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %U.loc9_13.1: type = param U // CHECK:STDOUT: %U.loc9_13.2: type = bind_symbolic_name U 0, %U.loc9_13.1 [symbolic = @.1.%U (constants.%U)] diff --git a/toolchain/check/testdata/class/generic/member_inline.carbon b/toolchain/check/testdata/class/generic/member_inline.carbon index 11aaedea28f1..6c985c02be81 100644 --- a/toolchain/check/testdata/class/generic/member_inline.carbon +++ b/toolchain/check/testdata/class/generic/member_inline.carbon @@ -37,13 +37,8 @@ class Class(T:! type) { // CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -52,6 +47,14 @@ class Class(T:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc11_13.1: type = param T // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] diff --git a/toolchain/check/testdata/class/generic/member_out_of_line.carbon b/toolchain/check/testdata/class/generic/member_out_of_line.carbon index da878cb74764..cfadda690ce2 100644 --- a/toolchain/check/testdata/class/generic/member_out_of_line.carbon +++ b/toolchain/check/testdata/class/generic/member_out_of_line.carbon @@ -122,13 +122,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -137,6 +132,14 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc4_13.1: type = param T // CHECK:STDOUT: %T.loc4_13.2: type = bind_symbolic_name T 0, %T.loc4_13.1 [symbolic = @Class.%T (constants.%T)] @@ -268,13 +271,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -283,6 +281,14 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = class_decl @A [template = constants.%A.1] { // CHECK:STDOUT: %T.loc4_9.1: type = param T // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T 0, %T.loc4_9.1 [symbolic = @A.%T (constants.%T)] @@ -394,13 +400,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %.3: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NotGeneric = %NotGeneric.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -409,6 +410,14 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NotGeneric = %NotGeneric.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NotGeneric.decl: type = class_decl @NotGeneric [template = constants.%NotGeneric] {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.3] { // CHECK:STDOUT: %T.loc15_15.1: type = param T @@ -456,13 +465,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %.3: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Generic = %Generic.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -471,6 +475,14 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Generic = %Generic.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Generic.decl: %Generic.type = class_decl @Generic [template = constants.%Generic.1] { // CHECK:STDOUT: %T.loc4_15.1: type = param T // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @Generic.%T (constants.%T)] @@ -524,13 +536,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %.3: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Generic = %Generic.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -539,6 +546,14 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Generic = %Generic.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Generic.decl: %Generic.type = class_decl @Generic [template = constants.%Generic.1] { // CHECK:STDOUT: %T.loc4_15.1: type = param T // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @Generic.%T (constants.%T)] @@ -609,13 +624,8 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: %.3: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Generic = %Generic.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -624,6 +634,14 @@ fn Generic(T:! ()).WrongType() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Generic = %Generic.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Generic.decl: %Generic.type = class_decl @Generic [template = constants.%Generic.1] { // CHECK:STDOUT: %T.loc4_15.1: type = param T // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @Generic.%T (constants.%T.1)] diff --git a/toolchain/check/testdata/class/generic/redeclare.carbon b/toolchain/check/testdata/class/generic/redeclare.carbon index 4b8b083f2a7a..d9d0eb9428b6 100644 --- a/toolchain/check/testdata/class/generic/redeclare.carbon +++ b/toolchain/check/testdata/class/generic/redeclare.carbon @@ -97,13 +97,8 @@ class E(U:! type) {} // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Generic = %Generic.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -112,6 +107,14 @@ class E(U:! type) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Generic = %Generic.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Generic.decl.loc4: %Generic.type = class_decl @Generic [template = constants.%Generic.1] { // CHECK:STDOUT: %T.loc4_15.1: type = param T // CHECK:STDOUT: %T.loc4_15.2: type = bind_symbolic_name T 0, %T.loc4_15.1 [symbolic = @Generic.%T (constants.%T)] @@ -149,13 +152,8 @@ class E(U:! type) {} // CHECK:STDOUT: %.4: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -164,6 +162,14 @@ class E(U:! type) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %.decl: %.type = class_decl @.1 [template = constants.%.2] { // CHECK:STDOUT: %T.loc12_9.1: type = param T @@ -207,16 +213,8 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -225,6 +223,15 @@ class E(U:! type) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: %B.type = class_decl @B [template = constants.%B.1] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -288,16 +295,8 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -306,6 +305,15 @@ class E(U:! type) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { // CHECK:STDOUT: %T.loc4_9.1: type = param T // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T 0, %T.loc4_9.1 [symbolic = @C.%T (constants.%T)] @@ -368,16 +376,8 @@ class E(U:! type) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -386,6 +386,15 @@ class E(U:! type) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %D.decl: %D.type = class_decl @D [template = constants.%D.1] { // CHECK:STDOUT: %T.loc4_9.1: type = param T // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T 0, %T.loc4_9.1 [symbolic = @D.%T (constants.%T.1)] @@ -441,13 +450,8 @@ class E(U:! type) {} // CHECK:STDOUT: %.4: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .E = %E.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -456,6 +460,14 @@ class E(U:! type) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .E = %E.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %E.decl: %E.type = class_decl @E [template = constants.%E.1] { // CHECK:STDOUT: %T.loc4_9.1: type = param T // CHECK:STDOUT: %T.loc4_9.2: type = bind_symbolic_name T 0, %T.loc4_9.1 [symbolic = @E.%T (constants.%T)] diff --git a/toolchain/check/testdata/class/generic/self.carbon b/toolchain/check/testdata/class/generic/self.carbon index 59f06eab2b5e..d3d7e550f61e 100644 --- a/toolchain/check/testdata/class/generic/self.carbon +++ b/toolchain/check/testdata/class/generic/self.carbon @@ -37,13 +37,8 @@ class Class(T:! type) { // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -52,6 +47,14 @@ class Class(T:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc11_13.1: type = param T // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] diff --git a/toolchain/check/testdata/class/generic_method.carbon b/toolchain/check/testdata/class/generic_method.carbon index fdd8cc1d8cbb..06afd84b419f 100644 --- a/toolchain/check/testdata/class/generic_method.carbon +++ b/toolchain/check/testdata/class/generic_method.carbon @@ -30,13 +30,8 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: %.4: type = ptr_type %.3 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +40,14 @@ fn Class(T:! type).F[self: Self](n: T) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: %Class.type = class_decl @Class [template = constants.%Class.1] { // CHECK:STDOUT: %T.loc11_13.1: type = param T // CHECK:STDOUT: %T.loc11_13.2: type = bind_symbolic_name T 0, %T.loc11_13.1 [symbolic = @Class.%T (constants.%T)] diff --git a/toolchain/check/testdata/class/import.carbon b/toolchain/check/testdata/class/import.carbon index 8f064d538b74..8896ee5dce75 100644 --- a/toolchain/check/testdata/class/import.carbon +++ b/toolchain/check/testdata/class/import.carbon @@ -70,19 +70,8 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Empty = %Empty.decl -// CHECK:STDOUT: .Field = %Field.decl -// CHECK:STDOUT: .ForwardDeclared = %ForwardDeclared.decl.loc11 -// CHECK:STDOUT: .Incomplete = %Incomplete.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -91,6 +80,18 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Empty = %Empty.decl +// CHECK:STDOUT: .Field = %Field.decl +// CHECK:STDOUT: .ForwardDeclared = %ForwardDeclared.decl.loc11 +// CHECK:STDOUT: .Incomplete = %Incomplete.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Empty.decl: type = class_decl @Empty [template = constants.%Empty] {} // CHECK:STDOUT: %Field.decl: type = class_decl @Field [template = constants.%Field] {} // CHECK:STDOUT: %ForwardDeclared.decl.loc11: type = class_decl @ForwardDeclared [template = constants.%ForwardDeclared] {} @@ -176,6 +177,15 @@ fn Run() { // CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+6, loaded [template = constants.%Field] // CHECK:STDOUT: %import_ref.3: type = import_ref Main//a, inst+22, loaded [template = constants.%ForwardDeclared.1] // CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+40, loaded [template = constants.%Incomplete] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+4, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//a, inst+7, unloaded // CHECK:STDOUT: %import_ref.7: %.7 = import_ref Main//a, inst+18, loaded [template = %.1] @@ -193,20 +203,11 @@ fn Run() { // CHECK:STDOUT: .Field = imports.%import_ref.2 // CHECK:STDOUT: .ForwardDeclared = imports.%import_ref.3 // CHECK:STDOUT: .Incomplete = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_base.carbon b/toolchain/check/testdata/class/import_base.carbon index fbf117afc894..b19c071616b9 100644 --- a/toolchain/check/testdata/class/import_base.carbon +++ b/toolchain/check/testdata/class/import_base.carbon @@ -56,18 +56,8 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Base = %Base.decl -// CHECK:STDOUT: .Child = %Child.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -76,6 +66,16 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .Child = %Child.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Child.decl: type = class_decl @Child [template = constants.%Child] {} // CHECK:STDOUT: } @@ -151,26 +151,8 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+38, loaded [template = constants.%Child] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//a, inst+8, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+15, unloaded -// CHECK:STDOUT: %import_ref.6: %.11 = import_ref Main//a, inst+27, loaded [template = %.1] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+34, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+39, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, inst+43, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Base = imports.%import_ref.1 -// CHECK:STDOUT: .Child = imports.%import_ref.2 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//a, inst+37, loaded [template = constants.%Child] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -179,6 +161,24 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Main//a, inst+8, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+15, unloaded +// CHECK:STDOUT: %import_ref.6: %.11 = import_ref Main//a, inst+27, loaded [template = %.1] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//a, inst+33, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//a, inst+38, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//a, inst+42, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Base = imports.%import_ref.1 +// CHECK:STDOUT: .Child = imports.%import_ref.2 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_forward_decl.carbon b/toolchain/check/testdata/class/import_forward_decl.carbon index 1589317ad4c2..d2231d5f905f 100644 --- a/toolchain/check/testdata/class/import_forward_decl.carbon +++ b/toolchain/check/testdata/class/import_forward_decl.carbon @@ -27,13 +27,8 @@ class ForwardDecl { // CHECK:STDOUT: %ForwardDecl: type = class_type @ForwardDecl [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .ForwardDecl = %ForwardDecl.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -42,6 +37,14 @@ class ForwardDecl { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .ForwardDecl = %ForwardDecl.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ForwardDecl.decl: type = class_decl @ForwardDecl [template = constants.%ForwardDecl] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -56,17 +59,7 @@ class ForwardDecl { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: type = import_ref Main//a, inst+3, loaded [template = constants.%ForwardDecl] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .ForwardDecl = %ForwardDecl.decl -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import.loc2_6.1 = import -// CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -75,6 +68,16 @@ class ForwardDecl { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .ForwardDecl = %ForwardDecl.decl +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import.loc2_6.1 = import +// CHECK:STDOUT: %default.import.loc2_6.2 = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ForwardDecl.decl: type = class_decl @ForwardDecl [template = constants.%ForwardDecl] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_indirect.carbon b/toolchain/check/testdata/class/import_indirect.carbon index 3570cd1a86a6..e8c4679bb2e0 100644 --- a/toolchain/check/testdata/class/import_indirect.carbon +++ b/toolchain/check/testdata/class/import_indirect.carbon @@ -107,13 +107,8 @@ var ptr: E* = &val; // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -122,6 +117,14 @@ var ptr: E* = &val; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -143,20 +146,7 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .D = %D -// CHECK:STDOUT: .b_val = %b_val -// CHECK:STDOUT: .b_ptr = %b_ptr -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -165,6 +155,19 @@ var ptr: E* = &val; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .D = %D +// CHECK:STDOUT: .b_val = %b_val +// CHECK:STDOUT: .b_ptr = %b_ptr +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %D: type = bind_alias D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, imports.%import_ref.1 [template = constants.%C] @@ -206,20 +209,7 @@ var ptr: E* = &val; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .E = %E -// CHECK:STDOUT: .c_val = %c_val -// CHECK:STDOUT: .c_ptr = %c_ptr -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -228,6 +218,19 @@ var ptr: E* = &val; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .C = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .E = %E +// CHECK:STDOUT: .c_val = %c_val +// CHECK:STDOUT: .c_ptr = %c_ptr +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %E: type = bind_alias E, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %C.ref.loc8: type = name_ref C, imports.%import_ref.1 [template = constants.%C] @@ -272,6 +275,15 @@ var ptr: E* = &val; // CHECK:STDOUT: %import_ref.2: type = import_ref Main//b, inst+10, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+15, unloaded // CHECK:STDOUT: %import_ref.4 = import_ref Main//b, inst+25, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -281,21 +293,12 @@ var ptr: E* = &val; // CHECK:STDOUT: .D = imports.%import_ref.2 // CHECK:STDOUT: .b_val = imports.%import_ref.3 // CHECK:STDOUT: .b_ptr = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .val = %val // CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var @@ -338,6 +341,15 @@ var ptr: E* = &val; // CHECK:STDOUT: %import_ref.2 = import_ref Main//b, inst+15, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Main//b, inst+25, unloaded // CHECK:STDOUT: %import_ref.4: type = import_ref Main//a, inst+3, loaded [template = constants.%C] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.5 = import_ref Main//a, inst+4, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -347,21 +359,12 @@ var ptr: E* = &val; // CHECK:STDOUT: .b_val = imports.%import_ref.2 // CHECK:STDOUT: .b_ptr = imports.%import_ref.3 // CHECK:STDOUT: .C = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .val = %val // CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.4 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var @@ -406,6 +409,15 @@ var ptr: E* = &val; // CHECK:STDOUT: %import_ref.4: type = import_ref Main//c, inst+10, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.5 = import_ref Main//c, inst+15, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//c, inst+25, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.7 = import_ref Main//b, inst+8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -417,21 +429,12 @@ var ptr: E* = &val; // CHECK:STDOUT: .E = imports.%import_ref.4 // CHECK:STDOUT: .c_val = imports.%import_ref.5 // CHECK:STDOUT: .c_ptr = imports.%import_ref.6 -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .val = %val // CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var @@ -476,6 +479,15 @@ var ptr: E* = &val; // CHECK:STDOUT: %import_ref.4: type = import_ref Main//b, inst+10, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.5 = import_ref Main//b, inst+15, unloaded // CHECK:STDOUT: %import_ref.6 = import_ref Main//b, inst+25, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.7 = import_ref Main//b, inst+8, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: @@ -487,21 +499,12 @@ var ptr: E* = &val; // CHECK:STDOUT: .D = imports.%import_ref.4 // CHECK:STDOUT: .b_val = imports.%import_ref.5 // CHECK:STDOUT: .b_ptr = imports.%import_ref.6 -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .val = %val // CHECK:STDOUT: .ptr = %ptr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %D.ref: type = name_ref D, imports.%import_ref.4 [template = constants.%C] // CHECK:STDOUT: %val.var: ref %C = var val // CHECK:STDOUT: %val: ref %C = bind_name val, %val.var diff --git a/toolchain/check/testdata/class/import_member_cycle.carbon b/toolchain/check/testdata/class/import_member_cycle.carbon index d2ef2aae8107..29343c76de34 100644 --- a/toolchain/check/testdata/class/import_member_cycle.carbon +++ b/toolchain/check/testdata/class/import_member_cycle.carbon @@ -35,13 +35,8 @@ fn Run() { // CHECK:STDOUT: %.3: type = struct_type {.a: %.1} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Cycle = %Cycle.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +45,14 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Cycle = %Cycle.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Cycle.decl: type = class_decl @Cycle [template = constants.%Cycle] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -76,19 +79,7 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//a, inst+3, loaded [template = constants.%Cycle] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+9, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Cycle = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,6 +88,18 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+9, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Cycle = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/import_struct_cyle.carbon b/toolchain/check/testdata/class/import_struct_cyle.carbon index 32d3f0e44399..84544e95aa21 100644 --- a/toolchain/check/testdata/class/import_struct_cyle.carbon +++ b/toolchain/check/testdata/class/import_struct_cyle.carbon @@ -41,14 +41,8 @@ fn Run() { // CHECK:STDOUT: %.4: type = struct_type {.c: %.2} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Cycle = %Cycle.decl.loc4 -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -57,6 +51,15 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Cycle = %Cycle.decl.loc4 +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Cycle.decl.loc4: type = class_decl @Cycle [template = constants.%Cycle] {} // CHECK:STDOUT: %Cycle.ref: type = name_ref Cycle, %Cycle.decl.loc4 [template = constants.%Cycle] // CHECK:STDOUT: %.loc6_18: type = ptr_type %Cycle [template = constants.%.1] @@ -94,20 +97,7 @@ fn Run() { // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//a, inst+3, unloaded // CHECK:STDOUT: %import_ref.2: ref %.3 = import_ref Main//a, inst+13, loaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded -// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Main//a, inst+20, loaded [template = %.1] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Cycle = imports.%import_ref.1 -// CHECK:STDOUT: .a = imports.%import_ref.2 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -116,6 +106,19 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3 = import_ref Main//a, inst+4, unloaded +// CHECK:STDOUT: %import_ref.4: %.6 = import_ref Main//a, inst+20, loaded [template = %.1] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Cycle = imports.%import_ref.1 +// CHECK:STDOUT: .a = imports.%import_ref.2 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/init.carbon b/toolchain/check/testdata/class/init.carbon index 64a640832478..52c63ddf9dfd 100644 --- a/toolchain/check/testdata/class/init.carbon +++ b/toolchain/check/testdata/class/init.carbon @@ -41,20 +41,8 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .Make = %Make.decl -// CHECK:STDOUT: .MakeReorder = %MakeReorder.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -63,6 +51,17 @@ fn MakeReorder(n: i32, next: Class*) -> Class { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .Make = %Make.decl +// CHECK:STDOUT: .MakeReorder = %MakeReorder.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] { // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/class/init_adapt.carbon b/toolchain/check/testdata/class/init_adapt.carbon index 8da6a890feec..5d77f8fff4fc 100644 --- a/toolchain/check/testdata/class/init_adapt.carbon +++ b/toolchain/check/testdata/class/init_adapt.carbon @@ -100,13 +100,22 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .AdaptC = %AdaptC.decl // CHECK:STDOUT: .a = @__global_init.%a @@ -118,15 +127,6 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %AdaptC.decl: type = class_decl @AdaptC [template = constants.%AdaptC] {} // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] @@ -241,13 +241,22 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .AdaptC = %AdaptC.decl // CHECK:STDOUT: .a = @__global_init.%a @@ -259,15 +268,6 @@ var e: C = MakeAdaptC(); // CHECK:STDOUT: .e = %e // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %AdaptC.decl: type = class_decl @AdaptC [template = constants.%AdaptC] {} // CHECK:STDOUT: %C.ref.loc13: type = name_ref C, %C.decl [template = constants.%C] diff --git a/toolchain/check/testdata/class/init_as.carbon b/toolchain/check/testdata/class/init_as.carbon index 4ecec4ae0b0b..abcdab17a832 100644 --- a/toolchain/check/testdata/class/init_as.carbon +++ b/toolchain/check/testdata/class/init_as.carbon @@ -35,19 +35,8 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -56,6 +45,16 @@ fn F() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/class/init_nested.carbon b/toolchain/check/testdata/class/init_nested.carbon index 4eebce16582b..809d45b28418 100644 --- a/toolchain/check/testdata/class/init_nested.carbon +++ b/toolchain/check/testdata/class/init_nested.carbon @@ -47,20 +47,8 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Inner = %Inner.decl -// CHECK:STDOUT: .MakeInner = %MakeInner.decl -// CHECK:STDOUT: .Outer = %Outer.decl -// CHECK:STDOUT: .MakeOuter = %MakeOuter.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -69,6 +57,18 @@ fn MakeOuter() -> Outer { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Inner = %Inner.decl +// CHECK:STDOUT: .MakeInner = %MakeInner.decl +// CHECK:STDOUT: .Outer = %Outer.decl +// CHECK:STDOUT: .MakeOuter = %MakeOuter.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Inner.decl: type = class_decl @Inner [template = constants.%Inner] {} // CHECK:STDOUT: %MakeInner.decl: %MakeInner.type = fn_decl @MakeInner [template = constants.%MakeInner] { // CHECK:STDOUT: %Inner.ref: type = name_ref Inner, %Inner.decl [template = constants.%Inner] diff --git a/toolchain/check/testdata/class/method.carbon b/toolchain/check/testdata/class/method.carbon index e9f94a601745..ba4da2f1ad49 100644 --- a/toolchain/check/testdata/class/method.carbon +++ b/toolchain/check/testdata/class/method.carbon @@ -96,23 +96,22 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Class = %Class.decl // CHECK:STDOUT: .Call = %Call.decl // CHECK:STDOUT: .CallAlias = %CallAlias.decl @@ -125,15 +124,6 @@ fn CallGOnInitializingExpr() -> i32 { // CHECK:STDOUT: .CallGOnInitializingExpr = %CallGOnInitializingExpr.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] diff --git a/toolchain/check/testdata/class/nested.carbon b/toolchain/check/testdata/class/nested.carbon index d887a2fdaa9d..f665e17c55d1 100644 --- a/toolchain/check/testdata/class/nested.carbon +++ b/toolchain/check/testdata/class/nested.carbon @@ -75,14 +75,8 @@ fn F(a: Outer*) { // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Outer = %Outer.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -91,6 +85,15 @@ fn F(a: Outer*) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Outer = %Outer.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Outer.decl: type = class_decl @Outer [template = constants.%Outer] {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %Outer.ref: type = name_ref Outer, %Outer.decl [template = constants.%Outer] diff --git a/toolchain/check/testdata/class/nested_name.carbon b/toolchain/check/testdata/class/nested_name.carbon index 6a7eeb0a570a..84f291a0bf0c 100644 --- a/toolchain/check/testdata/class/nested_name.carbon +++ b/toolchain/check/testdata/class/nested_name.carbon @@ -42,19 +42,8 @@ fn G(o: Outer) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Outer = %Outer.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -63,6 +52,17 @@ fn G(o: Outer) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Outer = %Outer.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Outer.decl: type = class_decl @Outer [template = constants.%Outer] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Outer.ref.loc17: type = name_ref Outer, %Outer.decl [template = constants.%Outer] diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/no_prelude/import_access.carbon index 3437d771414a..2ba82b59ed51 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/no_prelude/import_access.carbon @@ -259,16 +259,19 @@ private class Redecl {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { +// CHECK:STDOUT: import Test//def +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Test = %Test +// CHECK:STDOUT: .Test = imports.%Test // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { -// CHECK:STDOUT: import Test//def -// CHECK:STDOUT: } -// CHECK:STDOUT: %Test.ref: = name_ref Test, %Test [template = %Test] +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var @@ -351,16 +354,19 @@ private class Redecl {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { +// CHECK:STDOUT: import Test//forward_with_def +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Test = %Test +// CHECK:STDOUT: .Test = imports.%Test // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { -// CHECK:STDOUT: import Test//forward_with_def -// CHECK:STDOUT: } -// CHECK:STDOUT: %Test.ref: = name_ref Test, %Test [template = %Test] +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] // CHECK:STDOUT: %c.var: ref = var c // CHECK:STDOUT: %c: ref = bind_name c, %c.var @@ -448,17 +454,20 @@ private class Redecl {} // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { +// CHECK:STDOUT: import Test//forward +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Test = %Test +// CHECK:STDOUT: .Test = imports.%Test // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { -// CHECK:STDOUT: import Test//forward -// CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Test.ref: = name_ref Test, %Test [template = %Test] +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %.loc9: type = ptr_type [template = ] // CHECK:STDOUT: %c.loc9_6.1: = param c diff --git a/toolchain/check/testdata/class/raw_self.carbon b/toolchain/check/testdata/class/raw_self.carbon index 0ae6ef3817ec..c7345da39786 100644 --- a/toolchain/check/testdata/class/raw_self.carbon +++ b/toolchain/check/testdata/class/raw_self.carbon @@ -43,24 +43,8 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -69,6 +53,15 @@ fn Class.G[self: Self](r#self: i32) -> (i32, i32) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref.loc17: type = name_ref Self, constants.%Class [template = constants.%Class] diff --git a/toolchain/check/testdata/class/raw_self_type.carbon b/toolchain/check/testdata/class/raw_self_type.carbon index 68087c0d2a88..db1235ea641f 100644 --- a/toolchain/check/testdata/class/raw_self_type.carbon +++ b/toolchain/check/testdata/class/raw_self_type.carbon @@ -39,14 +39,8 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: %F.2: %F.type.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .MemberNamedSelf = %MemberNamedSelf.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -55,6 +49,15 @@ fn MemberNamedSelf.F(x: Self, y: r#Self) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .MemberNamedSelf = %MemberNamedSelf.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %MemberNamedSelf.decl: type = class_decl @MemberNamedSelf [template = constants.%MemberNamedSelf] {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { diff --git a/toolchain/check/testdata/class/redeclaration.carbon b/toolchain/check/testdata/class/redeclaration.carbon index 415521d057f0..06620b0755da 100644 --- a/toolchain/check/testdata/class/redeclaration.carbon +++ b/toolchain/check/testdata/class/redeclaration.carbon @@ -30,17 +30,8 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl.loc11 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -49,6 +40,15 @@ fn Class.F[self: Self](b: bool) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl.loc11 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl.loc11: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Class.decl.loc13: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { diff --git a/toolchain/check/testdata/class/redeclaration_introducer.carbon b/toolchain/check/testdata/class/redeclaration_introducer.carbon index 599542adf026..2ac75d6dd60e 100644 --- a/toolchain/check/testdata/class/redeclaration_introducer.carbon +++ b/toolchain/check/testdata/class/redeclaration_introducer.carbon @@ -25,15 +25,8 @@ abstract class C {} // CHECK:STDOUT: %.1: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl.loc11 -// CHECK:STDOUT: .B = %B.decl.loc12 -// CHECK:STDOUT: .C = %C.decl.loc13 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -42,6 +35,16 @@ abstract class C {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl.loc11 +// CHECK:STDOUT: .B = %B.decl.loc12 +// CHECK:STDOUT: .C = %C.decl.loc13 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl.loc11: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl.loc12: type = class_decl @B [template = constants.%B] {} // CHECK:STDOUT: %C.decl.loc13: type = class_decl @C [template = constants.%C] {} diff --git a/toolchain/check/testdata/class/reenter_scope.carbon b/toolchain/check/testdata/class/reenter_scope.carbon index 0b6c82018db8..561196dbc37d 100644 --- a/toolchain/check/testdata/class/reenter_scope.carbon +++ b/toolchain/check/testdata/class/reenter_scope.carbon @@ -34,18 +34,8 @@ fn Class.F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -54,6 +44,15 @@ fn Class.F() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/class/reorder.carbon b/toolchain/check/testdata/class/reorder.carbon index 55b4fbbc9d97..9891bc9256ec 100644 --- a/toolchain/check/testdata/class/reorder.carbon +++ b/toolchain/check/testdata/class/reorder.carbon @@ -35,17 +35,8 @@ class Class { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -54,6 +45,15 @@ class Class { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/reorder_qualified.carbon b/toolchain/check/testdata/class/reorder_qualified.carbon index db560fbfc959..54c6b5c57d80 100644 --- a/toolchain/check/testdata/class/reorder_qualified.carbon +++ b/toolchain/check/testdata/class/reorder_qualified.carbon @@ -89,19 +89,8 @@ class A { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -110,6 +99,15 @@ class A { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/class/scope.carbon b/toolchain/check/testdata/class/scope.carbon index c331488189da..631471cd5148 100644 --- a/toolchain/check/testdata/class/scope.carbon +++ b/toolchain/check/testdata/class/scope.carbon @@ -49,22 +49,8 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -73,6 +59,17 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/class/self.carbon b/toolchain/check/testdata/class/self.carbon index 49debfd14c56..d00401bf45dd 100644 --- a/toolchain/check/testdata/class/self.carbon +++ b/toolchain/check/testdata/class/self.carbon @@ -41,20 +41,8 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -63,6 +51,15 @@ fn Class.G[addr self: Self*]() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref.loc18: type = name_ref Self, constants.%Class [template = constants.%Class] diff --git a/toolchain/check/testdata/class/self_conversion.carbon b/toolchain/check/testdata/class/self_conversion.carbon index 7eb59c1b595e..713e84c9527b 100644 --- a/toolchain/check/testdata/class/self_conversion.carbon +++ b/toolchain/check/testdata/class/self_conversion.carbon @@ -59,21 +59,8 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Base = %Base.decl -// CHECK:STDOUT: .Derived = %Derived.decl -// CHECK:STDOUT: .Call = %Call.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -82,6 +69,17 @@ fn Call(p: Derived*) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Base = %Base.decl +// CHECK:STDOUT: .Derived = %Derived.decl +// CHECK:STDOUT: .Call = %Call.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Base.decl: type = class_decl @Base [template = constants.%Base] {} // CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} // CHECK:STDOUT: %SelfBase.decl: %SelfBase.type = fn_decl @SelfBase [template = constants.%SelfBase] { diff --git a/toolchain/check/testdata/class/self_type.carbon b/toolchain/check/testdata/class/self_type.carbon index 096b03e4f527..2af77d8139b4 100644 --- a/toolchain/check/testdata/class/self_type.carbon +++ b/toolchain/check/testdata/class/self_type.carbon @@ -40,17 +40,8 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -59,6 +50,15 @@ fn Class.F[self: Self]() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%Class [template = constants.%Class] diff --git a/toolchain/check/testdata/class/static_method.carbon b/toolchain/check/testdata/class/static_method.carbon index 692b96ad5682..867982a0b6cd 100644 --- a/toolchain/check/testdata/class/static_method.carbon +++ b/toolchain/check/testdata/class/static_method.carbon @@ -33,18 +33,8 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Class = %Class.decl -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -53,6 +43,16 @@ fn Run() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Class = %Class.decl +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Class.decl: type = class_decl @Class [template = constants.%Class] {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/class/syntactic_merge_literal.carbon b/toolchain/check/testdata/class/syntactic_merge_literal.carbon index 4cb917451f2c..c59ebd7346af 100644 --- a/toolchain/check/testdata/class/syntactic_merge_literal.carbon +++ b/toolchain/check/testdata/class/syntactic_merge_literal.carbon @@ -46,17 +46,8 @@ class D(b: C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl.loc3 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -65,6 +56,16 @@ class D(b: C(1_000)) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl.loc3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_12.1: type = value_of_initializer %int.make_type_32 [template = i32] @@ -127,17 +128,8 @@ class D(b: C(1_000)) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -146,6 +138,16 @@ class D(b: C(1_000)) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.1] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc2_12.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/const/basic.carbon b/toolchain/check/testdata/const/basic.carbon index 8819beb4b5f2..9b60c3a16402 100644 --- a/toolchain/check/testdata/const/basic.carbon +++ b/toolchain/check/testdata/const/basic.carbon @@ -34,20 +34,8 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -56,6 +44,16 @@ fn B(p: const (i32*)) -> const (i32*) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc11_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_15 [template = i32] diff --git a/toolchain/check/testdata/const/collapse.carbon b/toolchain/check/testdata/const/collapse.carbon index 72c2b00b4619..2693152e1a6b 100644 --- a/toolchain/check/testdata/const/collapse.carbon +++ b/toolchain/check/testdata/const/collapse.carbon @@ -30,17 +30,8 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -49,6 +40,15 @@ fn F(p: const i32**) -> const (const i32)** { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc15_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_9.1: type = value_of_initializer %int.make_type_32.loc15_15 [template = i32] diff --git a/toolchain/check/testdata/const/fail_collapse.carbon b/toolchain/check/testdata/const/fail_collapse.carbon index 2132f633b360..2234e7e744fc 100644 --- a/toolchain/check/testdata/const/fail_collapse.carbon +++ b/toolchain/check/testdata/const/fail_collapse.carbon @@ -35,17 +35,8 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -54,6 +45,15 @@ fn G(p: const (const i32)**) -> i32** { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc15_22: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_16.1: type = value_of_initializer %int.make_type_32.loc15_22 [template = i32] diff --git a/toolchain/check/testdata/const/import.carbon b/toolchain/check/testdata/const/import.carbon index d1ae8a858908..71cd29a12755 100644 --- a/toolchain/check/testdata/const/import.carbon +++ b/toolchain/check/testdata/const/import.carbon @@ -39,20 +39,8 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .a_ref = %a_ref -// CHECK:STDOUT: .a_ptr_ref = %a_ptr_ref -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -61,6 +49,17 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .a_ref = %a_ref +// CHECK:STDOUT: .a_ptr_ref = %a_ptr_ref +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] @@ -110,25 +109,10 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+15, unloaded -// CHECK:STDOUT: %import_ref.2: ref %.2 = import_ref Implicit//default, inst+24, loaded -// CHECK:STDOUT: %import_ref.3: ref %.3 = import_ref Implicit//default, inst+36, loaded -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .F = imports.%import_ref.1 -// CHECK:STDOUT: .a_ref = imports.%import_ref.2 -// CHECK:STDOUT: .a_ptr_ref = imports.%import_ref.3 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .a_ptr = %a_ptr -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2: ref %.2 = import_ref Implicit//default, inst+23, loaded +// CHECK:STDOUT: %import_ref.3: ref %.3 = import_ref Implicit//default, inst+34, loaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.4 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -137,6 +121,21 @@ var a_ptr: const i32* = a_ptr_ref; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .F = imports.%import_ref.1 +// CHECK:STDOUT: .a_ref = imports.%import_ref.2 +// CHECK:STDOUT: .a_ptr_ref = imports.%import_ref.3 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .a_ptr = %a_ptr +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] diff --git a/toolchain/check/testdata/eval/aggregate.carbon b/toolchain/check/testdata/eval/aggregate.carbon index 013acdc81756..8aee43601ef7 100644 --- a/toolchain/check/testdata/eval/aggregate.carbon +++ b/toolchain/check/testdata/eval/aggregate.carbon @@ -53,32 +53,8 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .tuple_copy = %tuple_copy -// CHECK:STDOUT: .struct_copy = %struct_copy -// CHECK:STDOUT: .tuple_index = %tuple_index -// CHECK:STDOUT: .struct_access = %struct_access -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -87,6 +63,18 @@ var struct_access: [i32; 1] = (0,) as [i32; {.a = 3, .b = 1}.b]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .tuple_copy = %tuple_copy +// CHECK:STDOUT: .struct_copy = %struct_copy +// CHECK:STDOUT: .tuple_index = %tuple_index +// CHECK:STDOUT: .struct_access = %struct_access +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_23: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_26.1: %.2 = tuple_literal (%int.make_type_32.loc11_18, %int.make_type_32.loc11_23) diff --git a/toolchain/check/testdata/eval/fail_aggregate.carbon b/toolchain/check/testdata/eval/fail_aggregate.carbon index a2f0bb643524..01f9fb95ebef 100644 --- a/toolchain/check/testdata/eval/fail_aggregate.carbon +++ b/toolchain/check/testdata/eval/fail_aggregate.carbon @@ -39,18 +39,8 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .array_index = %array_index -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -59,6 +49,15 @@ var array_index: [i32; 1] = (0,) as [i32; ((5, 7, 1, 9) as [i32; 4])[2]]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .array_index = %array_index +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_24: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc16_19.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/eval/fail_symbolic.carbon b/toolchain/check/testdata/eval/fail_symbolic.carbon index 014277a8db36..32211a76cb04 100644 --- a/toolchain/check/testdata/eval/fail_symbolic.carbon +++ b/toolchain/check/testdata/eval/fail_symbolic.carbon @@ -28,17 +28,8 @@ fn G(N:! i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -47,6 +38,15 @@ fn G(N:! i32) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_10.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/eval/symbolic.carbon b/toolchain/check/testdata/eval/symbolic.carbon index 70016feda923..c0724fcace72 100644 --- a/toolchain/check/testdata/eval/symbolic.carbon +++ b/toolchain/check/testdata/eval/symbolic.carbon @@ -34,13 +34,8 @@ fn F(T:! type) { // CHECK:STDOUT: %.11: type = ptr_type %.10 [symbolic] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -49,6 +44,14 @@ fn F(T:! type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %T.loc12_6.1: type = param T // CHECK:STDOUT: @F.%T.loc12: type = bind_symbolic_name T 0, %T.loc12_6.1 [symbolic = @F.%T.1 (constants.%T)] diff --git a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon index 40c2ada3764b..5498288c1e7d 100644 --- a/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon +++ b/toolchain/check/testdata/expr_category/in_place_tuple_init.carbon @@ -39,24 +39,8 @@ fn H() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .H = %H.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -65,6 +49,17 @@ fn H() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .H = %H.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index 6e46a360b47a..b3ad4650670c 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -28,20 +28,8 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +38,16 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Add = %Add.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/function/builtin/definition.carbon b/toolchain/check/testdata/function/builtin/definition.carbon index d1d382950cf4..9b213b9989ab 100644 --- a/toolchain/check/testdata/function/builtin/definition.carbon +++ b/toolchain/check/testdata/function/builtin/definition.carbon @@ -21,18 +21,8 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -41,6 +31,15 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Add = %Add.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type = fn_decl @Add [template = constants.%Add] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/function/builtin/fail_redefined.carbon b/toolchain/check/testdata/function/builtin/fail_redefined.carbon index fe9761499c58..cff1c7b4def5 100644 --- a/toolchain/check/testdata/function/builtin/fail_redefined.carbon +++ b/toolchain/check/testdata/function/builtin/fail_redefined.carbon @@ -52,35 +52,8 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.15: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.16: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.17: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.18: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl.loc11 -// CHECK:STDOUT: .B = %B.decl.loc21 -// CHECK:STDOUT: .C = %C.decl.loc31 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -89,6 +62,17 @@ fn C(n: i32, m: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl.loc11 +// CHECK:STDOUT: .B = %B.decl.loc21 +// CHECK:STDOUT: .C = %C.decl.loc31 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl.loc11: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] diff --git a/toolchain/check/testdata/function/builtin/fail_unknown.carbon b/toolchain/check/testdata/function/builtin/fail_unknown.carbon index 906a6d205c42..ddf4ebeeea5b 100644 --- a/toolchain/check/testdata/function/builtin/fail_unknown.carbon +++ b/toolchain/check/testdata/function/builtin/fail_unknown.carbon @@ -21,13 +21,8 @@ fn UnknownBuiltin() = "unknown.builtin.name"; // CHECK:STDOUT: %UnknownBuiltin: %UnknownBuiltin.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .UnknownBuiltin = %UnknownBuiltin.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -36,6 +31,14 @@ fn UnknownBuiltin() = "unknown.builtin.name"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .UnknownBuiltin = %UnknownBuiltin.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %UnknownBuiltin.decl: %UnknownBuiltin.type = fn_decl @UnknownBuiltin [template = constants.%UnknownBuiltin] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/method.carbon b/toolchain/check/testdata/function/builtin/method.carbon index 08e9086b66d4..f637dc4f42c9 100644 --- a/toolchain/check/testdata/function/builtin/method.carbon +++ b/toolchain/check/testdata/function/builtin/method.carbon @@ -42,21 +42,8 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -65,6 +52,16 @@ var arr: [i32; 1.(I.F)(2)]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon index 3ab5807dbaf8..5f325e81f07f 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon @@ -109,7 +109,7 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: %.4: i32 = int_literal 1 [template] // CHECK:STDOUT: %.5: i32 = int_literal 2 [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @Add, %Op.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] // CHECK:STDOUT: %.8: = bound_method %.4, %Op.1 [template] // CHECK:STDOUT: %.9: i32 = int_literal 3 [template] // CHECK:STDOUT: %.10: type = array_type %.9, i32 [template] @@ -123,31 +123,30 @@ var arr: [i32; 1 + 2] = (3, 4, 3 + 4); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Add = %import_ref.2 +// CHECK:STDOUT: import Core//default +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//default, inst+2, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: type = import_ref Core//default, inst+6, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.3 = import_ref Core//default, inst+8, unloaded // CHECK:STDOUT: %import_ref.4: %.6 = import_ref Core//default, inst+29, loaded [template = constants.%.7] // CHECK:STDOUT: %import_ref.5: %Op.type.2 = import_ref Core//default, inst+24, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//default, inst+2, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: type = import_ref Core//default, inst+6, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.8 = import_ref Core//default, inst+24, unloaded -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//default, inst+6, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//default, inst+24, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//default -// CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_6.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_6.2: type = converted %int.make_type_32.loc6, %.loc6_6.1 [template = i32] -// CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.2 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc10: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon index 466f755752e4..c3b47fe58952 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon +++ b/toolchain/check/testdata/function/builtin/no_prelude/import.carbon @@ -80,21 +80,23 @@ var arr: [i32; Core.TestAdd(1, 2)] = (1, 2, 3); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .TestAdd = %import_ref.2 +// CHECK:STDOUT: import Core//test +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//test, inst+2, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: %TestAdd.type = import_ref Core//test, inst+20, loaded [template = constants.%TestAdd] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .arr = %arr // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//test -// CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] -// CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %TestAdd.ref: %TestAdd.type = name_ref TestAdd, imports.%import_ref.2 [template = constants.%TestAdd] // CHECK:STDOUT: %.loc4_29: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc4_32: i32 = int_literal 2 [template = constants.%.3] diff --git a/toolchain/check/testdata/function/call/fail_not_callable.carbon b/toolchain/check/testdata/function/call/fail_not_callable.carbon index d8b497f16bdf..e5317efde671 100644 --- a/toolchain/check/testdata/function/call/fail_not_callable.carbon +++ b/toolchain/check/testdata/function/call/fail_not_callable.carbon @@ -28,16 +28,8 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +38,15 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/call/fail_param_count.carbon b/toolchain/check/testdata/function/call/fail_param_count.carbon index b8266e7cb63f..73535ac723b8 100644 --- a/toolchain/check/testdata/function/call/fail_param_count.carbon +++ b/toolchain/check/testdata/function/call/fail_param_count.carbon @@ -83,21 +83,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Run0 = %Run0.decl -// CHECK:STDOUT: .Run1 = %Run1.decl -// CHECK:STDOUT: .Run2 = %Run2.decl -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -106,6 +93,18 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Run0 = %Run0.decl +// CHECK:STDOUT: .Run1 = %Run1.decl +// CHECK:STDOUT: .Run2 = %Run2.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Run0.decl: %Run0.type = fn_decl @Run0 [template = constants.%Run0] {} // CHECK:STDOUT: %Run1.decl: %Run1.type = fn_decl @Run1 [template = constants.%Run1] { // CHECK:STDOUT: %int.make_type_32.loc12: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/function/call/fail_param_type.carbon b/toolchain/check/testdata/function/call/fail_param_type.carbon index 5146b25df30f..eccb9cdc226e 100644 --- a/toolchain/check/testdata/function/call/fail_param_type.carbon +++ b/toolchain/check/testdata/function/call/fail_param_type.carbon @@ -34,17 +34,8 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -53,6 +44,16 @@ fn F() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon index 2a07bb7ebb5b..065e68205b4c 100644 --- a/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon +++ b/toolchain/check/testdata/function/call/fail_return_type_mismatch.carbon @@ -34,18 +34,9 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -54,6 +45,17 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %.loc11_13.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc11_13.1) [template = f64] diff --git a/toolchain/check/testdata/function/call/i32.carbon b/toolchain/check/testdata/function/call/i32.carbon index e3f5f96c5558..ca60dd53ffa9 100644 --- a/toolchain/check/testdata/function/call/i32.carbon +++ b/toolchain/check/testdata/function/call/i32.carbon @@ -30,19 +30,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Echo = %Echo.decl -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,6 +40,16 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Echo = %Echo.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Echo.decl: %Echo.type = fn_decl @Echo [template = constants.%Echo] { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_12.1: type = value_of_initializer %int.make_type_32.loc11_12 [template = i32] diff --git a/toolchain/check/testdata/function/call/more_param_ir.carbon b/toolchain/check/testdata/function/call/more_param_ir.carbon index 5ceaba2b6250..0fd692f5c9f0 100644 --- a/toolchain/check/testdata/function/call/more_param_ir.carbon +++ b/toolchain/check/testdata/function/call/more_param_ir.carbon @@ -35,19 +35,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -56,6 +45,16 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/function/call/params_one.carbon b/toolchain/check/testdata/function/call/params_one.carbon index e6db58ffcbc3..d540db2abab3 100644 --- a/toolchain/check/testdata/function/call/params_one.carbon +++ b/toolchain/check/testdata/function/call/params_one.carbon @@ -28,17 +28,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -47,6 +38,16 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/function/call/params_one_comma.carbon b/toolchain/check/testdata/function/call/params_one_comma.carbon index 46ba50e14d35..35287c752ac4 100644 --- a/toolchain/check/testdata/function/call/params_one_comma.carbon +++ b/toolchain/check/testdata/function/call/params_one_comma.carbon @@ -29,17 +29,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -48,6 +39,16 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/function/call/params_two.carbon b/toolchain/check/testdata/function/call/params_two.carbon index f3d78635c0e1..8fa6732837cd 100644 --- a/toolchain/check/testdata/function/call/params_two.carbon +++ b/toolchain/check/testdata/function/call/params_two.carbon @@ -29,18 +29,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -49,6 +39,16 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/function/call/params_two_comma.carbon b/toolchain/check/testdata/function/call/params_two_comma.carbon index b032be8285e8..8658f6330c7c 100644 --- a/toolchain/check/testdata/function/call/params_two_comma.carbon +++ b/toolchain/check/testdata/function/call/params_two_comma.carbon @@ -30,18 +30,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +40,16 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon index 52ce0903fee5..35d66af028cb 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_in_type.carbon @@ -24,17 +24,8 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +34,15 @@ fn F(n: i32, a: [i32; n]*); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_9.1: type = value_of_initializer %int.make_type_32.loc14_9 [template = i32] diff --git a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon index a8d1be4a95eb..28ef7267e28e 100644 --- a/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_param_redecl.carbon @@ -27,17 +27,8 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +37,15 @@ fn F(n: i32, n: i32); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc17_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc17_9.1: type = value_of_initializer %int.make_type_32.loc17_9 [template = i32] diff --git a/toolchain/check/testdata/function/declaration/import.carbon b/toolchain/check/testdata/function/declaration/import.carbon index 3cacee39c1d9..e604e431f4a5 100644 --- a/toolchain/check/testdata/function/declaration/import.carbon +++ b/toolchain/check/testdata/function/declaration/import.carbon @@ -389,23 +389,8 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -414,6 +399,19 @@ import library "extern_api"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%Int32() [template = i32] @@ -481,23 +479,8 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -506,6 +489,19 @@ import library "extern_api"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc5_16: init type = call constants.%Int32() [template = i32] @@ -575,11 +571,24 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+44, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+47, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: %E.type = import_ref Main//api, inst+51, loaded [template = constants.%E] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+21, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+41, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+44, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+47, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+48, loaded [template = constants.%E] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.7 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -589,8 +598,8 @@ import library "extern_api"; // CHECK:STDOUT: .B = imports.%import_ref.2 // CHECK:STDOUT: .C = imports.%import_ref.3 // CHECK:STDOUT: .D = imports.%import_ref.4 -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c @@ -599,19 +608,6 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//api, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .E = imports.%import_ref.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -668,8 +664,8 @@ import library "extern_api"; // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() // CHECK:STDOUT: assign file.%d.var, %D.call -// CHECK:STDOUT: %NS.ref: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.5 [template = constants.%E] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.6 [template = constants.%E] // CHECK:STDOUT: %E.call: init %.1 = call %E.ref() // CHECK:STDOUT: assign file.%e.var, %E.call // CHECK:STDOUT: return @@ -700,39 +696,16 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+44, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+47, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: %E.type = import_ref Main//api, inst+51, loaded [template = constants.%E] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b.loc13 -// CHECK:STDOUT: .c = %c.loc14 -// CHECK:STDOUT: .d = %d -// CHECK:STDOUT: .e = %e +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+21, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+41, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+44, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+47, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: .E = file.%E.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//api, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .E = %E.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+48, loaded [template = constants.%E] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -741,6 +714,25 @@ import library "extern_api"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b.loc13 +// CHECK:STDOUT: .c = %c.loc14 +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: .e = %e +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc7_16: init type = call constants.%Int32() [template = i32] @@ -825,7 +817,7 @@ import library "extern_api"; // CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() // CHECK:STDOUT: assign file.%d.var, %D.call -// CHECK:STDOUT: %NS.ref: = name_ref NS, file.%NS [template = file.%NS] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] // CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%E.decl [template = constants.%E] // CHECK:STDOUT: %E.call: init %.1 = call %E.ref() // CHECK:STDOUT: assign file.%e.var, %E.call @@ -857,39 +849,16 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//extern_api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+44, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+47, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: %E.type = import_ref Main//extern_api, inst+51, loaded [template = constants.%E] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b.loc13 -// CHECK:STDOUT: .c = %c.loc14 -// CHECK:STDOUT: .d = %d -// CHECK:STDOUT: .e = %e +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, inst+21, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+41, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+44, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+47, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: .E = file.%E.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//extern_api, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .E = %E.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, inst+48, loaded [template = constants.%E] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -898,6 +867,25 @@ import library "extern_api"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b.loc13 +// CHECK:STDOUT: .c = %c.loc14 +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: .e = %e +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc7_16: init type = call constants.%Int32() [template = i32] @@ -982,7 +970,7 @@ import library "extern_api"; // CHECK:STDOUT: %D.ref: %D.type = name_ref D, file.%D.decl [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() // CHECK:STDOUT: assign file.%d.var, %D.call -// CHECK:STDOUT: %NS.ref: = name_ref NS, file.%NS [template = file.%NS] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] // CHECK:STDOUT: %E.ref: %E.type = name_ref E, file.%E.decl [template = constants.%E] // CHECK:STDOUT: %E.call: init %.1 = call %E.ref() // CHECK:STDOUT: assign file.%e.var, %E.call @@ -1013,16 +1001,29 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+44, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+47, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: %E.type = import_ref Main//api, inst+51, loaded [template = constants.%E] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//extern_api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//extern_api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//extern_api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//extern_api, inst+47, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//extern_api, inst+51, unloaded -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//api, inst+21, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//api, inst+41, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//api, inst+44, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+47, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//api, inst+48, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//extern_api, inst+3, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//extern_api, inst+21, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//extern_api, inst+41, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//extern_api, inst+44, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//extern_api, inst+48, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.12 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1032,8 +1033,8 @@ import library "extern_api"; // CHECK:STDOUT: .B = imports.%import_ref.2 // CHECK:STDOUT: .C = imports.%import_ref.3 // CHECK:STDOUT: .D = imports.%import_ref.4 -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c @@ -1042,19 +1043,6 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//api, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .E = imports.%import_ref.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %.loc72_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc72_9.2: type = converted %.loc72_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -1111,8 +1099,8 @@ import library "extern_api"; // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() // CHECK:STDOUT: assign file.%d.var, %D.call -// CHECK:STDOUT: %NS.ref: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.5 [template = constants.%E] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.6 [template = constants.%E] // CHECK:STDOUT: %E.call: init %.1 = call %E.ref() // CHECK:STDOUT: assign file.%e.var, %E.call // CHECK:STDOUT: return @@ -1142,16 +1130,29 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//extern_api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, inst+22, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+44, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+47, loaded [template = constants.%D] -// CHECK:STDOUT: %import_ref.5: %E.type = import_ref Main//extern_api, inst+51, loaded [template = constants.%E] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//api, inst+47, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//api, inst+51, unloaded -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//extern_api, inst+21, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//extern_api, inst+41, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//extern_api, inst+44, loaded [template = constants.%D] +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+47, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: .E = %import_ref.6 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.6: %E.type = import_ref Main//extern_api, inst+48, loaded [template = constants.%E] +// CHECK:STDOUT: %import_ref.7 = import_ref Main//api, inst+3, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//api, inst+21, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//api, inst+41, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//api, inst+44, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//api, inst+48, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.12 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: @@ -1161,8 +1162,8 @@ import library "extern_api"; // CHECK:STDOUT: .B = imports.%import_ref.2 // CHECK:STDOUT: .C = imports.%import_ref.3 // CHECK:STDOUT: .D = imports.%import_ref.4 -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = %b // CHECK:STDOUT: .c = %c @@ -1171,19 +1172,6 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//extern_api, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .E = imports.%import_ref.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %.loc72_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc72_9.2: type = converted %.loc72_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -1240,8 +1228,8 @@ import library "extern_api"; // CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() // CHECK:STDOUT: assign file.%d.var, %D.call -// CHECK:STDOUT: %NS.ref: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.5 [template = constants.%E] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %E.ref: %E.type = name_ref E, imports.%import_ref.6 [template = constants.%E] // CHECK:STDOUT: %E.call: init %.1 = call %E.ref() // CHECK:STDOUT: assign file.%e.var, %E.call // CHECK:STDOUT: return @@ -1257,29 +1245,15 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//extern_api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//extern_api, inst+51, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .D = imports.%import_ref.4 -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+41, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+44, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+47, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//extern_api, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .E = imports.%import_ref.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extern_api, inst+48, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -1288,6 +1262,20 @@ import library "extern_api"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -1319,30 +1307,16 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//extern_api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//extern_api, inst+51, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = imports.%import_ref.1 -// CHECK:STDOUT: .B = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .D = imports.%import_ref.4 -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+41, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+44, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+47, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//extern_api, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .E = imports.%import_ref.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extern_api, inst+48, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -1351,6 +1325,21 @@ import library "extern_api"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -1387,29 +1376,15 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//api, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//api, inst+51, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .D = imports.%import_ref.4 -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+41, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+44, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+47, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//api, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .E = imports.%import_ref.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.6 = import_ref Main//api, inst+48, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -1418,6 +1393,20 @@ import library "extern_api"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -1439,28 +1428,15 @@ import library "extern_api"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//api, inst+51, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = imports.%import_ref.1 -// CHECK:STDOUT: .B = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .D = imports.%import_ref.4 -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+41, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+44, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+47, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//api, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .E = imports.%import_ref.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.6 = import_ref Main//api, inst+48, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -1471,32 +1447,32 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- unloaded_extern.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//extern_api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//extern_api, inst+51, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = imports.%import_ref.1 -// CHECK:STDOUT: .B = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .D = imports.%import_ref.4 -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: %import_ref.2 = import_ref Main//extern_api, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//extern_api, inst+41, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//extern_api, inst+44, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//extern_api, inst+47, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//extern_api, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .E = imports.%import_ref.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.6 = import_ref Main//extern_api, inst+48, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -1507,37 +1483,37 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_todo_loaded_merge.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+47, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//api, inst+51, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//extern_api, inst+3, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//extern_api, inst+22, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//extern_api, inst+44, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//extern_api, inst+47, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//extern_api, inst+51, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = imports.%import_ref.1 -// CHECK:STDOUT: .B = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .D = imports.%import_ref.4 -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: %import_ref.2 = import_ref Main//api, inst+21, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//api, inst+41, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//api, inst+44, unloaded +// CHECK:STDOUT: %import_ref.5: = import_ref Main//api, inst+47, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.5, [template] { +// CHECK:STDOUT: .E = %import_ref.6 // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//api, inst+50, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .E = imports.%import_ref.5 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.6 = import_ref Main//api, inst+48, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//extern_api, inst+3, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Main//extern_api, inst+21, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Main//extern_api, inst+41, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Main//extern_api, inst+44, unloaded +// CHECK:STDOUT: %import_ref.11 = import_ref Main//extern_api, inst+48, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -1548,3 +1524,16 @@ import library "extern_api"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/declaration/param_same_name.carbon b/toolchain/check/testdata/function/declaration/param_same_name.carbon index fbb97814ee29..2a6979d60d68 100644 --- a/toolchain/check/testdata/function/declaration/param_same_name.carbon +++ b/toolchain/check/testdata/function/declaration/param_same_name.carbon @@ -25,18 +25,8 @@ fn G(a: i32); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +35,16 @@ fn G(a: i32); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/function/definition/import.carbon b/toolchain/check/testdata/function/definition/import.carbon index 6116a99be723..7adaffb91a32 100644 --- a/toolchain/check/testdata/function/definition/import.carbon +++ b/toolchain/check/testdata/function/definition/import.carbon @@ -115,22 +115,8 @@ fn D() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -139,6 +125,18 @@ fn D() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc5_9: init type = call constants.%Int32() [template = i32] @@ -202,13 +200,8 @@ fn D() {} // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -217,6 +210,14 @@ fn D() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -242,27 +243,11 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//fns, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, inst+23, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//fns, inst+47, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+59, unloaded -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = imports.%import_ref.1 -// CHECK:STDOUT: .B = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .D = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, inst+22, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Main//fns, inst+44, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+56, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -271,6 +256,22 @@ fn D() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -329,24 +330,11 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: %A.type = import_ref Main//fns, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, inst+23, loaded [template = constants.%B] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+47, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+59, unloaded -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .D = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Main//fns, inst+22, loaded [template = constants.%B] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+44, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//fns, inst+56, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -355,6 +343,19 @@ fn D() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = imports.%import_ref.4 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] { // CHECK:STDOUT: %int.make_type_32.loc27_9: init type = call constants.%Int32() [template = i32] @@ -388,16 +389,7 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %A.type = import_ref Main//extern, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A.decl.loc6 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -406,6 +398,15 @@ fn D() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = %A.decl.loc6 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %A.decl.loc6: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: %A.decl.loc7: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } @@ -425,22 +426,10 @@ fn D() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//fns, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//fns, inst+23, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+47, unloaded -// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//fns, inst+59, loaded [template = constants.%D] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = imports.%import_ref.1 -// CHECK:STDOUT: .B = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .D = %D.decl.loc13 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2 = import_ref Main//fns, inst+22, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Main//fns, inst+44, unloaded +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Main//fns, inst+56, loaded [template = constants.%D] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -449,6 +438,18 @@ fn D() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%import_ref.1 +// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .D = %D.decl.loc13 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %D.decl.loc6: %D.type = fn_decl @D [template = constants.%D] {} // CHECK:STDOUT: %D.decl.loc13: %D.type = fn_decl @D [template = constants.%D] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/import_access.carbon b/toolchain/check/testdata/function/definition/import_access.carbon index 5b59c1b2007e..11b03e0a73e7 100644 --- a/toolchain/check/testdata/function/definition/import_access.carbon +++ b/toolchain/check/testdata/function/definition/import_access.carbon @@ -143,13 +143,8 @@ private fn Redecl() {} // CHECK:STDOUT: %Def: %Def.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Def [private] = %Def.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -158,6 +153,14 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Def [private] = %Def.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Def.decl: %Def.type = fn_decl @Def [template = constants.%Def] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -174,13 +177,8 @@ private fn Redecl() {} // CHECK:STDOUT: %ForwardWithDef: %ForwardWithDef.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .ForwardWithDef [private] = %ForwardWithDef.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -189,6 +187,14 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .ForwardWithDef [private] = %ForwardWithDef.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ForwardWithDef.decl.loc4: %ForwardWithDef.type = fn_decl @ForwardWithDef [template = constants.%ForwardWithDef] {} // CHECK:STDOUT: %ForwardWithDef.decl.loc6: %ForwardWithDef.type = fn_decl @ForwardWithDef [template = constants.%ForwardWithDef] {} // CHECK:STDOUT: } @@ -206,13 +212,8 @@ private fn Redecl() {} // CHECK:STDOUT: %Forward: %Forward.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Forward [private] = %Forward.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -221,6 +222,14 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Forward [private] = %Forward.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Forward.decl: %Forward.type = fn_decl @Forward [template = constants.%Forward] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -236,18 +245,7 @@ private fn Redecl() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %Def.type = import_ref Test//def, inst+3, loaded [template = constants.%Def] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Def [private] = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .f = %f -// CHECK:STDOUT: } -// CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -256,6 +254,17 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Def [private] = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .f = %f +// CHECK:STDOUT: } +// CHECK:STDOUT: %Test.import = import Test +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %f.var: ref %.1 = var f @@ -278,14 +287,8 @@ private fn Redecl() {} // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .f = %f -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -294,6 +297,15 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .f = %f +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %f.var: ref %.1 = var f @@ -313,15 +325,8 @@ private fn Redecl() {} // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Test = %Test -// CHECK:STDOUT: .f = %f -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -330,9 +335,19 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { // CHECK:STDOUT: import Test//def // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Test = imports.%Test +// CHECK:STDOUT: .f = %f +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %f.var: ref %.1 = var f @@ -341,7 +356,7 @@ private fn Redecl() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Test.ref: = name_ref Test, file.%Test [template = file.%Test] +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] // CHECK:STDOUT: assign file.%f.var, // CHECK:STDOUT: return @@ -357,18 +372,7 @@ private fn Redecl() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %ForwardWithDef.type = import_ref Test//forward_with_def, inst+3, loaded [template = constants.%ForwardWithDef] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .ForwardWithDef [private] = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .f = %f -// CHECK:STDOUT: } -// CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -377,6 +381,17 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .ForwardWithDef [private] = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .f = %f +// CHECK:STDOUT: } +// CHECK:STDOUT: %Test.import = import Test +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %f.var: ref %.1 = var f @@ -399,14 +414,8 @@ private fn Redecl() {} // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .f = %f -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -415,6 +424,15 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .f = %f +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %f.var: ref %.1 = var f @@ -434,15 +452,8 @@ private fn Redecl() {} // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Test = %Test -// CHECK:STDOUT: .f = %f -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -451,9 +462,19 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { // CHECK:STDOUT: import Test//forward_with_def // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Test = imports.%Test +// CHECK:STDOUT: .f = %f +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %f.var: ref %.1 = var f @@ -462,7 +483,7 @@ private fn Redecl() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Test.ref: = name_ref Test, file.%Test [template = file.%Test] +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] // CHECK:STDOUT: assign file.%f.var, // CHECK:STDOUT: return @@ -478,18 +499,7 @@ private fn Redecl() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %Forward.type = import_ref Test//forward, inst+3, loaded [template = constants.%Forward] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Forward [private] = %Forward.decl -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .f = %f -// CHECK:STDOUT: } -// CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -498,6 +508,17 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Forward [private] = %Forward.decl +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .f = %f +// CHECK:STDOUT: } +// CHECK:STDOUT: %Test.import = import Test +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %f.var: ref %.1 = var f @@ -524,14 +545,8 @@ private fn Redecl() {} // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .f = %f -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -540,6 +555,15 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .f = %f +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc10_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc10_9.2: type = converted %.loc10_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %f.var: ref %.1 = var f @@ -559,15 +583,8 @@ private fn Redecl() {} // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Test = %Test -// CHECK:STDOUT: .f = %f -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -576,9 +593,19 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { // CHECK:STDOUT: import Test//forward // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Test = imports.%Test +// CHECK:STDOUT: .f = %f +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Test.import = import Test // CHECK:STDOUT: %.loc9_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc9_9.2: type = converted %.loc9_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %f.var: ref %.1 = var f @@ -587,7 +614,7 @@ private fn Redecl() {} // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Test.ref: = name_ref Test, file.%Test [template = file.%Test] +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: assign file.%f.var, // CHECK:STDOUT: return @@ -601,13 +628,8 @@ private fn Redecl() {} // CHECK:STDOUT: %Redecl: %Redecl.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Redecl [private] = %Redecl.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -616,6 +638,14 @@ private fn Redecl() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Redecl [private] = %Redecl.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Redecl.decl.loc4: %Redecl.type = fn_decl @Redecl [template = constants.%Redecl] {} // CHECK:STDOUT: %Redecl.decl.loc6: %Redecl.type = fn_decl @Redecl [template = constants.%Redecl] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/function/definition/params_one.carbon b/toolchain/check/testdata/function/definition/params_one.carbon index cd28abc9cbf9..f741f3186b5b 100644 --- a/toolchain/check/testdata/function/definition/params_one.carbon +++ b/toolchain/check/testdata/function/definition/params_one.carbon @@ -21,16 +21,8 @@ fn Foo(a: i32) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -39,6 +31,15 @@ fn Foo(a: i32) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/function/definition/params_one_comma.carbon b/toolchain/check/testdata/function/definition/params_one_comma.carbon index 01c68ae7842b..cab18c138b54 100644 --- a/toolchain/check/testdata/function/definition/params_one_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_one_comma.carbon @@ -21,16 +21,8 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -39,6 +31,15 @@ fn Foo(a: i32,) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/function/definition/params_two.carbon b/toolchain/check/testdata/function/definition/params_two.carbon index 8cf44c1ddb88..1f196062a798 100644 --- a/toolchain/check/testdata/function/definition/params_two.carbon +++ b/toolchain/check/testdata/function/definition/params_two.carbon @@ -21,17 +21,8 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -40,6 +31,15 @@ fn Foo(a: i32, b: i32) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/function/definition/params_two_comma.carbon b/toolchain/check/testdata/function/definition/params_two_comma.carbon index 528b0e700430..c36bbcf0d2e8 100644 --- a/toolchain/check/testdata/function/definition/params_two_comma.carbon +++ b/toolchain/check/testdata/function/definition/params_two_comma.carbon @@ -21,17 +21,8 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -40,6 +31,15 @@ fn Foo(a: i32, b: i32,) {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon index 8f1b34c62df8..7cdc7b1ac666 100644 --- a/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon +++ b/toolchain/check/testdata/function/generic/fail_todo_param_in_type.carbon @@ -25,17 +25,8 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +35,15 @@ fn F(N:! i32, a: [i32; N]*); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc14_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_10.1: type = value_of_initializer %int.make_type_32.loc14_10 [template = i32] diff --git a/toolchain/check/testdata/function/generic/redeclare.carbon b/toolchain/check/testdata/function/generic/redeclare.carbon index de0c5cb7db29..4bdc042ca366 100644 --- a/toolchain/check/testdata/function/generic/redeclare.carbon +++ b/toolchain/check/testdata/function/generic/redeclare.carbon @@ -111,13 +111,8 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl.loc4 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -126,6 +121,14 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl.loc4 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl.loc4: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %T.loc4_6.1: type = param T // CHECK:STDOUT: %T.loc4_6.2: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = @F.%T.1 (constants.%T)] @@ -178,13 +181,8 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -193,6 +191,14 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %T.loc4_6.1: type = param T // CHECK:STDOUT: @F.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = @F.%T.1 (constants.%T)] @@ -266,13 +272,8 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -281,6 +282,14 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %T.loc4_6.1: type = param T // CHECK:STDOUT: @F.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = @F.%T.1 (constants.%T.1)] @@ -355,13 +364,8 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: %.4: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -370,6 +374,14 @@ fn F(U:! type, T:! type) -> U* { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %T.loc4_6.1: type = param T // CHECK:STDOUT: @F.%T.loc4: type = bind_symbolic_name T 0, %T.loc4_6.1 [symbolic = @F.%T.1 (constants.%T.1)] diff --git a/toolchain/check/testdata/global/class_obj.carbon b/toolchain/check/testdata/global/class_obj.carbon index 7d4c2e4260d2..82affc49417d 100644 --- a/toolchain/check/testdata/global/class_obj.carbon +++ b/toolchain/check/testdata/global/class_obj.carbon @@ -21,14 +21,8 @@ var a: A = {}; // CHECK:STDOUT: %struct: %A = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -37,6 +31,15 @@ var a: A = {}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A] // CHECK:STDOUT: %a.var: ref %A = var a diff --git a/toolchain/check/testdata/global/class_with_fun.carbon b/toolchain/check/testdata/global/class_with_fun.carbon index b942d9f05cd3..06070c59f55a 100644 --- a/toolchain/check/testdata/global/class_with_fun.carbon +++ b/toolchain/check/testdata/global/class_with_fun.carbon @@ -27,15 +27,8 @@ var a: A = {}; // CHECK:STDOUT: %struct: %A = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .ret_a = %ret_a.decl -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +37,16 @@ var a: A = {}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .ret_a = %ret_a.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} // CHECK:STDOUT: %ret_a.decl: %ret_a.type = fn_decl @ret_a [template = constants.%ret_a] { // CHECK:STDOUT: %A.ref.loc12: type = name_ref A, %A.decl [template = constants.%A] diff --git a/toolchain/check/testdata/global/decl.carbon b/toolchain/check/testdata/global/decl.carbon index d1acfaf0675e..983b54d4f993 100644 --- a/toolchain/check/testdata/global/decl.carbon +++ b/toolchain/check/testdata/global/decl.carbon @@ -18,16 +18,8 @@ var a: i32; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -36,6 +28,15 @@ var a: i32; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32, %.loc10_8.1 [template = i32] diff --git a/toolchain/check/testdata/global/simple_init.carbon b/toolchain/check/testdata/global/simple_init.carbon index 4fa9f93b29d6..70a06e2c15c7 100644 --- a/toolchain/check/testdata/global/simple_init.carbon +++ b/toolchain/check/testdata/global/simple_init.carbon @@ -19,16 +19,8 @@ var a: i32 = 0; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -37,6 +29,15 @@ var a: i32 = 0; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc10_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc10_8.2: type = converted %int.make_type_32, %.loc10_8.1 [template = i32] diff --git a/toolchain/check/testdata/global/simple_with_fun.carbon b/toolchain/check/testdata/global/simple_with_fun.carbon index cbb731389d22..4ea7d9ee14ac 100644 --- a/toolchain/check/testdata/global/simple_with_fun.carbon +++ b/toolchain/check/testdata/global/simple_with_fun.carbon @@ -26,18 +26,8 @@ var a: i32 = test_a(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .test_a = %test_a.decl -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +36,16 @@ var a: i32 = test_a(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .test_a = %test_a.decl +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %test_a.decl: %test_a.type = fn_decl @test_a [template = constants.%test_a] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/if/else.carbon b/toolchain/check/testdata/if/else.carbon index 29f6ebb19448..e70f29f04573 100644 --- a/toolchain/check/testdata/if/else.carbon +++ b/toolchain/check/testdata/if/else.carbon @@ -38,19 +38,8 @@ fn If(b: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .H = %H.decl -// CHECK:STDOUT: .If = %If.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -59,6 +48,18 @@ fn If(b: bool) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .H = %H.decl +// CHECK:STDOUT: .If = %If.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} // CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {} diff --git a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon index 87326341e74e..1b2733094bd2 100644 --- a/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/fail_reachable_fallthrough.carbon @@ -58,23 +58,9 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .If1 = %If1.decl -// CHECK:STDOUT: .If2 = %If2.decl -// CHECK:STDOUT: .If3 = %If3.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -83,6 +69,18 @@ fn If3(b: bool) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .If1 = %If1.decl +// CHECK:STDOUT: .If2 = %If2.decl +// CHECK:STDOUT: .If3 = %If3.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %If1.decl: %If1.type = fn_decl @If1 [template = constants.%If1] { // CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] diff --git a/toolchain/check/testdata/if/fail_scope.carbon b/toolchain/check/testdata/if/fail_scope.carbon index 0f29f384e0ec..c81be781ac87 100644 --- a/toolchain/check/testdata/if/fail_scope.carbon +++ b/toolchain/check/testdata/if/fail_scope.carbon @@ -33,18 +33,9 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .VarScope = %VarScope.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -53,6 +44,16 @@ fn VarScope(b: bool) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .VarScope = %VarScope.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %VarScope.decl: %VarScope.type = fn_decl @VarScope [template = constants.%VarScope] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/check/testdata/if/no_else.carbon b/toolchain/check/testdata/if/no_else.carbon index cbff351bf201..3039e7cb5ddf 100644 --- a/toolchain/check/testdata/if/no_else.carbon +++ b/toolchain/check/testdata/if/no_else.carbon @@ -33,18 +33,8 @@ fn If(b: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .If = %If.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -53,6 +43,17 @@ fn If(b: bool) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .If = %If.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} // CHECK:STDOUT: %If.decl: %If.type = fn_decl @If [template = constants.%If] { diff --git a/toolchain/check/testdata/if/unreachable_fallthrough.carbon b/toolchain/check/testdata/if/unreachable_fallthrough.carbon index 544ad5b3b1ed..0ee3c10dd744 100644 --- a/toolchain/check/testdata/if/unreachable_fallthrough.carbon +++ b/toolchain/check/testdata/if/unreachable_fallthrough.carbon @@ -32,17 +32,9 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .If = %If.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,6 +43,16 @@ fn If(b: bool) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .If = %If.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %If.decl: %If.type = fn_decl @If [template = constants.%If] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_10.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/check/testdata/if_expr/basic.carbon b/toolchain/check/testdata/if_expr/basic.carbon index 5f05e3044b44..527d7d248c10 100644 --- a/toolchain/check/testdata/if_expr/basic.carbon +++ b/toolchain/check/testdata/if_expr/basic.carbon @@ -32,20 +32,9 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -54,6 +43,16 @@ fn F(b: bool, n: i32, m: i32) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/check/testdata/if_expr/constant_condition.carbon b/toolchain/check/testdata/if_expr/constant_condition.carbon index e0ec1fa0ac22..a4812b8a5a84 100644 --- a/toolchain/check/testdata/if_expr/constant_condition.carbon +++ b/toolchain/check/testdata/if_expr/constant_condition.carbon @@ -57,32 +57,8 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .Constant = %Constant.decl -// CHECK:STDOUT: .PartiallyConstant = %PartiallyConstant.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -91,6 +67,20 @@ fn PartiallyConstant(t: type) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .Constant = %Constant.decl +// CHECK:STDOUT: .PartiallyConstant = %PartiallyConstant.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/if_expr/control_flow.carbon b/toolchain/check/testdata/if_expr/control_flow.carbon index 3fbee845db17..f90165128445 100644 --- a/toolchain/check/testdata/if_expr/control_flow.carbon +++ b/toolchain/check/testdata/if_expr/control_flow.carbon @@ -34,21 +34,9 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -57,6 +45,18 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon index 72268dc435a7..6cb00b8f788b 100644 --- a/toolchain/check/testdata/if_expr/fail_not_in_function.carbon +++ b/toolchain/check/testdata/if_expr/fail_not_in_function.carbon @@ -55,19 +55,9 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = .inst+12.loc23_5 -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Float = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -76,6 +66,17 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = .inst+12.loc23_5 +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc23_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc23_8.2: type = converted %int.make_type_32, %.loc23_8.1 [template = i32] @@ -88,7 +89,7 @@ class C { // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: .n = .inst+49.loc37_8 +// CHECK:STDOUT: .n = .inst+48.loc37_8 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon index eb2bbc64b336..9248fcc9587d 100644 --- a/toolchain/check/testdata/if_expr/fail_partial_constant.carbon +++ b/toolchain/check/testdata/if_expr/fail_partial_constant.carbon @@ -53,18 +53,9 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .ConditionIsNonConstant = %ConditionIsNonConstant.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -73,6 +64,16 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .ConditionIsNonConstant = %ConditionIsNonConstant.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ConditionIsNonConstant.decl: %ConditionIsNonConstant.type = fn_decl @ConditionIsNonConstant [template = constants.%ConditionIsNonConstant] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc4_30.1: type = value_of_initializer %bool.make_type [template = bool] @@ -126,17 +127,8 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .ChosenBranchIsNonConstant = %ChosenBranchIsNonConstant.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -145,6 +137,15 @@ fn ChosenBranchIsNonConstant(t: type) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .ChosenBranchIsNonConstant = %ChosenBranchIsNonConstant.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ChosenBranchIsNonConstant.decl: %ChosenBranchIsNonConstant.type = fn_decl @ChosenBranchIsNonConstant [template = constants.%ChosenBranchIsNonConstant] { // CHECK:STDOUT: %t.loc4_30.1: type = param t // CHECK:STDOUT: @ChosenBranchIsNonConstant.%t: type = bind_name t, %t.loc4_30.1 diff --git a/toolchain/check/testdata/if_expr/nested.carbon b/toolchain/check/testdata/if_expr/nested.carbon index efb2f3273e71..e8b94acd105e 100644 --- a/toolchain/check/testdata/if_expr/nested.carbon +++ b/toolchain/check/testdata/if_expr/nested.carbon @@ -29,19 +29,9 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +40,16 @@ fn F(a: bool, b: bool, c: bool) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type.loc11_9: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type.loc11_9 [template = bool] diff --git a/toolchain/check/testdata/if_expr/struct.carbon b/toolchain/check/testdata/if_expr/struct.carbon index 3eaec0565c1a..56b53c657fa3 100644 --- a/toolchain/check/testdata/if_expr/struct.carbon +++ b/toolchain/check/testdata/if_expr/struct.carbon @@ -35,21 +35,9 @@ fn F(cond: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -58,6 +46,17 @@ fn F(cond: bool) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_14 [template = i32] diff --git a/toolchain/check/testdata/impl/compound.carbon b/toolchain/check/testdata/impl/compound.carbon index 262343d458e2..8d5f3303482a 100644 --- a/toolchain/check/testdata/impl/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -67,25 +67,8 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Simple = %Simple.decl -// CHECK:STDOUT: .NonInstanceCall = %NonInstanceCall.decl -// CHECK:STDOUT: .InstanceCall = %InstanceCall.decl -// CHECK:STDOUT: .NonInstanceCallIndirect = %NonInstanceCallIndirect.decl -// CHECK:STDOUT: .InstanceCallIndirect = %InstanceCallIndirect.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -94,6 +77,19 @@ fn InstanceCallIndirect(p: i32*) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Simple = %Simple.decl +// CHECK:STDOUT: .NonInstanceCall = %NonInstanceCall.decl +// CHECK:STDOUT: .InstanceCall = %InstanceCall.decl +// CHECK:STDOUT: .NonInstanceCallIndirect = %NonInstanceCallIndirect.decl +// CHECK:STDOUT: .InstanceCallIndirect = %InstanceCallIndirect.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/impl/declaration.carbon b/toolchain/check/testdata/impl/declaration.carbon index 8ec2a3286330..74330c46af20 100644 --- a/toolchain/check/testdata/impl/declaration.carbon +++ b/toolchain/check/testdata/impl/declaration.carbon @@ -23,16 +23,8 @@ impl i32 as I; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -41,6 +33,15 @@ impl i32 as I; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/impl/empty.carbon b/toolchain/check/testdata/impl/empty.carbon index b638da2049f3..ee82e9ce6161 100644 --- a/toolchain/check/testdata/impl/empty.carbon +++ b/toolchain/check/testdata/impl/empty.carbon @@ -26,16 +26,8 @@ impl i32 as Empty { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Empty = %Empty.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +36,15 @@ impl i32 as Empty { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Empty = %Empty.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/impl/extend_impl.carbon b/toolchain/check/testdata/impl/extend_impl.carbon index d212d0c61924..641c2fa173c9 100644 --- a/toolchain/check/testdata/impl/extend_impl.carbon +++ b/toolchain/check/testdata/impl/extend_impl.carbon @@ -43,15 +43,8 @@ fn G(c: C) { // CHECK:STDOUT: %.7: type = ptr_type %.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .HasF = %HasF.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -60,6 +53,16 @@ fn G(c: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .HasF = %HasF.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { diff --git a/toolchain/check/testdata/impl/fail_call_invalid.carbon b/toolchain/check/testdata/impl/fail_call_invalid.carbon index 3f2123f02e7c..213c4d21a559 100644 --- a/toolchain/check/testdata/impl/fail_call_invalid.carbon +++ b/toolchain/check/testdata/impl/fail_call_invalid.carbon @@ -42,18 +42,8 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Simple = %Simple.decl -// CHECK:STDOUT: .InstanceCall = %InstanceCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -62,6 +52,16 @@ fn InstanceCall(n: i32) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Simple = %Simple.decl +// CHECK:STDOUT: .InstanceCall = %InstanceCall.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon index 2b2000158dba..d6409e2523a0 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_forall.carbon @@ -41,14 +41,8 @@ class C { // CHECK:STDOUT: %.6: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .GenericInterface = %GenericInterface.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -57,6 +51,15 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .GenericInterface = %GenericInterface.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %GenericInterface.decl: %GenericInterface.type = interface_decl @GenericInterface [template = constants.%GenericInterface] { // CHECK:STDOUT: %T.loc11_28.1: type = param T // CHECK:STDOUT: %T.loc11_28.2: type = bind_symbolic_name T 0, %T.loc11_28.1 [symbolic = @GenericInterface.%T (constants.%T)] diff --git a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon index 46ac180fb5cd..c1824f324f8d 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_scope.carbon @@ -27,16 +27,8 @@ extend impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +37,15 @@ extend impl i32 as I {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon index 2cd507164d28..c602ecf2872b 100644 --- a/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon +++ b/toolchain/check/testdata/impl/fail_extend_impl_type_as.carbon @@ -55,19 +55,8 @@ class E { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: .E = %E.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -76,6 +65,18 @@ class E { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .E = %E.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} diff --git a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon index 316ecf208f36..654fe7692f0d 100644 --- a/toolchain/check/testdata/impl/fail_extend_non_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_non_interface.carbon @@ -26,16 +26,8 @@ class C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +36,15 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon index c4a07d8d3b37..4b5bb43068b5 100644 --- a/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_partially_defined_interface.carbon @@ -29,13 +29,8 @@ interface I { // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +39,14 @@ interface I { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon index e81ea52cc75e..a5a5fd7635a8 100644 --- a/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_extend_undefined_interface.carbon @@ -28,14 +28,8 @@ class C { // CHECK:STDOUT: %.2: type = struct_type {} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +38,15 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon index 2e9afee6464c..d7da357b5da9 100644 --- a/toolchain/check/testdata/impl/fail_impl_as_scope.carbon +++ b/toolchain/check/testdata/impl/fail_impl_as_scope.carbon @@ -34,13 +34,8 @@ impl as Simple { // CHECK:STDOUT: %.5: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Simple = %Simple.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -49,6 +44,14 @@ impl as Simple { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Simple = %Simple.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %Simple.ref: type = name_ref Simple, %Simple.decl [template = constants.%.1] diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon index 904b09443206..8ae59cae32ce 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon @@ -28,16 +28,8 @@ impl bool as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +38,15 @@ impl bool as I {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] diff --git a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon index 59dfe58a37cb..9eacbbbcb5d6 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_fn.carbon @@ -302,35 +302,24 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.10: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.11: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.13: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.14: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.15: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.16: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.17: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.18: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.19: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.20: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.21: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.22: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.23: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.24: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: .NoF = %NoF.decl // CHECK:STDOUT: .FNotFunction = %FNotFunction.decl @@ -352,15 +341,6 @@ class SelfNestedBadReturnType { // CHECK:STDOUT: .SelfNestedBadReturnType = %SelfNestedBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %NoF.decl: type = class_decl @NoF [template = constants.%NoF] {} // CHECK:STDOUT: %FNotFunction.decl: type = class_decl @FNotFunction [template = constants.%FNotFunction] {} diff --git a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon index c03c5df6560a..08d94220771a 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_interface.carbon @@ -27,15 +27,8 @@ impl i32 as false {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +37,14 @@ impl i32 as false {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_6.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/impl/fail_impl_bad_type.carbon b/toolchain/check/testdata/impl/fail_impl_bad_type.carbon index 5ea10a03295d..61b453fe63e4 100644 --- a/toolchain/check/testdata/impl/fail_impl_bad_type.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_type.carbon @@ -24,13 +24,8 @@ impl true as I {} // CHECK:STDOUT: %.3: = interface_witness () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -39,6 +34,14 @@ impl true as I {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %.loc16: bool = bool_literal true [template = constants.%.2] diff --git a/toolchain/check/testdata/impl/fail_redefinition.carbon b/toolchain/check/testdata/impl/fail_redefinition.carbon index 0fbc6a3f7d6d..91ddbee26111 100644 --- a/toolchain/check/testdata/impl/fail_redefinition.carbon +++ b/toolchain/check/testdata/impl/fail_redefinition.carbon @@ -32,17 +32,8 @@ impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,6 +42,15 @@ impl i32 as I {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon index 1afe4bdc1e22..99edf20a80bf 100644 --- a/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_todo_impl_assoc_const.carbon @@ -28,16 +28,8 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +38,15 @@ impl bool as I where .T = bool {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] diff --git a/toolchain/check/testdata/impl/impl_as.carbon b/toolchain/check/testdata/impl/impl_as.carbon index a4df5e3d1874..ef5b10d4880e 100644 --- a/toolchain/check/testdata/impl/impl_as.carbon +++ b/toolchain/check/testdata/impl/impl_as.carbon @@ -40,14 +40,8 @@ class C { // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Simple = %Simple.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -56,6 +50,15 @@ class C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Simple = %Simple.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/impl/impl_forall.carbon b/toolchain/check/testdata/impl/impl_forall.carbon index 533247fd06be..e3857625a3a7 100644 --- a/toolchain/check/testdata/impl/impl_forall.carbon +++ b/toolchain/check/testdata/impl/impl_forall.carbon @@ -32,13 +32,8 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: %.5: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Simple = %Simple.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -47,6 +42,14 @@ impl forall [T:! type] T as Simple { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Simple = %Simple.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Simple.decl: type = interface_decl @Simple [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %T.loc15_14.1: type = param T diff --git a/toolchain/check/testdata/impl/lookup/alias.carbon b/toolchain/check/testdata/impl/lookup/alias.carbon index 89ca9d58ee41..4089fe02e124 100644 --- a/toolchain/check/testdata/impl/lookup/alias.carbon +++ b/toolchain/check/testdata/impl/lookup/alias.carbon @@ -45,15 +45,8 @@ fn G(c: C) { // CHECK:STDOUT: %.7: type = ptr_type %.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .HasF = %HasF.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -62,6 +55,16 @@ fn G(c: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .HasF = %HasF.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl { diff --git a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon index 745c4bd4ef4e..963ebc9bd26c 100644 --- a/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_alias_impl_not_found.carbon @@ -45,15 +45,8 @@ fn F(c: C) { // CHECK:STDOUT: %.6: type = ptr_type %.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -62,6 +55,16 @@ fn F(c: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { diff --git a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon index 55adb3c9ccfa..68f439ab9753 100644 --- a/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon +++ b/toolchain/check/testdata/impl/lookup/fail_todo_undefined_impl.carbon @@ -51,18 +51,8 @@ impl C as I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -71,6 +61,17 @@ impl C as I { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %F.decl: %F.type.2 = fn_decl @F.2 [template = constants.%F.2] { diff --git a/toolchain/check/testdata/impl/lookup/import.carbon b/toolchain/check/testdata/impl/lookup/import.carbon index 73dfaaceedc4..de2e241014e9 100644 --- a/toolchain/check/testdata/impl/lookup/import.carbon +++ b/toolchain/check/testdata/impl/lookup/import.carbon @@ -47,14 +47,8 @@ fn G(c: Impl.C) { // CHECK:STDOUT: %.6: = interface_witness (%F.2) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .HasF = %HasF.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -63,6 +57,15 @@ fn G(c: Impl.C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .HasF = %HasF.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %HasF.decl: type = interface_decl @HasF [template = constants.%.1] {} // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl { @@ -129,6 +132,20 @@ fn G(c: Impl.C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %Impl: = namespace file.%Impl.import, [template] { +// CHECK:STDOUT: .C = %import_ref.6 +// CHECK:STDOUT: .HasF = %import_ref.7 +// CHECK:STDOUT: import Impl//default +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref Impl//default, inst+15, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Impl//default, inst+5, unloaded // CHECK:STDOUT: %import_ref.3: %.5 = import_ref Impl//default, inst+12, loaded [template = constants.%.6] @@ -141,26 +158,14 @@ fn G(c: Impl.C) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Impl = %Impl +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Impl = imports.%Impl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Impl.import = import Impl -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } -// CHECK:STDOUT: %Impl: = namespace %Impl.import, [template] { -// CHECK:STDOUT: import Impl//default -// CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Impl.ref: = name_ref Impl, %Impl [template = %Impl] +// CHECK:STDOUT: %Impl.ref: = name_ref Impl, imports.%Impl [template = imports.%Impl] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.6 [template = constants.%C] // CHECK:STDOUT: %c.loc4_6.1: %C = param c // CHECK:STDOUT: @G.%c: %C = bind_name c, %c.loc4_6.1 @@ -184,7 +189,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: fn @G(%c: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %Impl.ref: = name_ref Impl, file.%Impl [template = file.%Impl] +// CHECK:STDOUT: %Impl.ref: = name_ref Impl, imports.%Impl [template = imports.%Impl] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.7 [template = constants.%.2] // CHECK:STDOUT: %F.ref: %.5 = name_ref F, imports.%import_ref.3 [template = constants.%.6] // CHECK:STDOUT: %.1: %F.type.1 = interface_witness_access imports.%import_ref.5, element0 [template = constants.%F.2] diff --git a/toolchain/check/testdata/impl/lookup/instance_method.carbon b/toolchain/check/testdata/impl/lookup/instance_method.carbon index 2b6ea2395842..0b251faefdf6 100644 --- a/toolchain/check/testdata/impl/lookup/instance_method.carbon +++ b/toolchain/check/testdata/impl/lookup/instance_method.carbon @@ -47,20 +47,8 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl.loc11 -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -69,6 +57,17 @@ fn F(c: C) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl.loc11 +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl.loc11: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: %C.decl.loc17: type = class_decl @C [template = constants.%C] {} diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon index 8e02c8e4b562..d4426f6d087d 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon +++ b/toolchain/check/testdata/impl/lookup/no_prelude/import.carbon @@ -118,6 +118,11 @@ fn G(c: Impl.C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Impl: = namespace file.%Impl.import, [template] { +// CHECK:STDOUT: .C = %import_ref.6 +// CHECK:STDOUT: .HasF = %import_ref.7 +// CHECK:STDOUT: import Impl//default +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1 = import_ref Impl//default, inst+13, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Impl//default, inst+3, unloaded // CHECK:STDOUT: %import_ref.3: %.5 = import_ref Impl//default, inst+10, loaded [template = constants.%.6] @@ -130,15 +135,12 @@ fn G(c: Impl.C) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Impl = %Impl +// CHECK:STDOUT: .Impl = imports.%Impl // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Impl.import = import Impl -// CHECK:STDOUT: %Impl: = namespace %Impl.import, [template] { -// CHECK:STDOUT: import Impl//default -// CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %Impl.ref: = name_ref Impl, %Impl [template = %Impl] +// CHECK:STDOUT: %Impl.ref: = name_ref Impl, imports.%Impl [template = imports.%Impl] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.6 [template = constants.%C] // CHECK:STDOUT: %c.loc4_6.1: %C = param c // CHECK:STDOUT: @G.%c: %C = bind_name c, %c.loc4_6.1 @@ -162,7 +164,7 @@ fn G(c: Impl.C) { // CHECK:STDOUT: fn @G(%c: %C) { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %c.ref: %C = name_ref c, %c -// CHECK:STDOUT: %Impl.ref: = name_ref Impl, file.%Impl [template = file.%Impl] +// CHECK:STDOUT: %Impl.ref: = name_ref Impl, imports.%Impl [template = imports.%Impl] // CHECK:STDOUT: %HasF.ref: type = name_ref HasF, imports.%import_ref.7 [template = constants.%.2] // CHECK:STDOUT: %F.ref: %.5 = name_ref F, imports.%import_ref.3 [template = constants.%.6] // CHECK:STDOUT: %.1: %F.type.1 = interface_witness_access imports.%import_ref.5, element0 [template = constants.%F.2] diff --git a/toolchain/check/testdata/impl/redeclaration.carbon b/toolchain/check/testdata/impl/redeclaration.carbon index dd890f2a5f54..dd48c35c3c2e 100644 --- a/toolchain/check/testdata/impl/redeclaration.carbon +++ b/toolchain/check/testdata/impl/redeclaration.carbon @@ -32,19 +32,8 @@ impl i32 as I {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: .X = %X.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -53,6 +42,16 @@ impl i32 as I {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .X = %X.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %int.make_type_32.loc13: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/index/array_element_access.carbon b/toolchain/check/testdata/index/array_element_access.carbon index 5e934aeaf06b..7d35871c361d 100644 --- a/toolchain/check/testdata/index/array_element_access.carbon +++ b/toolchain/check/testdata/index/array_element_access.carbon @@ -31,22 +31,8 @@ var d: i32 = a[b]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: .d = %d -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -55,6 +41,18 @@ var d: i32 = a[b]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 2 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/index/expr_category.carbon b/toolchain/check/testdata/index/expr_category.carbon index 02d2de458a10..60edeb0eabff 100644 --- a/toolchain/check/testdata/index/expr_category.carbon +++ b/toolchain/check/testdata/index/expr_category.carbon @@ -53,23 +53,8 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .ValueBinding = %ValueBinding.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -78,6 +63,17 @@ fn ValueBinding(b: [i32; 3]) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .ValueBinding = %ValueBinding.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17: i32 = int_literal 3 [template = constants.%.2] diff --git a/toolchain/check/testdata/index/fail_array_large_index.carbon b/toolchain/check/testdata/index/fail_array_large_index.carbon index a19d27a29b6a..ba265c3c4974 100644 --- a/toolchain/check/testdata/index/fail_array_large_index.carbon +++ b/toolchain/check/testdata/index/fail_array_large_index.carbon @@ -38,20 +38,8 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -60,6 +48,17 @@ var c: i32 = a[0x7FFF_FFFF]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon index 2cf7c0c92a46..a39aa0ec36d3 100644 --- a/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_array_non_int_indexing.carbon @@ -31,18 +31,8 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,6 +41,16 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon index e0574082fffa..4cde618a09a0 100644 --- a/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_array_out_of_bound_access.carbon @@ -30,18 +30,8 @@ var b: i32 = a[1]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +40,16 @@ var b: i32 = a[1]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 [template = constants.%.2] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/index/fail_empty_tuple_access.carbon b/toolchain/check/testdata/index/fail_empty_tuple_access.carbon index 6708db9b04b4..e1534f45a274 100644 --- a/toolchain/check/testdata/index/fail_empty_tuple_access.carbon +++ b/toolchain/check/testdata/index/fail_empty_tuple_access.carbon @@ -28,14 +28,8 @@ fn Run() { // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +38,15 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/index/fail_expr_category.carbon b/toolchain/check/testdata/index/fail_expr_category.carbon index 4e8bf39106d3..946349ab2b67 100644 --- a/toolchain/check/testdata/index/fail_expr_category.carbon +++ b/toolchain/check/testdata/index/fail_expr_category.carbon @@ -55,20 +55,8 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -77,6 +65,16 @@ fn G(b: [i32; 3]) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17: i32 = int_literal 3 [template = constants.%.2] diff --git a/toolchain/check/testdata/index/fail_invalid_base.carbon b/toolchain/check/testdata/index/fail_invalid_base.carbon index 3858fdde6bcc..d699173531b3 100644 --- a/toolchain/check/testdata/index/fail_invalid_base.carbon +++ b/toolchain/check/testdata/index/fail_invalid_base.carbon @@ -50,26 +50,8 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .N = %N -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: .d = %d -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -78,6 +60,20 @@ var d: i32 = {.a: i32, .b: i32}[0]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .N = %N +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %N: = namespace [template] {} // CHECK:STDOUT: %int.make_type_32.loc16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc16_8.1: type = value_of_initializer %int.make_type_32.loc16 [template = i32] diff --git a/toolchain/check/testdata/index/fail_name_not_found.carbon b/toolchain/check/testdata/index/fail_name_not_found.carbon index f2b006da8e51..9f60f7c8dbdf 100644 --- a/toolchain/check/testdata/index/fail_name_not_found.carbon +++ b/toolchain/check/testdata/index/fail_name_not_found.carbon @@ -27,16 +27,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +37,15 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_negative_indexing.carbon b/toolchain/check/testdata/index/fail_negative_indexing.carbon index 3e84801f1f6a..ea26db0649c4 100644 --- a/toolchain/check/testdata/index/fail_negative_indexing.carbon +++ b/toolchain/check/testdata/index/fail_negative_indexing.carbon @@ -32,28 +32,13 @@ var b: i32 = a[-10]; // CHECK:STDOUT: %Op.type: type = fn_type @Op [template] // CHECK:STDOUT: %Op: %Op.type = struct_value () [template] // CHECK:STDOUT: %.9: type = assoc_entity_type @Negate, %Op.type [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.8 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element0, imports.%import_ref.6 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: type = import_ref Core//prelude/operators/arithmetic, inst+72, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded -// CHECK:STDOUT: %import_ref.6: %.9 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.10] -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Negate = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -62,6 +47,21 @@ var b: i32 = a[-10]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+72, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded +// CHECK:STDOUT: %import_ref.4: %.9 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.10] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) @@ -81,9 +81,9 @@ var b: i32 = a[-10]; // CHECK:STDOUT: // CHECK:STDOUT: interface @Negate { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .Op = imports.%import_ref.6 -// CHECK:STDOUT: witness = (imports.%import_ref.7) +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: .Op = imports.%import_ref.4 +// CHECK:STDOUT: witness = (imports.%import_ref.5) // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; diff --git a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon index 568a80d1f02f..b3da2650e919 100644 --- a/toolchain/check/testdata/index/fail_non_deterministic_type.carbon +++ b/toolchain/check/testdata/index/fail_non_deterministic_type.carbon @@ -31,21 +31,8 @@ var c: i32 = a[b]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -54,6 +41,17 @@ var c: i32 = a[b]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) diff --git a/toolchain/check/testdata/index/fail_non_tuple_access.carbon b/toolchain/check/testdata/index/fail_non_tuple_access.carbon index b73d9c83a7a0..8c1466302e78 100644 --- a/toolchain/check/testdata/index/fail_non_tuple_access.carbon +++ b/toolchain/check/testdata/index/fail_non_tuple_access.carbon @@ -25,13 +25,8 @@ fn Main() { // CHECK:STDOUT: %.3: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -40,6 +35,14 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/index/fail_out_of_bound_not_literal.carbon b/toolchain/check/testdata/index/fail_out_of_bound_not_literal.carbon index 0cd6dc154bbe..7471c6b89db9 100644 --- a/toolchain/check/testdata/index/fail_out_of_bound_not_literal.carbon +++ b/toolchain/check/testdata/index/fail_out_of_bound_not_literal.carbon @@ -32,19 +32,8 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -53,6 +42,16 @@ var b: i32 = a[{.index = 2}.index]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) diff --git a/toolchain/check/testdata/index/fail_tuple_index_error.carbon b/toolchain/check/testdata/index/fail_tuple_index_error.carbon index 880401e1cb6d..0ed7ed38760d 100644 --- a/toolchain/check/testdata/index/fail_tuple_index_error.carbon +++ b/toolchain/check/testdata/index/fail_tuple_index_error.carbon @@ -29,19 +29,8 @@ var b: i32 = a[oops]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +39,16 @@ var b: i32 = a[oops]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) diff --git a/toolchain/check/testdata/index/fail_tuple_large_index.carbon b/toolchain/check/testdata/index/fail_tuple_large_index.carbon index 7c45ff4205d0..5680d7413c2b 100644 --- a/toolchain/check/testdata/index/fail_tuple_large_index.carbon +++ b/toolchain/check/testdata/index/fail_tuple_large_index.carbon @@ -35,22 +35,8 @@ var d: i32 = b[0x7FFF_FFFF]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: .d = %d -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -59,6 +45,18 @@ var d: i32 = b[0x7FFF_FFFF]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: %.2 = tuple_literal (%int.make_type_32.loc11) // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon b/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon index f55e5f704828..80b9c80b2197 100644 --- a/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon +++ b/toolchain/check/testdata/index/fail_tuple_non_int_indexing.carbon @@ -30,19 +30,8 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,6 +40,16 @@ var b: i32 = a[2.6]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) diff --git a/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon b/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon index d12a0458616a..d2794a2f9b6f 100644 --- a/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon +++ b/toolchain/check/testdata/index/fail_tuple_out_of_bound_access.carbon @@ -30,19 +30,8 @@ var b: i32 = a[2]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,6 +40,16 @@ var b: i32 = a[2]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) diff --git a/toolchain/check/testdata/index/index_not_literal.carbon b/toolchain/check/testdata/index/index_not_literal.carbon index dfa6debf6122..0f4b43eb65a8 100644 --- a/toolchain/check/testdata/index/index_not_literal.carbon +++ b/toolchain/check/testdata/index/index_not_literal.carbon @@ -29,19 +29,8 @@ var b: i32 = a[{.index = 1}.index]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +39,16 @@ var b: i32 = a[{.index = 1}.index]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) diff --git a/toolchain/check/testdata/index/tuple_element_access.carbon b/toolchain/check/testdata/index/tuple_element_access.carbon index c3f5b8bdf5da..e4ce8b47c64e 100644 --- a/toolchain/check/testdata/index/tuple_element_access.carbon +++ b/toolchain/check/testdata/index/tuple_element_access.carbon @@ -26,20 +26,8 @@ var c: i32 = b[0]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -48,6 +36,17 @@ var c: i32 = b[0]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: %.2 = tuple_literal (%int.make_type_32.loc11) // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/index/tuple_return_value_access.carbon b/toolchain/check/testdata/index/tuple_return_value_access.carbon index 3d5541b8b890..22f99a667e81 100644 --- a/toolchain/check/testdata/index/tuple_return_value_access.carbon +++ b/toolchain/check/testdata/index/tuple_return_value_access.carbon @@ -31,18 +31,8 @@ fn Run() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .Run = %Run.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,6 +41,16 @@ fn Run() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_16.1: %.2 = tuple_literal (%int.make_type_32.loc11) diff --git a/toolchain/check/testdata/interface/assoc_const.carbon b/toolchain/check/testdata/interface/assoc_const.carbon index 3d58db0ecf17..0e010f9e6922 100644 --- a/toolchain/check/testdata/interface/assoc_const.carbon +++ b/toolchain/check/testdata/interface/assoc_const.carbon @@ -28,16 +28,8 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +38,15 @@ interface I { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon index 528c8af75117..a1e6c6708a19 100644 --- a/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_bad_default.carbon @@ -25,13 +25,8 @@ interface I { // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @I.%T [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -40,6 +35,14 @@ interface I { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon index 50edc1a79cfc..c79ef3cda91e 100644 --- a/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon +++ b/toolchain/check/testdata/interface/fail_todo_assoc_const_default.carbon @@ -38,18 +38,8 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -58,6 +48,15 @@ interface I { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon index db717a64c033..f146b42693cd 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_inline.carbon @@ -40,18 +40,8 @@ interface Interface { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Interface = %Interface.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -60,6 +50,15 @@ interface Interface { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Interface = %Interface.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon index 76e8d2524f2c..191084cae188 100644 --- a/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon +++ b/toolchain/check/testdata/interface/fail_todo_define_default_fn_out_of_line.carbon @@ -62,21 +62,8 @@ fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Interface = %Interface.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -85,6 +72,15 @@ fn Interface.G(a: i32, b: i32) -> i32 = "int.sadd"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Interface = %Interface.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} // CHECK:STDOUT: %.decl.loc32: %.type.1 = fn_decl @.1 [template = constants.%.7] {} // CHECK:STDOUT: %.decl.loc40: %.type.2 = fn_decl @.2 [template = constants.%.8] { diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/no_prelude/import_access.carbon index 6e34b1a1cb7c..508e65a8af66 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/no_prelude/import_access.carbon @@ -264,17 +264,20 @@ private interface Redecl {} // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { +// CHECK:STDOUT: import Test//def +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Test = %Test +// CHECK:STDOUT: .Test = imports.%Test // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { -// CHECK:STDOUT: import Test//def -// CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Test.ref: = name_ref Test, %Test [template = %Test] +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %Def.ref: = name_ref Def, [template = ] // CHECK:STDOUT: %i.loc10_6.1: = param i // CHECK:STDOUT: @F.%i: = bind_name i, %i.loc10_6.1 @@ -359,17 +362,20 @@ private interface Redecl {} // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { +// CHECK:STDOUT: import Test//forward_with_def +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Test = %Test +// CHECK:STDOUT: .Test = imports.%Test // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { -// CHECK:STDOUT: import Test//forward_with_def -// CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %Test.ref: = name_ref Test, %Test [template = %Test] +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %ForwardWithDef.ref: = name_ref ForwardWithDef, [template = ] // CHECK:STDOUT: %i.loc10_6.1: = param i // CHECK:STDOUT: @F.%i: = bind_name i, %i.loc10_6.1 @@ -454,15 +460,18 @@ private interface Redecl {} // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { +// CHECK:STDOUT: import Test//forward +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Test = %Test +// CHECK:STDOUT: .Test = imports.%Test // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { -// CHECK:STDOUT: import Test//forward -// CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %Forward.ref: = name_ref Forward, [template = ] // CHECK:STDOUT: %.loc9: type = ptr_type [template = ] diff --git a/toolchain/check/testdata/interface/todo_define_not_default.carbon b/toolchain/check/testdata/interface/todo_define_not_default.carbon index 8fce07004766..e179cd7363d5 100644 --- a/toolchain/check/testdata/interface/todo_define_not_default.carbon +++ b/toolchain/check/testdata/interface/todo_define_not_default.carbon @@ -45,21 +45,8 @@ interface I { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -68,6 +55,15 @@ interface I { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [template = constants.%.1] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon index 1719cbefe95e..65711e8bcfdb 100644 --- a/toolchain/check/testdata/ir/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/ir/duplicate_name_same_line.carbon @@ -24,17 +24,8 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +34,15 @@ fn A() { if (true) { var n: i32 = 1; } if (true) { var n: i32 = 2; } } // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/convert.carbon b/toolchain/check/testdata/let/convert.carbon index 6ad7f8550df5..b013222eb063 100644 --- a/toolchain/check/testdata/let/convert.carbon +++ b/toolchain/check/testdata/let/convert.carbon @@ -33,22 +33,8 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -57,6 +43,15 @@ fn F() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/let/fail_duplicate_decl.carbon b/toolchain/check/testdata/let/fail_duplicate_decl.carbon index f77a7bfbe7c5..013e90aa7906 100644 --- a/toolchain/check/testdata/let/fail_duplicate_decl.carbon +++ b/toolchain/check/testdata/let/fail_duplicate_decl.carbon @@ -32,17 +32,8 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,6 +42,15 @@ fn F() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_generic.carbon b/toolchain/check/testdata/let/fail_generic.carbon index 42d19704fa56..8f43738e77a4 100644 --- a/toolchain/check/testdata/let/fail_generic.carbon +++ b/toolchain/check/testdata/let/fail_generic.carbon @@ -35,18 +35,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -55,6 +45,15 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc12_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_9.1: type = value_of_initializer %int.make_type_32.loc12_9 [template = i32] diff --git a/toolchain/check/testdata/let/fail_generic_import.carbon b/toolchain/check/testdata/let/fail_generic_import.carbon index ea9f0f4bdeb0..e4a747d06848 100644 --- a/toolchain/check/testdata/let/fail_generic_import.carbon +++ b/toolchain/check/testdata/let/fail_generic_import.carbon @@ -34,16 +34,8 @@ let a: T = 0; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .T = @__global_init.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -52,6 +44,15 @@ let a: T = 0; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .T = @__global_init.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -74,18 +75,7 @@ let a: T = 0; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: type = import_ref Implicit//default, inst+3, loaded [symbolic = constants.%T] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .T = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -94,6 +84,17 @@ let a: T = 0; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .T = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = @__global_init.%a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %T.ref: type = name_ref T, imports.%import_ref [symbolic = constants.%T] // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/fail_missing_value.carbon b/toolchain/check/testdata/let/fail_missing_value.carbon index 5e1b9b5877a9..bb7b50b1cfa2 100644 --- a/toolchain/check/testdata/let/fail_missing_value.carbon +++ b/toolchain/check/testdata/let/fail_missing_value.carbon @@ -32,18 +32,8 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .n = %n -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -52,6 +42,16 @@ fn F() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .n = %n +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/let/fail_modifiers.carbon b/toolchain/check/testdata/let/fail_modifiers.carbon index 1d78d85e428e..07ea0218ad30 100644 --- a/toolchain/check/testdata/let/fail_modifiers.carbon +++ b/toolchain/check/testdata/let/fail_modifiers.carbon @@ -93,19 +93,22 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: .c = @__global_init.%c // CHECK:STDOUT: .d = @__global_init.%d @@ -116,15 +119,6 @@ protected protected let i: i32 = 1; // CHECK:STDOUT: .i = @__global_init.%i // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_18.2: type = converted %int.make_type_32.loc15, %.loc15_18.1 [template = i32] diff --git a/toolchain/check/testdata/let/fail_use_in_init.carbon b/toolchain/check/testdata/let/fail_use_in_init.carbon index bf5c6fd8fc16..f45f3fc47754 100644 --- a/toolchain/check/testdata/let/fail_use_in_init.carbon +++ b/toolchain/check/testdata/let/fail_use_in_init.carbon @@ -26,16 +26,8 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +36,15 @@ fn F() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/generic.carbon b/toolchain/check/testdata/let/generic.carbon index fa026c28f4f9..36dfcbda5cd8 100644 --- a/toolchain/check/testdata/let/generic.carbon +++ b/toolchain/check/testdata/let/generic.carbon @@ -27,16 +27,8 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +37,15 @@ fn F() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/let/generic_import.carbon b/toolchain/check/testdata/let/generic_import.carbon index 413a6be8092d..5a4e2ebd285c 100644 --- a/toolchain/check/testdata/let/generic_import.carbon +++ b/toolchain/check/testdata/let/generic_import.carbon @@ -31,16 +31,8 @@ var b: T = *a; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .T = @__global_init.%T -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -49,6 +41,15 @@ var b: T = *a; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .T = @__global_init.%T +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -71,19 +72,7 @@ var b: T = *a; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: type = import_ref Implicit//default, inst+3, loaded [symbolic = constants.%T] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .T = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -92,6 +81,18 @@ var b: T = *a; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .T = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %T.ref.loc4: type = name_ref T, imports.%import_ref [symbolic = constants.%T] // CHECK:STDOUT: %.loc4: type = ptr_type %T [symbolic = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a diff --git a/toolchain/check/testdata/let/global.carbon b/toolchain/check/testdata/let/global.carbon index 8f975c63c7f9..38b3afd82965 100644 --- a/toolchain/check/testdata/let/global.carbon +++ b/toolchain/check/testdata/let/global.carbon @@ -24,18 +24,8 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .n = @__global_init.%n -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +34,16 @@ fn F() -> i32 { return n; } // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .n = @__global_init.%n +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_8.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_8.2: type = converted %int.make_type_32.loc11, %.loc11_8.1 [template = i32] diff --git a/toolchain/check/testdata/let/local.carbon b/toolchain/check/testdata/let/local.carbon index 4ccba57c5fc8..ea76df0c152e 100644 --- a/toolchain/check/testdata/let/local.carbon +++ b/toolchain/check/testdata/let/local.carbon @@ -24,18 +24,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +34,15 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] diff --git a/toolchain/check/testdata/let/no_prelude/import.carbon b/toolchain/check/testdata/let/no_prelude/import.carbon index 94cfa3aada80..20863d0d3499 100644 --- a/toolchain/check/testdata/let/no_prelude/import.carbon +++ b/toolchain/check/testdata/let/no_prelude/import.carbon @@ -121,25 +121,26 @@ let b:! () = Other.a; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .a = %import_ref +// CHECK:STDOUT: import Other//default +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref: %.1 = import_ref Other//default, inst+4, loaded [symbolic = constants.%a] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//default -// CHECK:STDOUT: } // CHECK:STDOUT: %.loc4_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_10.2: type = converted %.loc4_10.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Other.ref: = name_ref Other, file.%Other [template = file.%Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %a.ref: %.1 = name_ref a, imports.%import_ref [symbolic = constants.%a] // CHECK:STDOUT: %b: %.1 = bind_symbolic_name b 0, %a.ref [symbolic = constants.%b] // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/let/no_prelude/import_access.carbon b/toolchain/check/testdata/let/no_prelude/import_access.carbon index 0888e4b825e1..8e20b64e2488 100644 --- a/toolchain/check/testdata/let/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/let/no_prelude/import_access.carbon @@ -131,22 +131,25 @@ let v2: () = Test.v; // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { +// CHECK:STDOUT: import Test//def +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Test = %Test +// CHECK:STDOUT: .Test = imports.%Test // CHECK:STDOUT: .v2 = @__global_init.%v2 // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { -// CHECK:STDOUT: import Test//def -// CHECK:STDOUT: } // CHECK:STDOUT: %.loc9_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc9_10.2: type = converted %.loc9_10.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Test.ref: = name_ref Test, file.%Test [template = file.%Test] +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %v.ref: = name_ref v, [template = ] // CHECK:STDOUT: %v2: %.1 = bind_name v2, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/let/shadowed_decl.carbon b/toolchain/check/testdata/let/shadowed_decl.carbon index b0ba05199f9b..82d3db9a3105 100644 --- a/toolchain/check/testdata/let/shadowed_decl.carbon +++ b/toolchain/check/testdata/let/shadowed_decl.carbon @@ -26,18 +26,8 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +36,15 @@ fn F(a: i32) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %int.make_type_32.loc11_9 [template = i32] diff --git a/toolchain/check/testdata/namespace/add_to_import.carbon b/toolchain/check/testdata/namespace/add_to_import.carbon index 4f4acc09d5fa..c38835ce633f 100644 --- a/toolchain/check/testdata/namespace/add_to_import.carbon +++ b/toolchain/check/testdata/namespace/add_to_import.carbon @@ -24,13 +24,8 @@ var a: i32 = NS.A(); // CHECK:STDOUT: --- implicit.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -39,6 +34,14 @@ var a: i32 = NS.A(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -54,24 +57,12 @@ var a: i32 = NS.A(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: %import_ref.1: = import_ref Implicit//default, inst+3, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { +// CHECK:STDOUT: .A = file.%A.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %import_ref: = import_ref Implicit//default, inst+3, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -80,6 +71,18 @@ var a: i32 = NS.A(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_14.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] @@ -103,7 +106,7 @@ var a: i32 = NS.A(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %NS.ref: = name_ref NS, file.%NS [template = file.%NS] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] // CHECK:STDOUT: %A.ref: %A.type = name_ref A, file.%A.decl [template = constants.%A] // CHECK:STDOUT: %A.call: init i32 = call %A.ref() // CHECK:STDOUT: assign file.%a.var, %A.call diff --git a/toolchain/check/testdata/namespace/alias.carbon b/toolchain/check/testdata/namespace/alias.carbon index b20530862042..11290f4857d7 100644 --- a/toolchain/check/testdata/namespace/alias.carbon +++ b/toolchain/check/testdata/namespace/alias.carbon @@ -36,22 +36,8 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .ns = %ns -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: .C = %C -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -60,6 +46,19 @@ fn D() -> i32 { return C(); } // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .ns = %ns +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: .C = %C +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon index fb6c66b2ab41..7befc26d0ed9 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_after_merge.carbon @@ -53,13 +53,8 @@ fn NS(); // CHECK:STDOUT: --- namespace.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -68,6 +63,14 @@ fn NS(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -81,16 +84,10 @@ fn NS(); // CHECK:STDOUT: %.3: %.type.2 = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: = import_ref Example//namespace, inst+3, loaded // CHECK:STDOUT: %NS: = namespace %import_ref, [template] {} -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -99,6 +96,15 @@ fn NS(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc8: = namespace [template] {} // CHECK:STDOUT: %.decl.loc20: %.type.1 = fn_decl @.1 [template = constants.%.2] {} // CHECK:STDOUT: %.loc24: = namespace [template] {} diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon index 40f703d53f32..39e10134e6bb 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_first.carbon @@ -35,13 +35,8 @@ fn NS.Foo(); // CHECK:STDOUT: --- namespace.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +45,14 @@ fn NS.Foo(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -63,18 +66,12 @@ fn NS.Foo(); // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: = import_ref Example//namespace, inst+3, loaded // CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: .Foo = file.%Foo.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -83,6 +80,15 @@ fn NS.Foo(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon index 2edd0dcb7012..86f995ae9486 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_imported_namespace_second.carbon @@ -51,13 +51,8 @@ fn NS.Foo(); // CHECK:STDOUT: %NS: %NS.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -66,6 +61,14 @@ fn NS.Foo(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS.decl: %NS.type = fn_decl @NS [template = constants.%NS] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -83,16 +86,7 @@ fn NS.Foo(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %NS.type = import_ref Example//fn, inst+3, loaded [template = constants.%NS] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NS = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -101,6 +95,15 @@ fn NS.Foo(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .NS = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc16: = namespace [template] {} // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon index 02df18f27b27..7c8d1dc7eb16 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_first.carbon @@ -50,13 +50,8 @@ fn NS.Bar() {} // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -65,6 +60,14 @@ fn NS.Bar() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } @@ -84,13 +87,8 @@ fn NS.Bar() {} // CHECK:STDOUT: %NS: %NS.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -99,6 +97,14 @@ fn NS.Bar() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS.decl: %NS.type = fn_decl @NS [template = constants.%NS] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -116,23 +122,14 @@ fn NS.Bar() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Example//namespace, inst+4, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Example//fn, inst+3, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: %import_ref.1: = import_ref Example//namespace, inst+3, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { +// CHECK:STDOUT: .Foo = %import_ref.2 +// CHECK:STDOUT: .Bar = file.%Bar.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Example//namespace, inst+3, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .Foo = imports.%import_ref.1 -// CHECK:STDOUT: .Bar = %Bar.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2 = import_ref Example//namespace, inst+4, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Example//fn, inst+3, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -141,6 +138,15 @@ fn NS.Bar() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon index ccf0cb7daab4..445f1aeff902 100644 --- a/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon +++ b/toolchain/check/testdata/namespace/fail_conflict_in_imports_namespace_second.carbon @@ -50,13 +50,8 @@ fn NS.Bar() {} // CHECK:STDOUT: %NS: %NS.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -65,6 +60,14 @@ fn NS.Bar() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS.decl: %NS.type = fn_decl @NS [template = constants.%NS] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -81,13 +84,8 @@ fn NS.Bar() {} // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -96,6 +94,14 @@ fn NS.Bar() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .Foo = %Foo.decl // CHECK:STDOUT: } @@ -117,22 +123,13 @@ fn NS.Bar() {} // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Example//fn, inst+3, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Example//namespace, inst+4, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: %import_ref.2: = import_ref Example//namespace, inst+3, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .Foo = %import_ref.3 +// CHECK:STDOUT: .Bar = file.%Bar.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Example//namespace, inst+3, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .Foo = imports.%import_ref.2 -// CHECK:STDOUT: .Bar = %Bar.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.3 = import_ref Example//namespace, inst+4, unloaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -141,6 +138,15 @@ fn NS.Bar() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Bar.decl: %Bar.type = fn_decl @Bar [template = constants.%Bar] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon index 154833ee7ac3..d44b8fe71284 100644 --- a/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon +++ b/toolchain/check/testdata/namespace/fail_decl_in_alias.carbon @@ -33,17 +33,8 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .ns = %ns -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -52,6 +43,16 @@ fn ns.A() -> i32 { return 0; } // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .ns = %ns +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS: = namespace [template] {} // CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] // CHECK:STDOUT: %ns: = bind_alias ns, %NS [template = %NS] diff --git a/toolchain/check/testdata/namespace/fail_duplicate.carbon b/toolchain/check/testdata/namespace/fail_duplicate.carbon index c4263baeb1fc..471c187732e5 100644 --- a/toolchain/check/testdata/namespace/fail_duplicate.carbon +++ b/toolchain/check/testdata/namespace/fail_duplicate.carbon @@ -30,13 +30,8 @@ fn Foo.Baz() { // CHECK:STDOUT: %Baz: %Baz.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +40,14 @@ fn Foo.Baz() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo: = namespace [template] { // CHECK:STDOUT: .Baz = %Baz.decl.loc13 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/fail_modifiers.carbon b/toolchain/check/testdata/namespace/fail_modifiers.carbon index ad0da96471aa..d670bc7176b4 100644 --- a/toolchain/check/testdata/namespace/fail_modifiers.carbon +++ b/toolchain/check/testdata/namespace/fail_modifiers.carbon @@ -56,15 +56,8 @@ extern namespace C; // CHECK:STDOUT: --- fail_modifiers.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A -// CHECK:STDOUT: .B = %B -// CHECK:STDOUT: .C = %C -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -73,6 +66,16 @@ extern namespace C; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A +// CHECK:STDOUT: .B = %B +// CHECK:STDOUT: .C = %C +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A: = namespace [template] {} // CHECK:STDOUT: %B: = namespace [template] {} // CHECK:STDOUT: %C: = namespace [template] {} diff --git a/toolchain/check/testdata/namespace/fail_params.carbon b/toolchain/check/testdata/namespace/fail_params.carbon index 261aee4c38f0..2dd7db707170 100644 --- a/toolchain/check/testdata/namespace/fail_params.carbon +++ b/toolchain/check/testdata/namespace/fail_params.carbon @@ -52,19 +52,8 @@ fn D(T:! type).F() {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A -// CHECK:STDOUT: .B = %B -// CHECK:STDOUT: .C = %C -// CHECK:STDOUT: .D = %D -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -73,6 +62,18 @@ fn D(T:! type).F() {} // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A +// CHECK:STDOUT: .B = %B +// CHECK:STDOUT: .C = %C +// CHECK:STDOUT: .D = %D +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon index a2b7ba686202..31e8594778d3 100644 --- a/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon +++ b/toolchain/check/testdata/namespace/fail_unresolved_scope.carbon @@ -22,12 +22,8 @@ fn Foo.Baz() { // CHECK:STDOUT: %.2: %.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -36,6 +32,13 @@ fn Foo.Baz() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.2] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/function.carbon b/toolchain/check/testdata/namespace/function.carbon index 15371066bd0b..52f7f705e01e 100644 --- a/toolchain/check/testdata/namespace/function.carbon +++ b/toolchain/check/testdata/namespace/function.carbon @@ -33,15 +33,8 @@ fn Bar() { // CHECK:STDOUT: %Bar: %Bar.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo -// CHECK:STDOUT: .Baz = %Baz.decl.loc14 -// CHECK:STDOUT: .Bar = %Bar.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +43,16 @@ fn Bar() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo +// CHECK:STDOUT: .Baz = %Baz.decl.loc14 +// CHECK:STDOUT: .Bar = %Bar.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo: = namespace [template] { // CHECK:STDOUT: .Baz = %Baz.decl.loc17 // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/imported.carbon b/toolchain/check/testdata/namespace/imported.carbon index 2cadd07a66bb..60b039729ea1 100644 --- a/toolchain/check/testdata/namespace/imported.carbon +++ b/toolchain/check/testdata/namespace/imported.carbon @@ -38,13 +38,8 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -53,6 +48,14 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .ChildNS = %ChildNS // CHECK:STDOUT: .A = %A.decl @@ -79,32 +82,18 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref Implicit//default, inst+5, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B.type = import_ref Implicit//default, inst+9, loaded [template = constants.%B] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .package_a = %package_a -// CHECK:STDOUT: .package_b = %package_b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %import_ref.1: = import_ref Implicit//default, inst+3, loaded // CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { -// CHECK:STDOUT: .A = imports.%import_ref.1 +// CHECK:STDOUT: .A = %import_ref.2 // CHECK:STDOUT: .ChildNS = %ChildNS // CHECK:STDOUT: } -// CHECK:STDOUT: %import_ref.2: = import_ref Implicit//default, inst+4, loaded -// CHECK:STDOUT: %ChildNS: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .B = imports.%import_ref.2 +// CHECK:STDOUT: %import_ref.2: %A.type = import_ref Implicit//default, inst+5, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3: = import_ref Implicit//default, inst+4, loaded +// CHECK:STDOUT: %ChildNS: = namespace %import_ref.3, [template] { +// CHECK:STDOUT: .B = %import_ref.4 // CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.4: %B.type = import_ref Implicit//default, inst+9, loaded [template = constants.%B] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -113,6 +102,20 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .package_a = %package_a +// CHECK:STDOUT: .package_b = %package_b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -137,24 +140,24 @@ var package_b: () = package.NS.ChildNS.B(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %NS.ref.loc4: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %A.ref.loc4: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] +// CHECK:STDOUT: %NS.ref.loc4: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %A.ref.loc4: %A.type = name_ref A, imports.%import_ref.2 [template = constants.%A] // CHECK:STDOUT: %A.call.loc4: init %.1 = call %A.ref.loc4() // CHECK:STDOUT: assign file.%a.var, %A.call.loc4 -// CHECK:STDOUT: %NS.ref.loc5: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %ChildNS.ref.loc5: = name_ref ChildNS, file.%ChildNS [template = file.%ChildNS] -// CHECK:STDOUT: %B.ref.loc5: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] +// CHECK:STDOUT: %NS.ref.loc5: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %ChildNS.ref.loc5: = name_ref ChildNS, imports.%ChildNS [template = imports.%ChildNS] +// CHECK:STDOUT: %B.ref.loc5: %B.type = name_ref B, imports.%import_ref.4 [template = constants.%B] // CHECK:STDOUT: %B.call.loc5: init %.1 = call %B.ref.loc5() // CHECK:STDOUT: assign file.%b.var, %B.call.loc5 // CHECK:STDOUT: %package.ref.loc7: = name_ref package, package [template = package] -// CHECK:STDOUT: %NS.ref.loc7: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %A.ref.loc7: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] +// CHECK:STDOUT: %NS.ref.loc7: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %A.ref.loc7: %A.type = name_ref A, imports.%import_ref.2 [template = constants.%A] // CHECK:STDOUT: %A.call.loc7: init %.1 = call %A.ref.loc7() // CHECK:STDOUT: assign file.%package_a.var, %A.call.loc7 // CHECK:STDOUT: %package.ref.loc8: = name_ref package, package [template = package] -// CHECK:STDOUT: %NS.ref.loc8: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %ChildNS.ref.loc8: = name_ref ChildNS, file.%ChildNS [template = file.%ChildNS] -// CHECK:STDOUT: %B.ref.loc8: %B.type = name_ref B, imports.%import_ref.2 [template = constants.%B] +// CHECK:STDOUT: %NS.ref.loc8: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %ChildNS.ref.loc8: = name_ref ChildNS, imports.%ChildNS [template = imports.%ChildNS] +// CHECK:STDOUT: %B.ref.loc8: %B.type = name_ref B, imports.%import_ref.4 [template = constants.%B] // CHECK:STDOUT: %B.call.loc8: init %.1 = call %B.ref.loc8() // CHECK:STDOUT: assign file.%package_b.var, %B.call.loc8 // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/namespace/imported_indirect.carbon b/toolchain/check/testdata/namespace/imported_indirect.carbon index 55df4c127274..b6a6f7b00fac 100644 --- a/toolchain/check/testdata/namespace/imported_indirect.carbon +++ b/toolchain/check/testdata/namespace/imported_indirect.carbon @@ -44,13 +44,8 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: --- a.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -59,23 +54,25 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- b.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: = import_ref Same//a, inst+3, loaded // CHECK:STDOUT: %A: = namespace %import_ref, [template] { -// CHECK:STDOUT: .B = %B +// CHECK:STDOUT: .B = file.%B // CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -84,27 +81,30 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%A +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %B: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- c.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: = import_ref Same//b, inst+4, loaded // CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .B = %B // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.2: = import_ref Same//b, inst+6, loaded // CHECK:STDOUT: %B: = namespace %import_ref.2, [template] { -// CHECK:STDOUT: .C = %C +// CHECK:STDOUT: .C = file.%C // CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -113,6 +113,15 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%A +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %C: = namespace [template] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -124,13 +133,7 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: %D: %D.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: = import_ref Same//c, inst+4, loaded // CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .B = %B @@ -141,9 +144,9 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.3: = import_ref Same//c, inst+8, loaded // CHECK:STDOUT: %C: = namespace %import_ref.3, [template] { -// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .D = file.%D.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -152,6 +155,15 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%A +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %D.decl: %D.type = fn_decl @D [template = constants.%D] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -169,17 +181,6 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %D.type = import_ref Same//d, inst+10, loaded [template = constants.%D] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = %A -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .e = %e -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %import_ref.1: = import_ref Same//d, inst+4, loaded // CHECK:STDOUT: %A: = namespace %import_ref.1, [template] { // CHECK:STDOUT: .B = %B @@ -190,9 +191,10 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.3: = import_ref Same//d, inst+8, loaded // CHECK:STDOUT: %C: = namespace %import_ref.3, [template] { -// CHECK:STDOUT: .D = imports.%import_ref +// CHECK:STDOUT: .D = %import_ref.4 // CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.4: %D.type = import_ref Same//d, inst+10, loaded [template = constants.%D] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -201,6 +203,16 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%A +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .e = %e +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc5_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc5_9.2: type = converted %.loc5_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %e.var: ref %.1 = var e @@ -211,10 +223,10 @@ var e: () = A.B.C.D(); // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %A.ref: = name_ref A, file.%A [template = file.%A] -// CHECK:STDOUT: %B.ref: = name_ref B, file.%B [template = file.%B] -// CHECK:STDOUT: %C.ref: = name_ref C, file.%C [template = file.%C] -// CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref [template = constants.%D] +// CHECK:STDOUT: %A.ref: = name_ref A, imports.%A [template = imports.%A] +// CHECK:STDOUT: %B.ref: = name_ref B, imports.%B [template = imports.%B] +// CHECK:STDOUT: %C.ref: = name_ref C, imports.%C [template = imports.%C] +// CHECK:STDOUT: %D.ref: %D.type = name_ref D, imports.%import_ref.4 [template = constants.%D] // CHECK:STDOUT: %D.call: init %.1 = call %D.ref() // CHECK:STDOUT: assign file.%e.var, %D.call // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/namespace/merging.carbon b/toolchain/check/testdata/namespace/merging.carbon index d2285a4499d3..1a98a2f05aca 100644 --- a/toolchain/check/testdata/namespace/merging.carbon +++ b/toolchain/check/testdata/namespace/merging.carbon @@ -54,13 +54,8 @@ fn Run() { // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -69,6 +64,14 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: } @@ -90,13 +93,8 @@ fn Run() { // CHECK:STDOUT: %B2: %B2.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -105,6 +103,14 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .B1 = %B1.decl // CHECK:STDOUT: .B2 = %B2.decl @@ -141,27 +147,17 @@ fn Run() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %A.type = import_ref Example//a, inst+4, loaded [template = constants.%A] -// CHECK:STDOUT: %import_ref.2: %B1.type = import_ref Example//b, inst+4, loaded [template = constants.%B1] -// CHECK:STDOUT: %import_ref.3: %B2.type = import_ref Example//b, inst+10, loaded [template = constants.%B2] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: %import_ref.1: = import_ref Example//a, inst+3, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { +// CHECK:STDOUT: .A = %import_ref.2 +// CHECK:STDOUT: .B1 = %import_ref.3 +// CHECK:STDOUT: .B2 = %import_ref.4 +// CHECK:STDOUT: .C = file.%C.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Example//a, inst+3, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .A = imports.%import_ref.1 -// CHECK:STDOUT: .B1 = imports.%import_ref.2 -// CHECK:STDOUT: .B2 = imports.%import_ref.3 -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2: %A.type = import_ref Example//a, inst+4, loaded [template = constants.%A] +// CHECK:STDOUT: %import_ref.3: %B1.type = import_ref Example//b, inst+4, loaded [template = constants.%B1] +// CHECK:STDOUT: %import_ref.4: %B2.type = import_ref Example//b, inst+10, loaded [template = constants.%B2] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -170,6 +166,16 @@ fn Run() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .NS = imports.%NS +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc7: = namespace [template] {} // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [template = constants.%C] {} // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} @@ -182,16 +188,16 @@ fn Run() { // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %NS.ref.loc12: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.1 [template = constants.%A] +// CHECK:STDOUT: %NS.ref.loc12: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %A.ref: %A.type = name_ref A, imports.%import_ref.2 [template = constants.%A] // CHECK:STDOUT: %A.call: init %.1 = call %A.ref() -// CHECK:STDOUT: %NS.ref.loc13: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %B1.ref: %B1.type = name_ref B1, imports.%import_ref.2 [template = constants.%B1] +// CHECK:STDOUT: %NS.ref.loc13: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %B1.ref: %B1.type = name_ref B1, imports.%import_ref.3 [template = constants.%B1] // CHECK:STDOUT: %B1.call: init %.1 = call %B1.ref() -// CHECK:STDOUT: %NS.ref.loc14: = name_ref NS, file.%NS [template = file.%NS] -// CHECK:STDOUT: %B2.ref: %B2.type = name_ref B2, imports.%import_ref.3 [template = constants.%B2] +// CHECK:STDOUT: %NS.ref.loc14: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %B2.ref: %B2.type = name_ref B2, imports.%import_ref.4 [template = constants.%B2] // CHECK:STDOUT: %B2.call: init %.1 = call %B2.ref() -// CHECK:STDOUT: %NS.ref.loc15: = name_ref NS, file.%NS [template = file.%NS] +// CHECK:STDOUT: %NS.ref.loc15: = name_ref NS, imports.%NS [template = imports.%NS] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, file.%C.decl [template = constants.%C] // CHECK:STDOUT: %C.call: init %.1 = call %C.ref() // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/namespace/merging_with_indirections.carbon b/toolchain/check/testdata/namespace/merging_with_indirections.carbon new file mode 100644 index 000000000000..3bb3c9f45b5a --- /dev/null +++ b/toolchain/check/testdata/namespace/merging_with_indirections.carbon @@ -0,0 +1,225 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/namespace/merging_with_indirections.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/namespace/merging_with_indirections.carbon + +// --- a.carbon + +package Other library "a"; + +namespace NS1; +class NS1.A {} + +// --- b.carbon + +package Other library "b"; +import library "a"; + +namespace NS1; +class NS1.B {} + +fn F() -> NS1.A { return {}; } + +// --- main.carbon + +import Other library "b"; +import Other library "a"; + +fn Run() { + // Note `Other.NS.A` is part of the return type here. + Other.F(); + + // Use `Other.NS.A` directly. + var a: Other.NS1.A; + + // Ensure the type is equivalent. + a = Other.F(); +} + +// CHECK:STDOUT: --- a.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %A: type = class_type @A [template] +// CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS1 = %NS1 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %NS1: = namespace [template] { +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @A { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%A +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- b.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %B: type = class_type @B [template] +// CHECK:STDOUT: %.1: type = struct_type {} [template] +// CHECK:STDOUT: %A: type = class_type @A [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %.2: type = tuple_type () [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %.3: type = ptr_type %.1 [template] +// CHECK:STDOUT: %struct: %A = struct_value () [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %import_ref.1: = import_ref Other//a, inst+3, loaded +// CHECK:STDOUT: %NS1: = namespace %import_ref.1, [template] { +// CHECK:STDOUT: .A = %import_ref.2 +// CHECK:STDOUT: .B = file.%B.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: type = import_ref Other//a, inst+4, loaded [template = constants.%A] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3 = import_ref Other//a, inst+5, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .NS1 = imports.%NS1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %.loc5: = namespace [template] {} +// CHECK:STDOUT: %B.decl: type = class_decl @B [template = constants.%B] {} +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { +// CHECK:STDOUT: %NS1.ref: = name_ref NS1, imports.%NS1 [template = imports.%NS1] +// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.2 [template = constants.%A] +// CHECK:STDOUT: @F.%return: ref %A = var +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @B { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%B +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @A { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() -> %return: %A { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc8_27.1: %.1 = struct_literal () +// CHECK:STDOUT: %.loc8_27.2: init %A = class_init (), %return [template = constants.%struct] +// CHECK:STDOUT: %.loc8_28: init %A = converted %.loc8_27.1, %.loc8_27.2 [template = constants.%struct] +// CHECK:STDOUT: return %.loc8_28 to %return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- main.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %Run.type: type = fn_type @Run [template] +// CHECK:STDOUT: %.1: type = tuple_type () [template] +// CHECK:STDOUT: %Run: %Run.type = struct_value () [template] +// CHECK:STDOUT: %A: type = class_type @A [template] +// CHECK:STDOUT: %.2: type = struct_type {} [template] +// CHECK:STDOUT: %F.type: type = fn_type @F [template] +// CHECK:STDOUT: %F: %F.type = struct_value () [template] +// CHECK:STDOUT: %.3: type = ptr_type %.2 [template] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .F = %import_ref.1 +// CHECK:STDOUT: .NS1 = %NS1 +// CHECK:STDOUT: import Other//b +// CHECK:STDOUT: import Other//a +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//b, inst+17, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//b, inst+14, unloaded +// CHECK:STDOUT: %import_ref.3: = import_ref Other//b, inst+4, loaded +// CHECK:STDOUT: %NS1: = namespace %import_ref.3, [template] { +// CHECK:STDOUT: .A = %import_ref.4 +// CHECK:STDOUT: import Other//b +// CHECK:STDOUT: import Other//a +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.4: type = import_ref Other//a, inst+4, loaded [template = constants.%A] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: .Run = %Run.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @A { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @Run() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Other.ref.loc7: = name_ref Other, imports.%Other [template = imports.%Other] +// CHECK:STDOUT: %F.ref.loc7: %F.type = name_ref F, imports.%import_ref.1 [template = constants.%F] +// CHECK:STDOUT: %.loc7_10.1: ref %A = temporary_storage +// CHECK:STDOUT: %F.call.loc7: init %A = call %F.ref.loc7() to %.loc7_10.1 +// CHECK:STDOUT: %.loc7_10.2: ref %A = temporary %.loc7_10.1, %F.call.loc7 +// CHECK:STDOUT: %Other.ref.loc10: = name_ref Other, imports.%Other [template = imports.%Other] +// CHECK:STDOUT: %NS1.ref: = name_ref NS1, imports.%NS1 [template = imports.%NS1] +// CHECK:STDOUT: %A.ref: type = name_ref A, imports.%import_ref.4 [template = constants.%A] +// CHECK:STDOUT: %a.var: ref %A = var a +// CHECK:STDOUT: %a: ref %A = bind_name a, %a.var +// CHECK:STDOUT: %a.ref: ref %A = name_ref a, %a +// CHECK:STDOUT: %Other.ref.loc13: = name_ref Other, imports.%Other [template = imports.%Other] +// CHECK:STDOUT: %F.ref.loc13: %F.type = name_ref F, imports.%import_ref.1 [template = constants.%F] +// CHECK:STDOUT: %.loc13: ref %A = splice_block %a.ref {} +// CHECK:STDOUT: %F.call.loc13: init %A = call %F.ref.loc13() to %.loc13 +// CHECK:STDOUT: assign %a.ref, %F.call.loc13 +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F() -> %A; +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/namespace/nested.carbon b/toolchain/check/testdata/namespace/nested.carbon index 4ca6a8ce7b2e..4379414804bf 100644 --- a/toolchain/check/testdata/namespace/nested.carbon +++ b/toolchain/check/testdata/namespace/nested.carbon @@ -28,13 +28,8 @@ fn Foo.Bar.Baz() { // CHECK:STDOUT: %Baz: %Baz.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +38,14 @@ fn Foo.Bar.Baz() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo: = namespace [template] { // CHECK:STDOUT: .Bar = %Bar // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/namespace/shadow.carbon b/toolchain/check/testdata/namespace/shadow.carbon index c73570a268ba..c740ca0ffa91 100644 --- a/toolchain/check/testdata/namespace/shadow.carbon +++ b/toolchain/check/testdata/namespace/shadow.carbon @@ -44,18 +44,8 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl.loc11 -// CHECK:STDOUT: .N = %N -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -64,6 +54,16 @@ fn N.M.B() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl.loc11 +// CHECK:STDOUT: .N = %N +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl.loc11: %A.type.1 = fn_decl @A.1 [template = constants.%A.1] {} // CHECK:STDOUT: %N: = namespace [template] { // CHECK:STDOUT: .A = %A.decl.loc14 diff --git a/toolchain/check/testdata/namespace/unqualified_lookup.carbon b/toolchain/check/testdata/namespace/unqualified_lookup.carbon index e1d3242c4754..5abdc49abbf3 100644 --- a/toolchain/check/testdata/namespace/unqualified_lookup.carbon +++ b/toolchain/check/testdata/namespace/unqualified_lookup.carbon @@ -48,15 +48,8 @@ fn OuterN.InnerN.CallABC() { // CHECK:STDOUT: %CallABC: %CallABC.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .OuterN = %OuterN -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: .CallA = %CallA.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -65,6 +58,16 @@ fn OuterN.InnerN.CallABC() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .OuterN = %OuterN +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: .CallA = %CallA.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %OuterN: = namespace [template] { // CHECK:STDOUT: .InnerN = %InnerN // CHECK:STDOUT: .B = %B.decl diff --git a/toolchain/check/testdata/operators/builtin/and.carbon b/toolchain/check/testdata/operators/builtin/and.carbon index 1c13f40c43e7..4e02373e3c85 100644 --- a/toolchain/check/testdata/operators/builtin/and.carbon +++ b/toolchain/check/testdata/operators/builtin/and.carbon @@ -48,28 +48,8 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .And = %And.decl -// CHECK:STDOUT: .Constant = %Constant.decl -// CHECK:STDOUT: .PartialConstant = %PartialConstant.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -78,6 +58,19 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .And = %And.decl +// CHECK:STDOUT: .Constant = %Constant.decl +// CHECK:STDOUT: .PartialConstant = %PartialConstant.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] diff --git a/toolchain/check/testdata/operators/builtin/assignment.carbon b/toolchain/check/testdata/operators/builtin/assignment.carbon index 382b45e65632..86d919aa02d2 100644 --- a/toolchain/check/testdata/operators/builtin/assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/assignment.carbon @@ -55,21 +55,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -78,6 +65,15 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon index 26730be597e6..e7afcb28d6c9 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_not_in_function.carbon @@ -59,6 +59,18 @@ var or_: F(true or true); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace .inst+1, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 +// CHECK:STDOUT: .Float = %import_ref.3 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.3: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] diff --git a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon index ca249b8cc394..9c24ebe007a1 100644 --- a/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_and_or_partial_constant.carbon @@ -56,18 +56,8 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .PartialConstant = %PartialConstant.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -76,6 +66,15 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .PartialConstant = %PartialConstant.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %PartialConstant.decl: %PartialConstant.type = fn_decl @PartialConstant [template = constants.%PartialConstant] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc4_23.1: type = value_of_initializer %bool.make_type [template = bool] @@ -160,18 +159,8 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .KnownValueButNonConstantCondition = %KnownValueButNonConstantCondition.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -180,6 +169,15 @@ fn KnownValueButNonConstantCondition(x: bool) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .KnownValueButNonConstantCondition = %KnownValueButNonConstantCondition.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %KnownValueButNonConstantCondition.decl: %KnownValueButNonConstantCondition.type = fn_decl @KnownValueButNonConstantCondition [template = constants.%KnownValueButNonConstantCondition] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc4_41.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon index ec16fc6e1878..e6889c001731 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_error.carbon @@ -29,13 +29,8 @@ fn Main() { // CHECK:STDOUT: %.2: i32 = int_literal 42 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +39,14 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon index 6b65a148ed5f..19c1b3ce3254 100644 --- a/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_assignment_to_non_assignable.carbon @@ -85,21 +85,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -108,6 +95,16 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon index ae10be8d8793..508edf091ff7 100644 --- a/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_redundant_compound_access.carbon @@ -38,18 +38,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -58,6 +48,16 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon index 18338fd2ebf6..6342c9e9ea2c 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch.carbon @@ -27,16 +27,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +37,15 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon index bd2688e25a1b..6cd7f64d87a9 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_assignment.carbon @@ -29,16 +29,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -47,6 +39,15 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon index 0e4ba4f8d39a..b4c5d2e3ab9a 100644 --- a/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_type_mismatch_once.carbon @@ -40,22 +40,9 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.7: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.4] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Add = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -64,6 +51,20 @@ fn Main() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded +// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon index cb5e84476ff3..df5159403f38 100644 --- a/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon +++ b/toolchain/check/testdata/operators/builtin/fail_unimplemented_op.carbon @@ -34,6 +34,17 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Add = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.4] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded @@ -44,19 +55,10 @@ fn Main() -> i32 { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Main = %Main.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/operators/builtin/or.carbon b/toolchain/check/testdata/operators/builtin/or.carbon index a5f9ef80ca64..07a2cf0ce21e 100644 --- a/toolchain/check/testdata/operators/builtin/or.carbon +++ b/toolchain/check/testdata/operators/builtin/or.carbon @@ -48,28 +48,8 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .Or = %Or.decl -// CHECK:STDOUT: .Constant = %Constant.decl -// CHECK:STDOUT: .PartialConstant = %PartialConstant.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -78,6 +58,19 @@ fn PartialConstant(x: bool) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .Or = %Or.decl +// CHECK:STDOUT: .Constant = %Constant.decl +// CHECK:STDOUT: .PartialConstant = %PartialConstant.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] diff --git a/toolchain/check/testdata/operators/builtin/unary_op.carbon b/toolchain/check/testdata/operators/builtin/unary_op.carbon index 7fd94d5c9edb..31c0e56dd3d4 100644 --- a/toolchain/check/testdata/operators/builtin/unary_op.carbon +++ b/toolchain/check/testdata/operators/builtin/unary_op.carbon @@ -36,24 +36,8 @@ fn Constant() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Not = %Not.decl -// CHECK:STDOUT: .not_true = @__global_init.%not_true -// CHECK:STDOUT: .not_false = @__global_init.%not_false -// CHECK:STDOUT: .Constant = %Constant.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -62,6 +46,18 @@ fn Constant() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Not = %Not.decl +// CHECK:STDOUT: .not_true = @__global_init.%not_true +// CHECK:STDOUT: .not_false = @__global_init.%not_false +// CHECK:STDOUT: .Constant = %Constant.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Not.decl: %Not.type = fn_decl @Not [template = constants.%Not] { // CHECK:STDOUT: %bool.make_type.loc11_11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11_11 [template = bool] diff --git a/toolchain/check/testdata/operators/overloaded/add.carbon b/toolchain/check/testdata/operators/overloaded/add.carbon index c14f573b8113..ab84fb10ed2e 100644 --- a/toolchain/check/testdata/operators/overloaded/add.carbon +++ b/toolchain/check/testdata/operators/overloaded/add.carbon @@ -58,37 +58,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Add, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @AddAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+19, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: .TestAssign = %TestAssign.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Add = %import_ref.1 +// CHECK:STDOUT: .AddAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,15 +77,35 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+19, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: .TestAssign = %TestAssign.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/operators/overloaded/bit_and.carbon b/toolchain/check/testdata/operators/overloaded/bit_and.carbon index 3add9b575911..9412cc774225 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_and.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_and.carbon @@ -58,37 +58,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @BitAnd, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @BitAndAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+22, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+24, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+45, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+40, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+47, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+49, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+70, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+64, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/bitwise, inst+22, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+40, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/bitwise, inst+47, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/bitwise, inst+64, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: .TestAssign = %TestAssign.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .BitAnd = %import_ref.1 +// CHECK:STDOUT: .BitAndAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,15 +77,35 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+22, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+24, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+45, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+40, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+47, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+49, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+70, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+64, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+40, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+64, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: .TestAssign = %TestAssign.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitAnd.ref: type = name_ref BitAnd, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitAndAssign.ref: type = name_ref BitAndAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon index 54d85688bd38..df7a9f91a4b5 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_complement.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_complement.carbon @@ -42,26 +42,12 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @BitComplement, %Op.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/bitwise, inst+20, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+14, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+14, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .BitComplement = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -70,10 +56,24 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/bitwise, inst+20, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+14, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/bitwise, inst+14, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitComplement.ref: type = name_ref BitComplement, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/operators/overloaded/bit_or.carbon b/toolchain/check/testdata/operators/overloaded/bit_or.carbon index a62b96bed3e0..383fad1100ce 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_or.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_or.carbon @@ -58,37 +58,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @BitOr, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @BitOrAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+72, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+74, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+95, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+90, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+97, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+99, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+120, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+114, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/bitwise, inst+72, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+90, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/bitwise, inst+97, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/bitwise, inst+114, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: .TestAssign = %TestAssign.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .BitOr = %import_ref.1 +// CHECK:STDOUT: .BitOrAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,15 +77,35 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+72, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+74, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+95, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+90, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+97, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+99, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+120, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+114, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+90, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+114, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: .TestAssign = %TestAssign.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitOr.ref: type = name_ref BitOr, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitOrAssign.ref: type = name_ref BitOrAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon index 65177b3b912f..ae06be9bc1c6 100644 --- a/toolchain/check/testdata/operators/overloaded/bit_xor.carbon +++ b/toolchain/check/testdata/operators/overloaded/bit_xor.carbon @@ -58,37 +58,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @BitXor, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @BitXorAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+122, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+124, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+145, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+140, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+147, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+149, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+170, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+164, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/bitwise, inst+122, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+140, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/bitwise, inst+147, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/bitwise, inst+164, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: .TestAssign = %TestAssign.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .BitXor = %import_ref.1 +// CHECK:STDOUT: .BitXorAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,15 +77,35 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+122, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+124, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+145, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+140, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+147, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+149, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+170, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+164, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+140, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+164, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: .TestAssign = %TestAssign.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitXor.ref: type = name_ref BitXor, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %BitXorAssign.ref: type = name_ref BitXorAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/operators/overloaded/dec.carbon b/toolchain/check/testdata/operators/overloaded/dec.carbon index df28dd1735a9..3d92dd6848d8 100644 --- a/toolchain/check/testdata/operators/overloaded/dec.carbon +++ b/toolchain/check/testdata/operators/overloaded/dec.carbon @@ -43,26 +43,12 @@ fn TestOp() { // CHECK:STDOUT: %.7: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type @Dec, %Op.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+142, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+144, unloaded -// CHECK:STDOUT: %import_ref.3: %.8 = import_ref Core//prelude/operators/arithmetic, inst+160, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+154, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+142, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+154, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Dec = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -71,10 +57,24 @@ fn TestOp() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+142, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+144, unloaded +// CHECK:STDOUT: %import_ref.3: %.8 = import_ref Core//prelude/operators/arithmetic, inst+160, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+154, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+154, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Dec.ref: type = name_ref Dec, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} diff --git a/toolchain/check/testdata/operators/overloaded/div.carbon b/toolchain/check/testdata/operators/overloaded/div.carbon index faa7d73fbf42..41c4adddae85 100644 --- a/toolchain/check/testdata/operators/overloaded/div.carbon +++ b/toolchain/check/testdata/operators/overloaded/div.carbon @@ -58,37 +58,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Div, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @DivAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+212, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+214, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+235, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+230, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+237, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+239, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+260, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+254, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/arithmetic, inst+212, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+230, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+237, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+254, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: .TestAssign = %TestAssign.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Div = %import_ref.1 +// CHECK:STDOUT: .DivAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,15 +77,35 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+212, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+214, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+235, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+230, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+237, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+239, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+260, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+254, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+230, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+254, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: .TestAssign = %TestAssign.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Div.ref: type = name_ref Div, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %DivAssign.ref: type = name_ref DivAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/operators/overloaded/eq.carbon b/toolchain/check/testdata/operators/overloaded/eq.carbon index 38e234efbd38..8fca3f1762df 100644 --- a/toolchain/check/testdata/operators/overloaded/eq.carbon +++ b/toolchain/check/testdata/operators/overloaded/eq.carbon @@ -102,39 +102,17 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %TestEqual: %TestEqual.type = struct_value () [template] // CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @Eq, %Equal.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %TestNotEqual.type: type = fn_type @TestNotEqual [template] // CHECK:STDOUT: %TestNotEqual: %TestNotEqual.type = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type @Eq, %NotEqual.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.14 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.9 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+26, loaded [template = constants.%Equal.2] -// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+47, loaded [template = constants.%NotEqual.2] -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.10: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/comparison, inst+26, unloaded -// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/comparison, inst+47, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestEqual = %TestEqual.decl -// CHECK:STDOUT: .TestNotEqual = %TestNotEqual.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Eq = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -143,10 +121,29 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+26, loaded [template = constants.%Equal.2] +// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+47, loaded [template = constants.%NotEqual.2] +// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+26, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+47, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestEqual = %TestEqual.decl +// CHECK:STDOUT: .TestNotEqual = %TestNotEqual.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [template = constants.%TestEqual] { @@ -277,32 +274,13 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %NotEqual.type: type = fn_type @NotEqual [template] // CHECK:STDOUT: %NotEqual: %NotEqual.type = struct_value () [template] // CHECK:STDOUT: %.7: type = assoc_entity_type @Eq, %NotEqual.type [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, imports.%import_ref.11 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, imports.%import_ref.9 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.5: %.7 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.8] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/comparison, inst+26, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/comparison, inst+47, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+26, unloaded -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.10: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/comparison, inst+47, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: .TestEqual = %TestEqual.decl -// CHECK:STDOUT: .TestNotEqual = %TestNotEqual.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Eq = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -311,6 +289,25 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.4] +// CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+5, unloaded +// CHECK:STDOUT: %import_ref.4: %.5 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.5: %.7 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.8] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/comparison, inst+26, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Core//prelude/operators/comparison, inst+47, unloaded +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+26, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+47, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .TestEqual = %TestEqual.decl +// CHECK:STDOUT: .TestNotEqual = %TestNotEqual.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} // CHECK:STDOUT: %TestEqual.decl: %TestEqual.type = fn_decl @TestEqual [template = constants.%TestEqual] { // CHECK:STDOUT: %D.ref.loc6_17: type = name_ref D, %D.decl [template = constants.%D] @@ -395,40 +392,17 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: %TestRhsBad: %TestRhsBad.type = struct_value () [template] // CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @Eq, %Equal.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.11 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.8 [template] // CHECK:STDOUT: %TestLhsBad.type: type = fn_type @TestLhsBad [template] // CHECK:STDOUT: %TestLhsBad: %TestLhsBad.type = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type @Eq, %NotEqual.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.14 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.9 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+26, loaded [template = constants.%Equal.2] -// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+47, loaded [template = constants.%NotEqual.2] -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.9: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.10: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/comparison, inst+26, unloaded -// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.13: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/comparison, inst+47, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: .TestRhsBad = %TestRhsBad.decl -// CHECK:STDOUT: .TestLhsBad = %TestLhsBad.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Eq = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.7 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -437,11 +411,31 @@ fn TestLhsBad(a: D, b: C) -> bool { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+3, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+5, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+31, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %.8 = import_ref Core//prelude/operators/comparison, inst+52, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.5: %Equal.type.2 = import_ref Core//prelude/operators/comparison, inst+26, loaded [template = constants.%Equal.2] +// CHECK:STDOUT: %import_ref.6: %NotEqual.type.2 = import_ref Core//prelude/operators/comparison, inst+47, loaded [template = constants.%NotEqual.2] +// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.8 = import_ref Core//prelude/operators/comparison, inst+26, unloaded +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/comparison, inst+47, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .TestRhsBad = %TestRhsBad.decl +// CHECK:STDOUT: .TestLhsBad = %TestLhsBad.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc7: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Eq.ref: type = name_ref Eq, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestRhsBad.decl: %TestRhsBad.type = fn_decl @TestRhsBad [template = constants.%TestRhsBad] { diff --git a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon index a9b0fd657429..57d2211edf0c 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_assign_non_ref.carbon @@ -67,37 +67,17 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: %TestIncNonRef: %TestIncNonRef.type = struct_value () [template] // CHECK:STDOUT: %.10: type = ptr_type %.1 [template] // CHECK:STDOUT: %.11: type = assoc_entity_type @Inc, %Op.type.2 [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAddAssignNonRef.type: type = fn_type @TestAddAssignNonRef [template] // CHECK:STDOUT: %TestAddAssignNonRef: %TestAddAssignNonRef.type = struct_value () [template] // CHECK:STDOUT: %.13: type = assoc_entity_type @AddAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.14: %.13 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+54, unloaded -// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.12] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+64, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded -// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.14] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestIncNonRef = %TestIncNonRef.decl -// CHECK:STDOUT: .TestAddAssignNonRef = %TestAddAssignNonRef.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Inc = %import_ref.1 +// CHECK:STDOUT: .AddAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -106,15 +86,35 @@ fn TestAddAssignNonRef(a: C, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+54, unloaded +// CHECK:STDOUT: %import_ref.3: %.11 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.12] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+64, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded +// CHECK:STDOUT: %import_ref.7: %.13 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.14] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestIncNonRef = %TestIncNonRef.decl +// CHECK:STDOUT: .TestAddAssignNonRef = %TestAddAssignNonRef.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc15: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc15: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc18: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc18: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc18: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.7] // CHECK:STDOUT: } // CHECK:STDOUT: %TestIncNonRef.decl: %TestIncNonRef.type = fn_decl @TestIncNonRef [template = constants.%TestIncNonRef] { diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon index a49261d5d6c9..c72e746f8b40 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl.carbon @@ -84,6 +84,19 @@ fn TestRef(b: C) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Negate = %import_ref.1 +// CHECK:STDOUT: .Add = %import_ref.6 +// CHECK:STDOUT: .AddAssign = %import_ref.11 +// CHECK:STDOUT: .Inc = %import_ref.16 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+72, loaded [template = constants.%.4] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded // CHECK:STDOUT: %import_ref.3: %.5 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.6] @@ -108,22 +121,13 @@ fn TestRef(b: C) { // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .TestUnary = %TestUnary.decl // CHECK:STDOUT: .TestBinary = %TestBinary.decl // CHECK:STDOUT: .TestRef = %TestRef.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %TestUnary.decl: %TestUnary.type = fn_decl @TestUnary [template = constants.%TestUnary] { // CHECK:STDOUT: %C.ref.loc15_17: type = name_ref C, %C.decl [template = constants.%C] diff --git a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon index 7e5a015d7498..91052af2288d 100644 --- a/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon +++ b/toolchain/check/testdata/operators/overloaded/fail_no_impl_for_arg.carbon @@ -69,39 +69,18 @@ fn TestAssign(b: D) { // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] // CHECK:STDOUT: %.9: type = ptr_type %.1 [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Add, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @AddAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+19, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.5] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .D = %D.decl -// CHECK:STDOUT: .Test = %Test.decl -// CHECK:STDOUT: .TestAssign = %TestAssign.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Add = %import_ref.1 +// CHECK:STDOUT: .AddAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -110,16 +89,37 @@ fn TestAssign(b: D) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+1, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+3, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+25, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+19, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+27, loaded [template = constants.%.5] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+29, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+50, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+44, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+19, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+44, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .D = %D.decl +// CHECK:STDOUT: .Test = %Test.decl +// CHECK:STDOUT: .TestAssign = %TestAssign.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc16: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc16: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc16: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Add.ref: type = name_ref Add, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc19: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc19: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc19: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %AddAssign.ref: type = name_ref AddAssign, imports.%import_ref.5 [template = constants.%.5] // CHECK:STDOUT: } // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] { diff --git a/toolchain/check/testdata/operators/overloaded/inc.carbon b/toolchain/check/testdata/operators/overloaded/inc.carbon index 101b93987054..67ff265a7895 100644 --- a/toolchain/check/testdata/operators/overloaded/inc.carbon +++ b/toolchain/check/testdata/operators/overloaded/inc.carbon @@ -43,26 +43,12 @@ fn TestOp() { // CHECK:STDOUT: %.7: type = ptr_type %.1 [template] // CHECK:STDOUT: %struct: %C = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type @Inc, %Op.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+54, unloaded -// CHECK:STDOUT: %import_ref.3: %.8 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.9] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+64, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Inc = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -71,10 +57,24 @@ fn TestOp() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+52, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+54, unloaded +// CHECK:STDOUT: %import_ref.3: %.8 = import_ref Core//prelude/operators/arithmetic, inst+70, loaded [template = constants.%.9] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+64, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+64, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Inc.ref: type = name_ref Inc, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] {} diff --git a/toolchain/check/testdata/operators/overloaded/left_shift.carbon b/toolchain/check/testdata/operators/overloaded/left_shift.carbon index 86984c030d24..41a3a268d2b2 100644 --- a/toolchain/check/testdata/operators/overloaded/left_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/left_shift.carbon @@ -58,37 +58,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @LeftShift, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @LeftShiftAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+172, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+174, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+195, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+190, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+197, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+199, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+220, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+214, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/bitwise, inst+172, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+190, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/bitwise, inst+197, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/bitwise, inst+214, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: .TestAssign = %TestAssign.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .LeftShift = %import_ref.1 +// CHECK:STDOUT: .LeftShiftAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,15 +77,35 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+172, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+174, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+195, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+190, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+197, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+199, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+220, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+214, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+190, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+214, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: .TestAssign = %TestAssign.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %LeftShift.ref: type = name_ref LeftShift, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %LeftShiftAssign.ref: type = name_ref LeftShiftAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/operators/overloaded/mod.carbon b/toolchain/check/testdata/operators/overloaded/mod.carbon index d50de876d6e5..56d611c839f6 100644 --- a/toolchain/check/testdata/operators/overloaded/mod.carbon +++ b/toolchain/check/testdata/operators/overloaded/mod.carbon @@ -58,37 +58,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Mod, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @ModAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+262, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+264, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+285, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+280, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+287, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+289, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+310, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+304, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/arithmetic, inst+262, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+280, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+287, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+304, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: .TestAssign = %TestAssign.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Mod = %import_ref.1 +// CHECK:STDOUT: .ModAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,15 +77,35 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+262, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+264, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+285, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+280, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+287, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+289, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+310, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+304, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+280, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+304, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: .TestAssign = %TestAssign.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Mod.ref: type = name_ref Mod, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %ModAssign.ref: type = name_ref ModAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/operators/overloaded/mul.carbon b/toolchain/check/testdata/operators/overloaded/mul.carbon index 40845229d5e0..422348232bf5 100644 --- a/toolchain/check/testdata/operators/overloaded/mul.carbon +++ b/toolchain/check/testdata/operators/overloaded/mul.carbon @@ -58,37 +58,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Mul, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @MulAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+162, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+164, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+185, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+180, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+187, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+189, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+210, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+204, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/arithmetic, inst+162, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+180, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+187, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+204, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: .TestAssign = %TestAssign.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Mul = %import_ref.1 +// CHECK:STDOUT: .MulAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,15 +77,35 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+162, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+164, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+185, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+180, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+187, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+189, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+210, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+204, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+180, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+204, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: .TestAssign = %TestAssign.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Mul.ref: type = name_ref Mul, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %MulAssign.ref: type = name_ref MulAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/operators/overloaded/negate.carbon b/toolchain/check/testdata/operators/overloaded/negate.carbon index 3976b811dbaf..3a2e0f8dc5e3 100644 --- a/toolchain/check/testdata/operators/overloaded/negate.carbon +++ b/toolchain/check/testdata/operators/overloaded/negate.carbon @@ -42,26 +42,12 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @Negate, %Op.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.6 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.5 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+72, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded -// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.7] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+85, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+72, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Negate = %import_ref.1 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -70,10 +56,24 @@ fn TestOp(a: C) -> C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+72, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+74, unloaded +// CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/arithmetic, inst+90, loaded [template = constants.%.7] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+85, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5 = import_ref Core//prelude/operators/arithmetic, inst+85, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Negate.ref: type = name_ref Negate, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/operators/overloaded/ordered.carbon b/toolchain/check/testdata/operators/overloaded/ordered.carbon index 378dd6df654a..c48daa37cc73 100644 --- a/toolchain/check/testdata/operators/overloaded/ordered.carbon +++ b/toolchain/check/testdata/operators/overloaded/ordered.carbon @@ -105,22 +105,33 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %TestLess: %TestLess.type = struct_value () [template] // CHECK:STDOUT: %.5: type = ptr_type %.1 [template] // CHECK:STDOUT: %.6: type = assoc_entity_type @Ordered, %Less.type.2 [template] -// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.17 [template] +// CHECK:STDOUT: %.7: %.6 = assoc_entity element0, imports.%import_ref.12 [template] // CHECK:STDOUT: %TestLessEqual.type: type = fn_type @TestLessEqual [template] // CHECK:STDOUT: %TestLessEqual: %TestLessEqual.type = struct_value () [template] // CHECK:STDOUT: %.8: type = assoc_entity_type @Ordered, %LessOrEquivalent.type.2 [template] -// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.20 [template] +// CHECK:STDOUT: %.9: %.8 = assoc_entity element1, imports.%import_ref.13 [template] // CHECK:STDOUT: %TestGreater.type: type = fn_type @TestGreater [template] // CHECK:STDOUT: %TestGreater: %TestGreater.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Ordered, %Greater.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element2, imports.%import_ref.23 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element2, imports.%import_ref.14 [template] // CHECK:STDOUT: %TestGreaterEqual.type: type = fn_type @TestGreaterEqual [template] // CHECK:STDOUT: %TestGreaterEqual: %TestGreaterEqual.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @Ordered, %GreaterOrEquivalent.type.2 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element3, imports.%import_ref.26 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element3, imports.%import_ref.15 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Ordered = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.11 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.2] // CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/comparison, inst+56, unloaded // CHECK:STDOUT: %import_ref.3: %.6 = import_ref Core//prelude/operators/comparison, inst+77, loaded [template = constants.%.7] @@ -132,26 +143,15 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %import_ref.9: %Greater.type.2 = import_ref Core//prelude/operators/comparison, inst+114, loaded [template = constants.%Greater.2] // CHECK:STDOUT: %import_ref.10: %GreaterOrEquivalent.type.2 = import_ref Core//prelude/operators/comparison, inst+135, loaded [template = constants.%GreaterOrEquivalent.2] // CHECK:STDOUT: %import_ref.11: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.12: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.13: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.14: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.15: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.16: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.17 = import_ref Core//prelude/operators/comparison, inst+72, unloaded -// CHECK:STDOUT: %import_ref.18: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.19: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.20 = import_ref Core//prelude/operators/comparison, inst+93, unloaded -// CHECK:STDOUT: %import_ref.21: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.22: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.23 = import_ref Core//prelude/operators/comparison, inst+114, unloaded -// CHECK:STDOUT: %import_ref.24: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.25: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.26 = import_ref Core//prelude/operators/comparison, inst+135, unloaded +// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/comparison, inst+72, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/comparison, inst+93, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/comparison, inst+114, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+135, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: .TestLess = %TestLess.decl // CHECK:STDOUT: .TestLessEqual = %TestLessEqual.decl @@ -159,19 +159,10 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: .TestGreaterEqual = %TestGreaterEqual.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl { // CHECK:STDOUT: %C.ref.loc6: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Ordered.ref: type = name_ref Ordered, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [template = constants.%TestLess] { @@ -386,22 +377,33 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %LessOrEquivalent.type: type = fn_type @LessOrEquivalent [template] // CHECK:STDOUT: %LessOrEquivalent: %LessOrEquivalent.type = struct_value () [template] // CHECK:STDOUT: %.7: type = assoc_entity_type @Ordered, %LessOrEquivalent.type [template] -// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, imports.%import_ref.15 [template] +// CHECK:STDOUT: %.8: %.7 = assoc_entity element1, imports.%import_ref.13 [template] // CHECK:STDOUT: %TestGreater.type: type = fn_type @TestGreater [template] // CHECK:STDOUT: %TestGreater: %TestGreater.type = struct_value () [template] // CHECK:STDOUT: %Greater.type: type = fn_type @Greater [template] // CHECK:STDOUT: %Greater: %Greater.type = struct_value () [template] // CHECK:STDOUT: %.9: type = assoc_entity_type @Ordered, %Greater.type [template] -// CHECK:STDOUT: %.10: %.9 = assoc_entity element2, imports.%import_ref.18 [template] +// CHECK:STDOUT: %.10: %.9 = assoc_entity element2, imports.%import_ref.14 [template] // CHECK:STDOUT: %TestGreaterEqual.type: type = fn_type @TestGreaterEqual [template] // CHECK:STDOUT: %TestGreaterEqual: %TestGreaterEqual.type = struct_value () [template] // CHECK:STDOUT: %GreaterOrEquivalent.type: type = fn_type @GreaterOrEquivalent [template] // CHECK:STDOUT: %GreaterOrEquivalent: %GreaterOrEquivalent.type = struct_value () [template] // CHECK:STDOUT: %.11: type = assoc_entity_type @Ordered, %GreaterOrEquivalent.type [template] -// CHECK:STDOUT: %.12: %.11 = assoc_entity element3, imports.%import_ref.21 [template] +// CHECK:STDOUT: %.12: %.11 = assoc_entity element3, imports.%import_ref.15 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Ordered = %import_ref.2 +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: %import_ref.2: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.4] // CHECK:STDOUT: %import_ref.3 = import_ref Core//prelude/operators/comparison, inst+56, unloaded @@ -414,20 +416,14 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/comparison, inst+114, unloaded // CHECK:STDOUT: %import_ref.11 = import_ref Core//prelude/operators/comparison, inst+135, unloaded // CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/comparison, inst+72, unloaded -// CHECK:STDOUT: %import_ref.13: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.14: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+93, unloaded -// CHECK:STDOUT: %import_ref.16: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.17: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.18 = import_ref Core//prelude/operators/comparison, inst+114, unloaded -// CHECK:STDOUT: %import_ref.19: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.20: type = import_ref Core//prelude/operators/comparison, inst+54, loaded [template = constants.%.4] -// CHECK:STDOUT: %import_ref.21 = import_ref Core//prelude/operators/comparison, inst+135, unloaded +// CHECK:STDOUT: %import_ref.13 = import_ref Core//prelude/operators/comparison, inst+93, unloaded +// CHECK:STDOUT: %import_ref.14 = import_ref Core//prelude/operators/comparison, inst+114, unloaded +// CHECK:STDOUT: %import_ref.15 = import_ref Core//prelude/operators/comparison, inst+135, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .D = %D.decl // CHECK:STDOUT: .TestLess = %TestLess.decl // CHECK:STDOUT: .TestLessEqual = %TestLessEqual.decl @@ -435,15 +431,6 @@ fn TestGreaterEqual(a: D, b: D) -> bool { // CHECK:STDOUT: .TestGreaterEqual = %TestGreaterEqual.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %D.decl: type = class_decl @D [template = constants.%D] {} // CHECK:STDOUT: %TestLess.decl: %TestLess.type = fn_decl @TestLess [template = constants.%TestLess] { // CHECK:STDOUT: %D.ref.loc6_16: type = name_ref D, %D.decl [template = constants.%D] diff --git a/toolchain/check/testdata/operators/overloaded/right_shift.carbon b/toolchain/check/testdata/operators/overloaded/right_shift.carbon index c30baef2d127..4eb473d1e18c 100644 --- a/toolchain/check/testdata/operators/overloaded/right_shift.carbon +++ b/toolchain/check/testdata/operators/overloaded/right_shift.carbon @@ -58,37 +58,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @RightShift, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @RightShiftAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+222, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+224, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+245, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+240, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+247, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+249, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+270, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+264, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/bitwise, inst+222, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+240, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/bitwise, inst+247, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/bitwise, inst+264, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: .TestAssign = %TestAssign.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .RightShift = %import_ref.1 +// CHECK:STDOUT: .RightShiftAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,15 +77,35 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/bitwise, inst+222, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/bitwise, inst+224, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/bitwise, inst+245, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/bitwise, inst+240, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/bitwise, inst+247, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/bitwise, inst+249, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/bitwise, inst+270, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/bitwise, inst+264, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/bitwise, inst+240, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/bitwise, inst+264, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: .TestAssign = %TestAssign.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %RightShift.ref: type = name_ref RightShift, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %RightShiftAssign.ref: type = name_ref RightShiftAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/operators/overloaded/sub.carbon b/toolchain/check/testdata/operators/overloaded/sub.carbon index 1874bc92bb1e..bf196ee0c051 100644 --- a/toolchain/check/testdata/operators/overloaded/sub.carbon +++ b/toolchain/check/testdata/operators/overloaded/sub.carbon @@ -58,37 +58,17 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: %TestOp.type: type = fn_type @TestOp [template] // CHECK:STDOUT: %TestOp: %TestOp.type = struct_value () [template] // CHECK:STDOUT: %.10: type = assoc_entity_type @Sub, %Op.type.2 [template] -// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.10 [template] +// CHECK:STDOUT: %.11: %.10 = assoc_entity element0, imports.%import_ref.9 [template] // CHECK:STDOUT: %TestAssign.type: type = fn_type @TestAssign [template] // CHECK:STDOUT: %TestAssign: %TestAssign.type = struct_value () [template] // CHECK:STDOUT: %.12: type = assoc_entity_type @SubAssign, %Op.type.4 [template] -// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.12 [template] +// CHECK:STDOUT: %.13: %.12 = assoc_entity element0, imports.%import_ref.10 [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+92, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+94, unloaded -// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+115, loaded [template = constants.%.11] -// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+110, loaded [template = constants.%Op.2] -// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+117, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+119, unloaded -// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+140, loaded [template = constants.%.13] -// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+134, loaded [template = constants.%Op.4] -// CHECK:STDOUT: %import_ref.9: type = import_ref Core//prelude/operators/arithmetic, inst+92, loaded [template = constants.%.2] -// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+110, unloaded -// CHECK:STDOUT: %import_ref.11: type = import_ref Core//prelude/operators/arithmetic, inst+117, loaded [template = constants.%.6] -// CHECK:STDOUT: %import_ref.12 = import_ref Core//prelude/operators/arithmetic, inst+134, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .TestOp = %TestOp.decl -// CHECK:STDOUT: .TestAssign = %TestAssign.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Sub = %import_ref.1 +// CHECK:STDOUT: .SubAssign = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,15 +77,35 @@ fn TestAssign(a: C*, b: C) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: type = import_ref Core//prelude/operators/arithmetic, inst+92, loaded [template = constants.%.2] +// CHECK:STDOUT: %import_ref.2 = import_ref Core//prelude/operators/arithmetic, inst+94, unloaded +// CHECK:STDOUT: %import_ref.3: %.10 = import_ref Core//prelude/operators/arithmetic, inst+115, loaded [template = constants.%.11] +// CHECK:STDOUT: %import_ref.4: %Op.type.2 = import_ref Core//prelude/operators/arithmetic, inst+110, loaded [template = constants.%Op.2] +// CHECK:STDOUT: %import_ref.5: type = import_ref Core//prelude/operators/arithmetic, inst+117, loaded [template = constants.%.6] +// CHECK:STDOUT: %import_ref.6 = import_ref Core//prelude/operators/arithmetic, inst+119, unloaded +// CHECK:STDOUT: %import_ref.7: %.12 = import_ref Core//prelude/operators/arithmetic, inst+140, loaded [template = constants.%.13] +// CHECK:STDOUT: %import_ref.8: %Op.type.4 = import_ref Core//prelude/operators/arithmetic, inst+134, loaded [template = constants.%Op.4] +// CHECK:STDOUT: %import_ref.9 = import_ref Core//prelude/operators/arithmetic, inst+110, unloaded +// CHECK:STDOUT: %import_ref.10 = import_ref Core//prelude/operators/arithmetic, inst+134, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .TestOp = %TestOp.decl +// CHECK:STDOUT: .TestAssign = %TestAssign.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: impl_decl @impl.1 { // CHECK:STDOUT: %C.ref.loc17: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc17: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %Sub.ref: type = name_ref Sub, imports.%import_ref.1 [template = constants.%.2] // CHECK:STDOUT: } // CHECK:STDOUT: impl_decl @impl.2 { // CHECK:STDOUT: %C.ref.loc22: type = name_ref C, %C.decl [template = constants.%C] -// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, %Core [template = %Core] +// CHECK:STDOUT: %Core.ref.loc22: = name_ref Core, imports.%Core [template = imports.%Core] // CHECK:STDOUT: %SubAssign.ref: type = name_ref SubAssign, imports.%import_ref.5 [template = constants.%.6] // CHECK:STDOUT: } // CHECK:STDOUT: %TestOp.decl: %TestOp.type = fn_decl @TestOp [template = constants.%TestOp] { diff --git a/toolchain/check/testdata/package_expr/fail_not_found.carbon b/toolchain/check/testdata/package_expr/fail_not_found.carbon index 5a4c087fcfd8..37523f1c5422 100644 --- a/toolchain/check/testdata/package_expr/fail_not_found.carbon +++ b/toolchain/check/testdata/package_expr/fail_not_found.carbon @@ -26,16 +26,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +36,15 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/package_expr/syntax.carbon b/toolchain/check/testdata/package_expr/syntax.carbon index 5dd0501b2501..55a27ec06251 100644 --- a/toolchain/check/testdata/package_expr/syntax.carbon +++ b/toolchain/check/testdata/package_expr/syntax.carbon @@ -51,18 +51,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -71,6 +61,16 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32.loc4, %.loc4_8.1 [template = i32] @@ -109,19 +109,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -130,6 +119,16 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32, %.loc4_8.1 [template = i32] @@ -181,14 +180,8 @@ fn Main() { // CHECK:STDOUT: %.3: type = ptr_type %.2 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .NS = %NS -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -197,6 +190,15 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %NS: = namespace [template] { // CHECK:STDOUT: .C = %C.decl // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/explicit_imports.carbon b/toolchain/check/testdata/packages/explicit_imports.carbon index d156104076ba..1cbd97276862 100644 --- a/toolchain/check/testdata/packages/explicit_imports.carbon +++ b/toolchain/check/testdata/packages/explicit_imports.carbon @@ -40,12 +40,8 @@ import library "lib"; // CHECK:STDOUT: --- api.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -56,14 +52,17 @@ import library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- api_lib.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -74,15 +73,17 @@ import library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- same_package.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -93,16 +94,18 @@ import library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- different_package.carbon -// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Api = %Api +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Api.import = import Api -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- different_package.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -111,20 +114,25 @@ import library "lib"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %Api: = namespace %Api.import, [template] { +// CHECK:STDOUT: %Api: = namespace file.%Api.import, [template] { // CHECK:STDOUT: import Api//default // CHECK:STDOUT: import Api//lib // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- main_lib_api.carbon -// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Api = imports.%Api // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Api.import = import Api +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- main_lib_api.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -135,15 +143,17 @@ import library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- main_import.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -154,3 +164,11 @@ import library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_api_not_found.carbon b/toolchain/check/testdata/packages/fail_api_not_found.carbon index bc8e11d3c7c1..4f57b99a60fd 100644 --- a/toolchain/check/testdata/packages/fail_api_not_found.carbon +++ b/toolchain/check/testdata/packages/fail_api_not_found.carbon @@ -33,14 +33,8 @@ impl library "Bar"; // CHECK:STDOUT: --- fail_no_api.impl.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: has_error -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,16 +45,19 @@ impl library "Bar"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: has_error +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_no_api_lib.impl.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: has_error -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -71,16 +68,19 @@ impl library "Bar"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: has_error +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_no_api_main_lib.impl.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: has_error -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -91,3 +91,12 @@ impl library "Bar"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: has_error +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon index 035acd021b7c..bc5443a2905b 100644 --- a/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon +++ b/toolchain/check/testdata/packages/fail_conflict_no_namespaces.carbon @@ -47,13 +47,8 @@ import library "var"; // CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -62,6 +57,14 @@ import library "var"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -76,16 +79,8 @@ import library "var"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Foo = %Foo -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -94,6 +89,15 @@ import library "var"; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Foo = %Foo +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_10.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_10.2: type = converted %int.make_type_32, %.loc4_10.1 [template = i32] @@ -108,16 +112,7 @@ import library "var"; // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Example//fn, inst+3, unloaded // CHECK:STDOUT: %import_ref.2 = import_ref Example//var, inst+13, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Foo = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -128,3 +123,12 @@ import library "var"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Foo = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_cycle.carbon b/toolchain/check/testdata/packages/fail_cycle.carbon index 84bf9e5a862d..daed62198de2 100644 --- a/toolchain/check/testdata/packages/fail_cycle.carbon +++ b/toolchain/check/testdata/packages/fail_cycle.carbon @@ -57,14 +57,8 @@ import B; // CHECK:STDOUT: --- fail_a.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B = %B -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.import = import B -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -73,21 +67,24 @@ import B; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %B: = namespace %B.import, [template] { +// CHECK:STDOUT: %B: = namespace file.%B.import, [template] { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = imports.%B +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %B.import = import B +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_b.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.import = import C -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -96,21 +93,24 @@ import B; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %C: = namespace %C.import, [template] { +// CHECK:STDOUT: %C: = namespace file.%C.import, [template] { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = imports.%C +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %C.import = import C +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_c.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %A.import = import A -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -119,41 +119,47 @@ import B; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %A: = namespace %A.import, [template] { +// CHECK:STDOUT: %A: = namespace file.%A.import, [template] { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = imports.%A +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %A.import = import A +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_c.impl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_cycle_child.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B = %B -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %B.import = import B -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -162,8 +168,17 @@ import B; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %B: = namespace %B.import, [template] { +// CHECK:STDOUT: %B: = namespace file.%B.import, [template] { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = imports.%B +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %B.import = import B +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_duplicate_api.carbon b/toolchain/check/testdata/packages/fail_duplicate_api.carbon index ab9cbbd30a2a..1a81a955154f 100644 --- a/toolchain/check/testdata/packages/fail_duplicate_api.carbon +++ b/toolchain/check/testdata/packages/fail_duplicate_api.carbon @@ -51,12 +51,8 @@ package Package library "lib"; // CHECK:STDOUT: --- main1.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -67,14 +63,17 @@ package Package library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_main2.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -85,14 +84,17 @@ package Package library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- main_lib1.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -103,14 +105,17 @@ package Package library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_lib2.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -121,14 +126,17 @@ package Package library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- package1.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -139,14 +147,17 @@ package Package library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_package2.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -157,14 +168,17 @@ package Package library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- package_lib1.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -175,14 +189,17 @@ package Package library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_package_lib2.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -193,3 +210,10 @@ package Package library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_extension.carbon b/toolchain/check/testdata/packages/fail_extension.carbon index 23e77ed57524..4df4ee6307bb 100644 --- a/toolchain/check/testdata/packages/fail_extension.carbon +++ b/toolchain/check/testdata/packages/fail_extension.carbon @@ -86,12 +86,8 @@ impl package SwappedExt; // CHECK:STDOUT: --- fail_main.incorrect // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -102,14 +98,17 @@ impl package SwappedExt; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_redundant_with_swapped_ext.impl.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -120,14 +119,17 @@ impl package SwappedExt; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_lib.incorrect // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -138,34 +140,40 @@ impl package SwappedExt; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_lib_impl.incorrect // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc6_6.1 = import // CHECK:STDOUT: %default.import.loc6_6.2 = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_package.incorrect // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -176,16 +184,17 @@ impl package SwappedExt; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_package_impl.incorrect // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Package.import = import Package -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -196,14 +205,19 @@ impl package SwappedExt; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Package.import = import Package +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_package_lib.incorrect // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -214,34 +228,40 @@ impl package SwappedExt; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_package_lib_impl.incorrect // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Package.import = import Package // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_swapped_ext.impl.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -252,16 +272,17 @@ impl package SwappedExt; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_swapped_ext.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %SwappedExt.import = import SwappedExt -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -272,3 +293,12 @@ impl package SwappedExt; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %SwappedExt.import = import SwappedExt +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_import_default.carbon b/toolchain/check/testdata/packages/fail_import_default.carbon index 3bc069f588a0..08a05a0887f1 100644 --- a/toolchain/check/testdata/packages/fail_import_default.carbon +++ b/toolchain/check/testdata/packages/fail_import_default.carbon @@ -47,12 +47,8 @@ import library default; // CHECK:STDOUT: --- fail_default_api.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -63,34 +59,40 @@ import library default; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_default.impl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %A.import = import A // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_import_default.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -101,14 +103,17 @@ import library default; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_lib_import_default.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -119,3 +124,10 @@ import library default; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_import_invalid.carbon b/toolchain/check/testdata/packages/fail_import_invalid.carbon index 729f683f35b0..608d5b5544f2 100644 --- a/toolchain/check/testdata/packages/fail_import_invalid.carbon +++ b/toolchain/check/testdata/packages/fail_import_invalid.carbon @@ -96,12 +96,8 @@ import ImportNotFound; // CHECK:STDOUT: --- fail_main.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -112,14 +108,17 @@ import ImportNotFound; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_not_main.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -130,14 +129,17 @@ import ImportNotFound; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_this.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -148,14 +150,17 @@ import ImportNotFound; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_this_lib.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -166,14 +171,17 @@ import ImportNotFound; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- implicit_api.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -184,16 +192,17 @@ import ImportNotFound; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_implicit.impl.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -204,14 +213,19 @@ import ImportNotFound; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- implicit_lib_api.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -222,36 +236,40 @@ import ImportNotFound; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_implicit_lib.impl.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Implicit.import = import Implicit // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_not_found.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .ImportNotFound = %ImportNotFound -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %ImportNotFound.import = import ImportNotFound -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -260,8 +278,17 @@ import ImportNotFound; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %ImportNotFound: = namespace %ImportNotFound.import, [template] { +// CHECK:STDOUT: %ImportNotFound: = namespace file.%ImportNotFound.import, [template] { // CHECK:STDOUT: has_error // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .ImportNotFound = imports.%ImportNotFound +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %ImportNotFound.import = import ImportNotFound +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_import_repeat.carbon b/toolchain/check/testdata/packages/fail_import_repeat.carbon index a3d13e660837..c4d0d5778b64 100644 --- a/toolchain/check/testdata/packages/fail_import_repeat.carbon +++ b/toolchain/check/testdata/packages/fail_import_repeat.carbon @@ -67,12 +67,8 @@ import library default; // CHECK:STDOUT: --- api.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -83,14 +79,17 @@ import library default; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- api_lib.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -101,14 +100,17 @@ import library default; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- main_lib.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -119,17 +121,17 @@ import library default; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_import.carbon -// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Api = %Api +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Api.import = import Api -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_import.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -138,21 +140,26 @@ import library default; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } -// CHECK:STDOUT: %Api: = namespace %Api.import, [template] { +// CHECK:STDOUT: %Api: = namespace file.%Api.import, [template] { // CHECK:STDOUT: import Api//default // CHECK:STDOUT: import Api//lib // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_default_import.carbon -// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Api = imports.%Api // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %Api.import = import Api // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_default_import.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -163,3 +170,11 @@ import library default; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/fail_import_type_error.carbon b/toolchain/check/testdata/packages/fail_import_type_error.carbon index 50d6240c3ce5..70bb0185d1a9 100644 --- a/toolchain/check/testdata/packages/fail_import_type_error.carbon +++ b/toolchain/check/testdata/packages/fail_import_type_error.carbon @@ -45,16 +45,8 @@ var d: i32 = d_ref; // CHECK:STDOUT: --- fail_implicit.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a_ref = %a_ref -// CHECK:STDOUT: .b_ref = %b_ref -// CHECK:STDOUT: .c_ref = %c_ref -// CHECK:STDOUT: .d_ref = %d_ref -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -63,6 +55,17 @@ var d: i32 = d_ref; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a_ref = %a_ref +// CHECK:STDOUT: .b_ref = %b_ref +// CHECK:STDOUT: .c_ref = %c_ref +// CHECK:STDOUT: .d_ref = %d_ref +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %x.ref.loc8: = name_ref x, [template = ] // CHECK:STDOUT: %a_ref.var: ref = var a_ref // CHECK:STDOUT: %a_ref: ref = bind_name a_ref, %a_ref.var @@ -93,28 +96,8 @@ var d: i32 = d_ref; // CHECK:STDOUT: %import_ref.2: ref = import_ref Implicit//default, inst+10, loaded // CHECK:STDOUT: %import_ref.3: ref = import_ref Implicit//default, inst+14, loaded // CHECK:STDOUT: %import_ref.4: ref = import_ref Implicit//default, inst+18, loaded -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = imports.%import_ref.1 -// CHECK:STDOUT: .b_ref = imports.%import_ref.2 -// CHECK:STDOUT: .c_ref = imports.%import_ref.3 -// CHECK:STDOUT: .d_ref = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: .d = %d -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -123,6 +106,24 @@ var d: i32 = d_ref; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .c_ref = imports.%import_ref.3 +// CHECK:STDOUT: .d_ref = imports.%import_ref.4 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .d = %d +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc6: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc6_8.1: type = value_of_initializer %int.make_type_32.loc6 [template = i32] // CHECK:STDOUT: %.loc6_8.2: type = converted %int.make_type_32.loc6, %.loc6_8.1 [template = i32] diff --git a/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon b/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon index d091d33e77b7..26faf4af833c 100644 --- a/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon +++ b/toolchain/check/testdata/packages/fail_name_with_import_failure.carbon @@ -23,15 +23,8 @@ var a: () = A(); // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: has_error -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -40,6 +33,16 @@ var a: () = A(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: has_error +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc7_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc7_9.2: type = converted %.loc7_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a diff --git a/toolchain/check/testdata/packages/fail_package_main.carbon b/toolchain/check/testdata/packages/fail_package_main.carbon index a9bb41b6ba40..0cc9e54d2be8 100644 --- a/toolchain/check/testdata/packages/fail_package_main.carbon +++ b/toolchain/check/testdata/packages/fail_package_main.carbon @@ -42,12 +42,8 @@ package Main library "lib"; // CHECK:STDOUT: --- fail_main.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -58,14 +54,17 @@ package Main library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_impl.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -76,14 +75,17 @@ package Main library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_raw_main.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -94,14 +96,17 @@ package Main library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_lib.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -112,3 +117,10 @@ package Main library "lib"; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon index b39eedfd4057..4d4b6f63f54d 100644 --- a/toolchain/check/testdata/packages/implicit_imports_prelude.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_prelude.carbon @@ -32,16 +32,8 @@ var b: i32 = a; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +42,15 @@ var b: i32 = a; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32, %.loc4_8.1 [template = i32] @@ -76,19 +77,8 @@ var b: i32 = a; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: ref i32 = import_ref Main//lib, inst+13, loaded -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a = imports.%import_ref.1 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import.loc2_6.1 = import -// CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,6 +87,18 @@ var b: i32 = a; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .a = imports.%import_ref.1 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import.loc2_6.1 = import +// CHECK:STDOUT: %default.import.loc2_6.2 = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_8.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_8.2: type = converted %int.make_type_32, %.loc4_8.1 [template = i32] diff --git a/toolchain/check/testdata/packages/loaded_global.carbon b/toolchain/check/testdata/packages/loaded_global.carbon index ff2892997278..14ba9a615810 100644 --- a/toolchain/check/testdata/packages/loaded_global.carbon +++ b/toolchain/check/testdata/packages/loaded_global.carbon @@ -46,13 +46,8 @@ var package_b: () = package.B(); // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -61,6 +56,14 @@ var package_b: () = package.B(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -76,19 +79,7 @@ var package_b: () = package.B(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %A.type = import_ref Implicit//default, inst+3, loaded [template = constants.%A] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .package_a = %package_a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -97,6 +88,18 @@ var package_b: () = package.B(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .package_a = %package_a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc4_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc4_9.2: type = converted %.loc4_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %a.var: ref %.1 = var a @@ -129,13 +132,8 @@ var package_b: () = package.B(); // CHECK:STDOUT: %B: %B.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .B = %B.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -144,6 +142,14 @@ var package_b: () = package.B(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .B = %B.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [template = constants.%B] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -159,18 +165,7 @@ var package_b: () = package.B(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref: %B.type = import_ref SamePackage//default, inst+3, loaded [template = constants.%B] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .B = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .package_b = %package_b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -179,6 +174,17 @@ var package_b: () = package.B(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .B = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .package_b = %package_b +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %.loc6_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc6_9.2: type = converted %.loc6_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %b.var: ref %.1 = var b diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon index b3798d6a4cf6..e0fc96b2d33c 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon @@ -382,6 +382,11 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: import Other//export_import +// CHECK:STDOUT: import Other//base +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref Other//base, inst+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+7, unloaded @@ -389,15 +394,11 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//export_import -// CHECK:STDOUT: import Other//base -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var @@ -434,6 +435,12 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: import Other//export_import +// CHECK:STDOUT: import Other//export_import_copy +// CHECK:STDOUT: import Other//base +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref Other//base, inst+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+7, unloaded @@ -441,16 +448,11 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//export_import -// CHECK:STDOUT: import Other//export_import_copy -// CHECK:STDOUT: import Other//base -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var @@ -487,6 +489,12 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: import Other//export_import_indirect +// CHECK:STDOUT: import Other//export_import +// CHECK:STDOUT: import Other//base +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//base, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref Other//base, inst+2, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Other//base, inst+7, unloaded @@ -494,16 +502,11 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//export_import_indirect -// CHECK:STDOUT: import Other//export_import -// CHECK:STDOUT: import Other//base -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var @@ -540,6 +543,10 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: import Other//export_name +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+9, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+10, unloaded @@ -547,14 +554,11 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//export_name -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var @@ -591,6 +595,11 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: import Other//export_name +// CHECK:STDOUT: import Other//export_name_copy +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+9, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+10, unloaded @@ -598,15 +607,11 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//export_name -// CHECK:STDOUT: import Other//export_name_copy -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var @@ -643,6 +648,10 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: import Other//export_name_indirect +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name_indirect, inst+11, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name_indirect, inst+9, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name_indirect, inst+10, unloaded @@ -650,14 +659,11 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//export_name_indirect -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var @@ -694,18 +700,8 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+9, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+10, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 // CHECK:STDOUT: import Other//export_import // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: import Other//export_import_copy @@ -714,7 +710,18 @@ alias C = Other.C; // CHECK:STDOUT: import Other//export_name_indirect // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+9, unloaded +// CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+10, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var @@ -741,31 +748,37 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: --- unused_conflict_on_export_import.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: import Other//export_import // CHECK:STDOUT: import Other//conflict // CHECK:STDOUT: import Other//base // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- unused_conflict_on_export_name.carbon -// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- unused_conflict_on_export_name.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: import Other//export_name // CHECK:STDOUT: import Other//conflict // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: } +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_conflict_on_export_import.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -775,22 +788,23 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: import Other//export_import +// CHECK:STDOUT: import Other//conflict +// CHECK:STDOUT: import Other//base +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %C.type = import_ref Other//conflict, inst+1, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref Other//base, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//export_import -// CHECK:STDOUT: import Other//conflict -// CHECK:STDOUT: import Other//base -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %C: %C.type = bind_alias C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } @@ -806,6 +820,11 @@ alias C = Other.C; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .C = %import_ref.1 +// CHECK:STDOUT: import Other//export_name +// CHECK:STDOUT: import Other//conflict +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//export_name, inst+11, loaded [template = constants.%C] // CHECK:STDOUT: %import_ref.2 = import_ref Other//export_name, inst+9, unloaded // CHECK:STDOUT: %import_ref.3 = import_ref Other//export_name, inst+10, unloaded @@ -814,15 +833,11 @@ alias C = Other.C; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .C = %C // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//export_name -// CHECK:STDOUT: import Other//conflict -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %C: type = bind_alias C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon index a7afbea194c1..30a256238f51 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon @@ -354,29 +354,31 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .F = %import_ref.1 +// CHECK:STDOUT: .F2 = %import_ref.2 +// CHECK:STDOUT: import Other//fn +// CHECK:STDOUT: import Other//fn2 +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//fn, inst+1, loaded [template = constants.%F] // CHECK:STDOUT: %import_ref.2: %F2.type = import_ref Other//fn2, inst+1, loaded [template = constants.%F2] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//fn -// CHECK:STDOUT: import Other//fn2 -// CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Other.ref.loc8: = name_ref Other, file.%Other [template = file.%Other] +// CHECK:STDOUT: %Other.ref.loc8: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.1 [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() -// CHECK:STDOUT: %Other.ref.loc9: = name_ref Other, file.%Other [template = file.%Other] +// CHECK:STDOUT: %Other.ref.loc9: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %F2.ref: %F2.type = name_ref F2, imports.%import_ref.2 [template = constants.%F2] // CHECK:STDOUT: %F2.call: init %.1 = call %F2.ref() // CHECK:STDOUT: return @@ -397,26 +399,27 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .F = %import_ref.1 +// CHECK:STDOUT: import Other//fn +// CHECK:STDOUT: import Other//fn_extern +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//fn, inst+1, loaded [template = constants.%F] // CHECK:STDOUT: %import_ref.2 = import_ref Other//fn_extern, inst+1, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//fn -// CHECK:STDOUT: import Other//fn_extern -// CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Other.ref: = name_ref Other, file.%Other [template = file.%Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.1 [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: return @@ -426,17 +429,20 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: // CHECK:STDOUT: --- main_unused_other_ambiguous.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: import Other//fn // CHECK:STDOUT: import Other//fn_conflict // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: } +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_main_use_other_ambiguous.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -448,26 +454,27 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .F = %import_ref.1 +// CHECK:STDOUT: import Other//fn +// CHECK:STDOUT: import Other//fn_conflict +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: %F.type = import_ref Other//fn, inst+1, loaded [template = constants.%F] // CHECK:STDOUT: %import_ref.2 = import_ref Other//fn_conflict, inst+6, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .Run = %Run.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//fn -// CHECK:STDOUT: import Other//fn_conflict -// CHECK:STDOUT: } // CHECK:STDOUT: %Run.decl: %Run.type = fn_decl @Run [template = constants.%Run] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Run() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Other.ref: = name_ref Other, file.%Other [template = file.%Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.1 [template = constants.%F] // CHECK:STDOUT: %F.call: init %.1 = call %F.ref() // CHECK:STDOUT: return @@ -484,19 +491,20 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %F.type = import_ref Other//fn, inst+1, loaded [template = constants.%F] +// CHECK:STDOUT: %import_ref.1: = import_ref Main//other_ns, inst+1, loaded +// CHECK:STDOUT: %Other: = namespace %import_ref.1, [template] { +// CHECK:STDOUT: .F = file.%F.decl +// CHECK:STDOUT: import Other//fn +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: %F.type = import_ref Other//fn, inst+1, loaded [template = constants.%F] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %import_ref: = import_ref Main//other_ns, inst+1, loaded -// CHECK:STDOUT: %Other: = namespace %import_ref, [template] { -// CHECK:STDOUT: import Other//fn -// CHECK:STDOUT: } // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -513,15 +521,18 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .G = file.%G.decl // CHECK:STDOUT: import Other//fn // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: } +// CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %.loc13: = namespace [template] {} // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} // CHECK:STDOUT: } @@ -539,15 +550,18 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: .Nested = %Nested +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .Nested = file.%Nested // CHECK:STDOUT: import Other//fn // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: } +// CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %Nested: = namespace [template] { // CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } @@ -567,15 +581,18 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %G: %G.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .G = file.%G.decl // CHECK:STDOUT: import Other//fn // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: } +// CHECK:STDOUT: %Other.import = import Other // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -592,21 +609,24 @@ fn UseF() { Other.F(); } // CHECK:STDOUT: %UseF: %UseF.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: import Other//fn_use +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .UseF = %UseF.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//fn_use -// CHECK:STDOUT: } // CHECK:STDOUT: %UseF.decl: %UseF.type = fn_decl @UseF [template = constants.%UseF] {} // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @UseF() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Other.ref: = name_ref Other, file.%Other [template = file.%Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %F.ref: = name_ref F, [template = ] // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/no_prelude/export_name.carbon index 65ec089da8b8..4f22ec8f926c 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/no_prelude/export_name.carbon @@ -260,56 +260,56 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+12, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+13, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+17, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = file.%NSC +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, inst+12, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+13, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//base, inst+17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//base, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = %NSC -// CHECK:STDOUT: } // CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %NSC: type = export NSC, imports.%import_ref.2 [template = constants.%NSC] +// CHECK:STDOUT: %NSC: type = export NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .y = imports.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .y = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- not_reexporting.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//export, inst+14, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//export, inst+22, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst+22, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//export, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = imports.%import_ref.2 -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_export.carbon @@ -324,37 +324,37 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = file.%NSC +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+12, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+20, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//export, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = %NSC -// CHECK:STDOUT: } // CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] -// CHECK:STDOUT: %NSC: type = export NSC, imports.%import_ref.2 [template = constants.%NSC] +// CHECK:STDOUT: %NSC: type = export NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .y = imports.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .y = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- export_in_impl.carbon @@ -380,44 +380,44 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+12, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+20, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//export, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = imports.%import_ref.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.2 [template = constants.%NSC] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .y = imports.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .y = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -458,45 +458,45 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export_export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_export, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_export, inst+12, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+20, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//export_export, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: = import_ref Main//export_export, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = imports.%import_ref.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.2 [template = constants.%NSC] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .y = imports.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .y = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -537,44 +537,44 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//export_export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export_export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export_export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export_export, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export_export, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export_export, inst+12, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export_export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export_export, inst+20, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//export_export, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//export_export, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = imports.%import_ref.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.2 [template = constants.%NSC] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .y = imports.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .y = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -602,19 +602,19 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Main//base, inst+1, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+12, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+12, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//base, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = imports.%import_ref.2 -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- fail_export_decl.carbon @@ -646,27 +646,27 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+12, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+12, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//base, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = imports.%import_ref.2 -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_both.carbon @@ -686,44 +686,44 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//base, inst+12, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+13, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+17, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//base, inst+12, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//base, inst+13, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//base, inst+17, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//base, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = imports.%import_ref.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.2 [template = constants.%NSC] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .y = imports.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .y = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -764,44 +764,44 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//export, inst+14, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//export, inst+12, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+13, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+20, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+21, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//export, inst+4, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3: type = import_ref Main//export, inst+22, loaded [template = constants.%NSC] +// CHECK:STDOUT: %import_ref.4 = import_ref Main//export, inst+12, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//export, inst+13, unloaded +// CHECK:STDOUT: %import_ref.6 = import_ref Main//export, inst+20, unloaded +// CHECK:STDOUT: %import_ref.7 = import_ref Main//export, inst+21, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: .c = %c // CHECK:STDOUT: .nsc = %nsc // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//export, inst+4, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = imports.%import_ref.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var -// CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.2 [template = constants.%NSC] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %NSC.ref: type = name_ref NSC, imports.%import_ref.3 [template = constants.%NSC] // CHECK:STDOUT: %nsc.var: ref %NSC = var nsc // CHECK:STDOUT: %nsc: ref %NSC = bind_name nsc, %nsc.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @NSC { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.5 -// CHECK:STDOUT: .y = imports.%import_ref.6 +// CHECK:STDOUT: .Self = imports.%import_ref.6 +// CHECK:STDOUT: .y = imports.%import_ref.7 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -849,28 +849,28 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+12, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+12, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//base, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = imports.%import_ref.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_repeat_export.carbon @@ -930,27 +930,27 @@ private export C; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: type = import_ref Main//base, inst+1, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//base, inst+12, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+2, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+7, unloaded +// CHECK:STDOUT: %import_ref.2: = import_ref Main//base, inst+11, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.2, [template] { +// CHECK:STDOUT: .NSC = %import_ref.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3 = import_ref Main//base, inst+12, unloaded +// CHECK:STDOUT: %import_ref.4 = import_ref Main//base, inst+2, unloaded +// CHECK:STDOUT: %import_ref.5 = import_ref Main//base, inst+7, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .C = %C -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//base, inst+11, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .NSC = imports.%import_ref.2 -// CHECK:STDOUT: } // CHECK:STDOUT: %C: type = export C, imports.%import_ref.1 [template = constants.%C] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.3 -// CHECK:STDOUT: .x = imports.%import_ref.4 +// CHECK:STDOUT: .Self = imports.%import_ref.4 +// CHECK:STDOUT: .x = imports.%import_ref.5 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon index c839f8fb6b80..58731eec34aa 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon @@ -131,33 +131,36 @@ private import PrivateImport; // CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_modifiers.carbon // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %ImplImport: = namespace file.%ImplImport.import, [template] { +// CHECK:STDOUT: has_error +// CHECK:STDOUT: } +// CHECK:STDOUT: %ExtendImport: = namespace file.%ExtendImport.import, [template] { +// CHECK:STDOUT: has_error +// CHECK:STDOUT: } +// CHECK:STDOUT: %VirtualImport: = namespace file.%VirtualImport.import, [template] { +// CHECK:STDOUT: has_error +// CHECK:STDOUT: } +// CHECK:STDOUT: %BaseImport: = namespace file.%BaseImport.import, [template] { +// CHECK:STDOUT: has_error +// CHECK:STDOUT: } +// CHECK:STDOUT: %PrivateImport: = namespace file.%PrivateImport.import, [template] { +// CHECK:STDOUT: has_error +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .ImplImport = %ImplImport -// CHECK:STDOUT: .ExtendImport = %ExtendImport -// CHECK:STDOUT: .VirtualImport = %VirtualImport -// CHECK:STDOUT: .BaseImport = %BaseImport -// CHECK:STDOUT: .PrivateImport = %PrivateImport +// CHECK:STDOUT: .ImplImport = imports.%ImplImport +// CHECK:STDOUT: .ExtendImport = imports.%ExtendImport +// CHECK:STDOUT: .VirtualImport = imports.%VirtualImport +// CHECK:STDOUT: .BaseImport = imports.%BaseImport +// CHECK:STDOUT: .PrivateImport = imports.%PrivateImport // CHECK:STDOUT: } // CHECK:STDOUT: %ImplImport.import = import ImplImport // CHECK:STDOUT: %ExtendImport.import = import ExtendImport // CHECK:STDOUT: %VirtualImport.import = import VirtualImport // CHECK:STDOUT: %BaseImport.import = import BaseImport // CHECK:STDOUT: %PrivateImport.import = import PrivateImport -// CHECK:STDOUT: %ImplImport: = namespace %ImplImport.import, [template] { -// CHECK:STDOUT: has_error -// CHECK:STDOUT: } -// CHECK:STDOUT: %ExtendImport: = namespace %ExtendImport.import, [template] { -// CHECK:STDOUT: has_error -// CHECK:STDOUT: } -// CHECK:STDOUT: %VirtualImport: = namespace %VirtualImport.import, [template] { -// CHECK:STDOUT: has_error -// CHECK:STDOUT: } -// CHECK:STDOUT: %BaseImport: = namespace %BaseImport.import, [template] { -// CHECK:STDOUT: has_error -// CHECK:STDOUT: } -// CHECK:STDOUT: %PrivateImport: = namespace %PrivateImport.import, [template] { -// CHECK:STDOUT: has_error -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon index f95aed4411ad..209a9dfed53d 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon @@ -418,18 +418,18 @@ import Other library "O1"; // CHECK:STDOUT: --- use_ns.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref = import_ref Main//ns, inst+2, unloaded +// CHECK:STDOUT: %import_ref.1: = import_ref Main//ns, inst+1, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { +// CHECK:STDOUT: .C = %import_ref.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2 = import_ref Main//ns, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: } // CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %import_ref: = import_ref Main//ns, inst+1, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .C = imports.%import_ref -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- use_ns.impl.carbon @@ -443,30 +443,30 @@ import Other library "O1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: type = import_ref Main//use_ns, inst+4, loaded [template = constants.%C] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//ns, inst+3, unloaded +// CHECK:STDOUT: %import_ref.1: = import_ref Main//use_ns, inst+3, loaded +// CHECK:STDOUT: %NS: = namespace %import_ref.1, [template] { +// CHECK:STDOUT: .C = %import_ref.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.2: type = import_ref Main//use_ns, inst+4, loaded [template = constants.%C] +// CHECK:STDOUT: %import_ref.3 = import_ref Main//ns, inst+3, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NS = %NS +// CHECK:STDOUT: .NS = imports.%NS // CHECK:STDOUT: .c = %c // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %import_ref: = import_ref Main//use_ns, inst+3, loaded -// CHECK:STDOUT: %NS: = namespace %import_ref, [template] { -// CHECK:STDOUT: .C = imports.%import_ref.1 -// CHECK:STDOUT: } -// CHECK:STDOUT: %NS.ref: = name_ref NS, %NS [template = %NS] -// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.1 [template = constants.%C] +// CHECK:STDOUT: %NS.ref: = name_ref NS, imports.%NS [template = imports.%NS] +// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%import_ref.2 [template = constants.%C] // CHECK:STDOUT: %c.var: ref %C = var c // CHECK:STDOUT: %c: ref %C = bind_name c, %c.var // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.2 +// CHECK:STDOUT: .Self = imports.%import_ref.3 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { @@ -480,16 +480,19 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: --- mix_other.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: import Other//O1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: } +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- mix_other.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -503,6 +506,12 @@ import Other library "O1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .O1 = %import_ref.1 +// CHECK:STDOUT: .O2 = %import_ref.3 +// CHECK:STDOUT: import Other//O2 +// CHECK:STDOUT: import Other//O1 +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//O1, inst+1, loaded [template = constants.%O1] // CHECK:STDOUT: %import_ref.2 = import_ref Other//O1, inst+2, unloaded // CHECK:STDOUT: %import_ref.3: type = import_ref Other//O2, inst+1, loaded [template = constants.%O2] @@ -511,22 +520,18 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .o1 = %o1 // CHECK:STDOUT: .o2 = %o2 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//O2 -// CHECK:STDOUT: import Other//O1 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref.loc6: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %Other.ref.loc6: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %O1.ref: type = name_ref O1, imports.%import_ref.1 [template = constants.%O1] // CHECK:STDOUT: %o1.var: ref %O1 = var o1 // CHECK:STDOUT: %o1: ref %O1 = bind_name o1, %o1.var -// CHECK:STDOUT: %Other.ref.loc7: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %Other.ref.loc7: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %O2.ref: type = name_ref O2, imports.%import_ref.3 [template = constants.%O2] // CHECK:STDOUT: %o2.var: ref %O2 = var o2 // CHECK:STDOUT: %o2: ref %O2 = bind_name o2, %o2.var @@ -557,16 +562,19 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: --- dup_o1.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: import Other//O1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: } +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- dup_o1.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -578,22 +586,23 @@ import Other library "O1"; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: .O1 = %import_ref.1 +// CHECK:STDOUT: import Other//O1 +// CHECK:STDOUT: } // CHECK:STDOUT: %import_ref.1: type = import_ref Other//O1, inst+1, loaded [template = constants.%O1] // CHECK:STDOUT: %import_ref.2 = import_ref Other//O1, inst+2, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: .o1 = %o1 // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc2_6.1 = import // CHECK:STDOUT: %default.import.loc2_6.2 = import // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//O1 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.ref: = name_ref Other, %Other [template = %Other] +// CHECK:STDOUT: %Other.ref: = name_ref Other, imports.%Other [template = imports.%Other] // CHECK:STDOUT: %O1.ref: type = name_ref O1, imports.%import_ref.1 [template = constants.%O1] // CHECK:STDOUT: %o1.var: ref %O1 = var o1 // CHECK:STDOUT: %o1: ref %O1 = bind_name o1, %o1.var @@ -615,32 +624,35 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: --- import_conflict.carbon // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: } -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: import Other//O1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: } +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: --- fail_import_conflict.impl.carbon // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref = import_ref Main//local_other, inst+1, unloaded +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { +// CHECK:STDOUT: import Other//O1 +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other +// CHECK:STDOUT: .Other = imports.%Other // CHECK:STDOUT: } // CHECK:STDOUT: %default.import.loc15_6.1 = import // CHECK:STDOUT: %default.import.loc15_6.2 = import // CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { -// CHECK:STDOUT: import Other//O1 -// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: --- import_conflict_reverse.carbon @@ -660,17 +672,17 @@ import Other library "O1"; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref = import_ref Main//import_conflict_reverse, inst+2, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Other = %Other -// CHECK:STDOUT: } -// CHECK:STDOUT: %default.import.loc2_6.1 = import -// CHECK:STDOUT: %default.import.loc2_6.2 = import -// CHECK:STDOUT: %Other.import = import Other -// CHECK:STDOUT: %Other: = namespace %Other.import, [template] { +// CHECK:STDOUT: %Other: = namespace file.%Other.import, [template] { // CHECK:STDOUT: import Other//O1 // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Other = imports.%Other +// CHECK:STDOUT: } +// CHECK:STDOUT: %default.import.loc2_6.1 = import +// CHECK:STDOUT: %default.import.loc2_6.2 = import +// CHECK:STDOUT: %Other.import = import Other +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/unused_lazy_import.carbon b/toolchain/check/testdata/packages/unused_lazy_import.carbon index b72e89065be6..683299cd01cd 100644 --- a/toolchain/check/testdata/packages/unused_lazy_import.carbon +++ b/toolchain/check/testdata/packages/unused_lazy_import.carbon @@ -26,13 +26,8 @@ impl package Implicit; // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -41,6 +36,14 @@ impl package Implicit; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: @@ -50,17 +53,7 @@ impl package Implicit; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref = import_ref Implicit//default, inst+3, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .A = imports.%import_ref -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -71,3 +64,13 @@ impl package Implicit; // CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .A = imports.%import_ref +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/address_of_deref.carbon b/toolchain/check/testdata/pointer/address_of_deref.carbon index 4c33ec72802a..6a97c5654f13 100644 --- a/toolchain/check/testdata/pointer/address_of_deref.carbon +++ b/toolchain/check/testdata/pointer/address_of_deref.carbon @@ -26,17 +26,8 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +36,15 @@ fn F() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/pointer/address_of_lvalue.carbon b/toolchain/check/testdata/pointer/address_of_lvalue.carbon index 91d1f107176d..0862f3e17fed 100644 --- a/toolchain/check/testdata/pointer/address_of_lvalue.carbon +++ b/toolchain/check/testdata/pointer/address_of_lvalue.carbon @@ -42,25 +42,8 @@ fn F() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -69,6 +52,15 @@ fn F() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/arrow.carbon b/toolchain/check/testdata/pointer/arrow.carbon index 4348d1923121..74b761b929a2 100644 --- a/toolchain/check/testdata/pointer/arrow.carbon +++ b/toolchain/check/testdata/pointer/arrow.carbon @@ -38,14 +38,8 @@ fn Foo(ptr: C*) { // CHECK:STDOUT: %.5: type = ptr_type %.4 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .Foo = %Foo.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -54,6 +48,15 @@ fn Foo(ptr: C*) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .Foo = %Foo.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] diff --git a/toolchain/check/testdata/pointer/basic.carbon b/toolchain/check/testdata/pointer/basic.carbon index 8cd59bd057fd..73592bf5ed1d 100644 --- a/toolchain/check/testdata/pointer/basic.carbon +++ b/toolchain/check/testdata/pointer/basic.carbon @@ -28,18 +28,8 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -48,6 +38,15 @@ fn F() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/pointer/fail_address_of_error.carbon b/toolchain/check/testdata/pointer/fail_address_of_error.carbon index c50265c2f7ec..a50900e75e1a 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_error.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_error.carbon @@ -32,13 +32,8 @@ fn Test() { // CHECK:STDOUT: %Test: %Test.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Test = %Test.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -47,6 +42,14 @@ fn Test() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Test = %Test.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_address_of_value.carbon b/toolchain/check/testdata/pointer/fail_address_of_value.carbon index 895de866766b..af4274c45e79 100644 --- a/toolchain/check/testdata/pointer/fail_address_of_value.carbon +++ b/toolchain/check/testdata/pointer/fail_address_of_value.carbon @@ -144,17 +144,22 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .G = %G.decl // CHECK:STDOUT: .H = %H.decl // CHECK:STDOUT: .AddressOfLiteral = %AddressOfLiteral.decl @@ -165,15 +170,6 @@ fn AddressOfParam(param: i32) { // CHECK:STDOUT: .AddressOfParam = %AddressOfParam.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/pointer/fail_deref_error.carbon b/toolchain/check/testdata/pointer/fail_deref_error.carbon index 46935875d6e8..07db2e23589a 100644 --- a/toolchain/check/testdata/pointer/fail_deref_error.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_error.carbon @@ -27,18 +27,8 @@ let n2: i32 = undeclared->foo; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .n = @__global_init.%n -// CHECK:STDOUT: .n2 = @__global_init.%n2 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -47,6 +37,16 @@ let n2: i32 = undeclared->foo; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .n = @__global_init.%n +// CHECK:STDOUT: .n2 = @__global_init.%n2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_8.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_8.2: type = converted %int.make_type_32.loc15, %.loc15_8.1 [template = i32] diff --git a/toolchain/check/testdata/pointer/fail_deref_function.carbon b/toolchain/check/testdata/pointer/fail_deref_function.carbon index 43ade8104aaa..53bb90f91940 100644 --- a/toolchain/check/testdata/pointer/fail_deref_function.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_function.carbon @@ -28,13 +28,8 @@ fn A() { // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +38,14 @@ fn A() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon index 6df31ec9079d..0264004f1587 100644 --- a/toolchain/check/testdata/pointer/fail_deref_namespace.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_namespace.carbon @@ -30,14 +30,8 @@ fn F() { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +40,15 @@ fn F() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A: = namespace [template] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon index 419f5c82e751..4e530b8f21f2 100644 --- a/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_not_pointer.carbon @@ -54,16 +54,8 @@ fn Deref(n: i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Deref = %Deref.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -72,6 +64,15 @@ fn Deref(n: i32) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Deref = %Deref.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Deref.decl: %Deref.type = fn_decl @Deref [template = constants.%Deref] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/pointer/fail_deref_type.carbon b/toolchain/check/testdata/pointer/fail_deref_type.carbon index 6a9c39fc4b19..720d6da66db8 100644 --- a/toolchain/check/testdata/pointer/fail_deref_type.carbon +++ b/toolchain/check/testdata/pointer/fail_deref_type.carbon @@ -30,18 +30,8 @@ var p2: i32->foo; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .p = %p -// CHECK:STDOUT: .p2 = %p2 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +40,16 @@ var p2: i32->foo; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .p = %p +// CHECK:STDOUT: .p2 = %p2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc18: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_9.1: type = value_of_initializer %int.make_type_32.loc18 [template = i32] // CHECK:STDOUT: %.loc18_9.2: type = converted %int.make_type_32.loc18, %.loc18_9.1 [template = i32] diff --git a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon index f7609138f158..4a798978bc91 100644 --- a/toolchain/check/testdata/pointer/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/pointer/fail_type_mismatch.carbon @@ -28,13 +28,8 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: %ConstMismatch: %ConstMismatch.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .ConstMismatch = %ConstMismatch.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +38,14 @@ fn ConstMismatch(p: const {}*) -> const ({}*) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .ConstMismatch = %ConstMismatch.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ConstMismatch.decl: %ConstMismatch.type = fn_decl @ConstMismatch [template = constants.%ConstMismatch] { // CHECK:STDOUT: %.loc11_28: %.1 = struct_literal () // CHECK:STDOUT: %.loc11_21.1: type = converted %.loc11_28, constants.%.1 [template = constants.%.1] diff --git a/toolchain/check/testdata/pointer/import.carbon b/toolchain/check/testdata/pointer/import.carbon index 49c8e712b8e8..8bc794218b42 100644 --- a/toolchain/check/testdata/pointer/import.carbon +++ b/toolchain/check/testdata/pointer/import.carbon @@ -32,18 +32,8 @@ var a: i32* = a_ref; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a_orig = %a_orig -// CHECK:STDOUT: .a_ref = %a_ref -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -52,6 +42,16 @@ var a: i32* = a_ref; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a_orig = %a_orig +// CHECK:STDOUT: .a_ref = %a_ref +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_32.loc4, %.loc4_13.1 [template = i32] @@ -88,21 +88,9 @@ var a: i32* = a_ref; // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+13, unloaded -// CHECK:STDOUT: %import_ref.2: ref %.2 = import_ref Implicit//default, inst+24, loaded -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_orig = imports.%import_ref.1 -// CHECK:STDOUT: .a_ref = imports.%import_ref.2 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2: ref %.2 = import_ref Implicit//default, inst+23, loaded +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.3 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -111,6 +99,19 @@ var a: i32* = a_ref; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .a_orig = imports.%import_ref.1 +// CHECK:STDOUT: .a_ref = imports.%import_ref.2 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_11.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc4_11.2: type = converted %int.make_type_32, %.loc4_11.1 [template = i32] diff --git a/toolchain/check/testdata/pointer/nested_const.carbon b/toolchain/check/testdata/pointer/nested_const.carbon index 7f3c7f614326..3a52777f5aae 100644 --- a/toolchain/check/testdata/pointer/nested_const.carbon +++ b/toolchain/check/testdata/pointer/nested_const.carbon @@ -29,17 +29,8 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -48,6 +39,15 @@ fn F(p: const (const (const i32*)*)) -> const i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc12_29: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc12_23.1: type = value_of_initializer %int.make_type_32.loc12_29 [template = i32] diff --git a/toolchain/check/testdata/pointer/types.carbon b/toolchain/check/testdata/pointer/types.carbon index b815d801df6d..eaf1c0adfe90 100644 --- a/toolchain/check/testdata/pointer/types.carbon +++ b/toolchain/check/testdata/pointer/types.carbon @@ -32,20 +32,8 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Ptr = %Ptr.decl -// CHECK:STDOUT: .ConstPtr = %ConstPtr.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -54,6 +42,16 @@ fn ConstPtr(p: const i32*) -> (const i32)* { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Ptr = %Ptr.decl +// CHECK:STDOUT: .ConstPtr = %ConstPtr.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Ptr.decl: %Ptr.type = fn_decl @Ptr [template = constants.%Ptr] { // CHECK:STDOUT: %int.make_type_32.loc11_11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32.loc11_11 [template = i32] diff --git a/toolchain/check/testdata/return/code_after_return.carbon b/toolchain/check/testdata/return/code_after_return.carbon index 21307e242411..0eb0bd98e088 100644 --- a/toolchain/check/testdata/return/code_after_return.carbon +++ b/toolchain/check/testdata/return/code_after_return.carbon @@ -25,16 +25,8 @@ fn Main() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +35,15 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/code_after_return_value.carbon b/toolchain/check/testdata/return/code_after_return_value.carbon index 4d22aa9f9f61..bbbdd21200b1 100644 --- a/toolchain/check/testdata/return/code_after_return_value.carbon +++ b/toolchain/check/testdata/return/code_after_return_value.carbon @@ -38,18 +38,9 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -58,6 +49,16 @@ fn F(b: bool) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_9.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/check/testdata/return/fail_call_in_type.carbon b/toolchain/check/testdata/return/fail_call_in_type.carbon index 47d7efc3b30f..b80436de9d2d 100644 --- a/toolchain/check/testdata/return/fail_call_in_type.carbon +++ b/toolchain/check/testdata/return/fail_call_in_type.carbon @@ -30,17 +30,8 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .ReturnType = %ReturnType.decl -// CHECK:STDOUT: .Six = %Six.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -49,6 +40,16 @@ fn Six() -> ReturnType() { return 6; } // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .ReturnType = %ReturnType.decl +// CHECK:STDOUT: .Six = %Six.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %ReturnType.decl: %ReturnType.type = fn_decl @ReturnType [template = constants.%ReturnType] { // CHECK:STDOUT: @ReturnType.%return: ref type = var // CHECK:STDOUT: } diff --git a/toolchain/check/testdata/return/fail_error_in_type.carbon b/toolchain/check/testdata/return/fail_error_in_type.carbon index f65a9923771b..f8050fb91d28 100644 --- a/toolchain/check/testdata/return/fail_error_in_type.carbon +++ b/toolchain/check/testdata/return/fail_error_in_type.carbon @@ -21,13 +21,8 @@ fn Six() -> x; // CHECK:STDOUT: %Six: %Six.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Six = %Six.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -36,6 +31,14 @@ fn Six() -> x; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Six = %Six.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Six.decl: %Six.type = fn_decl @Six [template = constants.%Six] { // CHECK:STDOUT: %x.ref: = name_ref x, [template = ] // CHECK:STDOUT: @Six.%return: ref = var diff --git a/toolchain/check/testdata/return/fail_missing_return.carbon b/toolchain/check/testdata/return/fail_missing_return.carbon index 87edf79ff8e4..734bcafa4d19 100644 --- a/toolchain/check/testdata/return/fail_missing_return.carbon +++ b/toolchain/check/testdata/return/fail_missing_return.carbon @@ -25,16 +25,8 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +35,15 @@ fn Main() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon b/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon index ce9e300647b7..3810a62c2e2b 100644 --- a/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon +++ b/toolchain/check/testdata/return/fail_missing_return_empty_tuple.carbon @@ -22,13 +22,8 @@ fn F() -> () { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -37,6 +32,14 @@ fn F() -> () { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %.loc11_12.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc11_12.2: type = converted %.loc11_12.1, constants.%.1 [template = constants.%.1] diff --git a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon index b33e806151f2..c6dee1951a76 100644 --- a/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_var_no_returned_var.carbon @@ -26,16 +26,8 @@ fn Procedure() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Procedure = %Procedure.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +36,15 @@ fn Procedure() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Procedure = %Procedure.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Procedure.decl: %Procedure.type = fn_decl @Procedure [template = constants.%Procedure] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon index 5e34835cf64f..07084c63fd04 100644 --- a/toolchain/check/testdata/return/fail_return_with_returned_var.carbon +++ b/toolchain/check/testdata/return/fail_return_with_returned_var.carbon @@ -53,21 +53,8 @@ fn G() -> C { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -76,6 +63,17 @@ fn G() -> C { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon index 09e50eceb846..6be669b3a277 100644 --- a/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_no_return_type.carbon @@ -27,13 +27,8 @@ fn Procedure() { // CHECK:STDOUT: %Procedure: %Procedure.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Procedure = %Procedure.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -42,6 +37,14 @@ fn Procedure() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Procedure = %Procedure.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Procedure.decl: %Procedure.type = fn_decl @Procedure [template = constants.%Procedure] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon index 9679a70cbfe8..4dfb8213d863 100644 --- a/toolchain/check/testdata/return/fail_returned_var_shadow.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_shadow.carbon @@ -55,22 +55,8 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .SameScope = %SameScope.decl -// CHECK:STDOUT: .DifferentScopes = %DifferentScopes.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -79,6 +65,16 @@ fn DifferentScopes() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .SameScope = %SameScope.decl +// CHECK:STDOUT: .DifferentScopes = %DifferentScopes.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %SameScope.decl: %SameScope.type = fn_decl @SameScope [template = constants.%SameScope] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/return/fail_returned_var_type.carbon b/toolchain/check/testdata/return/fail_returned_var_type.carbon index a2bd2aac9805..4662a55f8376 100644 --- a/toolchain/check/testdata/return/fail_returned_var_type.carbon +++ b/toolchain/check/testdata/return/fail_returned_var_type.carbon @@ -34,17 +34,9 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Mismatch = %Mismatch.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Float = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -53,6 +45,16 @@ fn Mismatch() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Mismatch = %Mismatch.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Mismatch.decl: %Mismatch.type = fn_decl @Mismatch [template = constants.%Mismatch] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_18.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/return/fail_type_mismatch.carbon b/toolchain/check/testdata/return/fail_type_mismatch.carbon index dee8b96934eb..d79a0e6a5fd0 100644 --- a/toolchain/check/testdata/return/fail_type_mismatch.carbon +++ b/toolchain/check/testdata/return/fail_type_mismatch.carbon @@ -27,16 +27,8 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +37,15 @@ fn Main() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/return/fail_value_disallowed.carbon b/toolchain/check/testdata/return/fail_value_disallowed.carbon index 175dfe1762ac..1cce53d214cd 100644 --- a/toolchain/check/testdata/return/fail_value_disallowed.carbon +++ b/toolchain/check/testdata/return/fail_value_disallowed.carbon @@ -27,13 +27,8 @@ fn Main() { // CHECK:STDOUT: %.2: i32 = int_literal 0 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -42,6 +37,14 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/fail_value_missing.carbon b/toolchain/check/testdata/return/fail_value_missing.carbon index 22eb6ebb3dcd..e23ce23c07f0 100644 --- a/toolchain/check/testdata/return/fail_value_missing.carbon +++ b/toolchain/check/testdata/return/fail_value_missing.carbon @@ -29,16 +29,8 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -47,6 +39,15 @@ fn Main() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/return/fail_var_in_type.carbon b/toolchain/check/testdata/return/fail_var_in_type.carbon index f728404896d3..9a8e44caebf8 100644 --- a/toolchain/check/testdata/return/fail_var_in_type.carbon +++ b/toolchain/check/testdata/return/fail_var_in_type.carbon @@ -26,17 +26,8 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .Six = %Six.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +36,16 @@ fn Six() -> x { return 6; } // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .Six = %Six.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %x.var: ref type = var x // CHECK:STDOUT: %x: ref type = bind_name x, %x.var // CHECK:STDOUT: %Six.decl: %Six.type = fn_decl @Six [template = constants.%Six] { diff --git a/toolchain/check/testdata/return/missing_return_no_return_type.carbon b/toolchain/check/testdata/return/missing_return_no_return_type.carbon index 4996b8db32e5..b99c6d4bb11c 100644 --- a/toolchain/check/testdata/return/missing_return_no_return_type.carbon +++ b/toolchain/check/testdata/return/missing_return_no_return_type.carbon @@ -19,13 +19,8 @@ fn F() { // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -34,6 +29,14 @@ fn F() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/no_value.carbon b/toolchain/check/testdata/return/no_value.carbon index 3d408faf8910..f5187f331583 100644 --- a/toolchain/check/testdata/return/no_value.carbon +++ b/toolchain/check/testdata/return/no_value.carbon @@ -20,13 +20,8 @@ fn Main() { // CHECK:STDOUT: %Main: %Main.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -35,6 +30,14 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/return/returned_var.carbon b/toolchain/check/testdata/return/returned_var.carbon index d6e98026a069..338ec916138e 100644 --- a/toolchain/check/testdata/return/returned_var.carbon +++ b/toolchain/check/testdata/return/returned_var.carbon @@ -44,21 +44,8 @@ fn G() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -67,6 +54,17 @@ fn G() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [template = constants.%C] diff --git a/toolchain/check/testdata/return/returned_var_scope.carbon b/toolchain/check/testdata/return/returned_var_scope.carbon index 550738724eff..a0ca6112f8cd 100644 --- a/toolchain/check/testdata/return/returned_var_scope.carbon +++ b/toolchain/check/testdata/return/returned_var_scope.carbon @@ -45,23 +45,9 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .UnrelatedScopes = %UnrelatedScopes.decl -// CHECK:STDOUT: .EnclosingButAfter = %EnclosingButAfter.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Bool = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -70,6 +56,17 @@ fn EnclosingButAfter(b: bool) -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .UnrelatedScopes = %UnrelatedScopes.decl +// CHECK:STDOUT: .EnclosingButAfter = %EnclosingButAfter.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %UnrelatedScopes.decl: %UnrelatedScopes.type = fn_decl @UnrelatedScopes [template = constants.%UnrelatedScopes] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_25.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/return/struct.carbon b/toolchain/check/testdata/return/struct.carbon index 9dd93b898a8a..aad9a148b40f 100644 --- a/toolchain/check/testdata/return/struct.carbon +++ b/toolchain/check/testdata/return/struct.carbon @@ -26,16 +26,8 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +36,15 @@ fn Main() -> {.a: i32} { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_19.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/return/tuple.carbon b/toolchain/check/testdata/return/tuple.carbon index 99319f919fba..de5759efccc4 100644 --- a/toolchain/check/testdata/return/tuple.carbon +++ b/toolchain/check/testdata/return/tuple.carbon @@ -30,17 +30,8 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -49,6 +40,15 @@ fn Main() -> (i32, i32) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32.loc12_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc12_20: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/return/value.carbon b/toolchain/check/testdata/return/value.carbon index cf872363b052..4be41a549d13 100644 --- a/toolchain/check/testdata/return/value.carbon +++ b/toolchain/check/testdata/return/value.carbon @@ -24,16 +24,8 @@ fn Main() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -42,6 +34,15 @@ fn Main() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] { // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon index 87eb8934e50e..c440e05a6f4d 100644 --- a/toolchain/check/testdata/struct/fail_access_into_invalid.carbon +++ b/toolchain/check/testdata/struct/fail_access_into_invalid.carbon @@ -22,13 +22,8 @@ fn F() { a.b; } // CHECK:STDOUT: %F: %F.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -37,6 +32,14 @@ fn F() { a.b; } // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_assign_empty.carbon b/toolchain/check/testdata/struct/fail_assign_empty.carbon index 387240707632..6e31d3923ea5 100644 --- a/toolchain/check/testdata/struct/fail_assign_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_empty.carbon @@ -24,16 +24,8 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -42,6 +34,15 @@ var x: {.a: i32} = {}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32, %.loc14_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon index 4ea814e8761a..7953534edf5f 100644 --- a/toolchain/check/testdata/struct/fail_assign_to_empty.carbon +++ b/toolchain/check/testdata/struct/fail_assign_to_empty.carbon @@ -22,13 +22,8 @@ var x: {} = {.a = 1}; // CHECK:STDOUT: %.4: type = struct_type {.a: i32} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -37,6 +32,14 @@ var x: {} = {.a = 1}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc14_9.1: %.1 = struct_literal () // CHECK:STDOUT: %.loc14_9.2: type = converted %.loc14_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %x.var: ref %.1 = var x diff --git a/toolchain/check/testdata/struct/fail_duplicate_name.carbon b/toolchain/check/testdata/struct/fail_duplicate_name.carbon index 1f99dff6409f..b7e4d7b2c64f 100644 --- a/toolchain/check/testdata/struct/fail_duplicate_name.carbon +++ b/toolchain/check/testdata/struct/fail_duplicate_name.carbon @@ -70,30 +70,8 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .v = @__global_init.%v -// CHECK:STDOUT: .w = @__global_init.%w -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -102,6 +80,19 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .v = @__global_init.%v +// CHECK:STDOUT: .w = @__global_init.%w +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc18_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc18_16.1: type = value_of_initializer %int.make_type_32.loc18_16 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon index a79de7f67ab3..09e9c5c6723c 100644 --- a/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_name_mismatch.carbon @@ -31,18 +31,8 @@ var y: {.b: i32} = x; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,6 +41,16 @@ var y: {.b: i32} = x; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc15_13.1: type = value_of_initializer %int.make_type_32.loc15 [template = i32] // CHECK:STDOUT: %.loc15_13.2: type = converted %int.make_type_32.loc15, %.loc15_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon index 925af218ba3f..003170422d3a 100644 --- a/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon +++ b/toolchain/check/testdata/struct/fail_field_type_mismatch.carbon @@ -25,16 +25,8 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +35,15 @@ var x: {.a: i32} = {.b = 1.0}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32, %.loc14_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_member_access_type.carbon b/toolchain/check/testdata/struct/fail_member_access_type.carbon index 0ef92055bdd7..649febb48108 100644 --- a/toolchain/check/testdata/struct/fail_member_access_type.carbon +++ b/toolchain/check/testdata/struct/fail_member_access_type.carbon @@ -29,18 +29,9 @@ var y: i32 = x.b; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -49,6 +40,17 @@ var y: i32 = x.b; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc11_13.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc11_13.1) [template = f64] // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %float.make_type [template = f64] diff --git a/toolchain/check/testdata/struct/fail_member_of_function.carbon b/toolchain/check/testdata/struct/fail_member_of_function.carbon index 6d4d562a5dea..d1360d4c3b59 100644 --- a/toolchain/check/testdata/struct/fail_member_of_function.carbon +++ b/toolchain/check/testdata/struct/fail_member_of_function.carbon @@ -23,13 +23,8 @@ fn A() { // CHECK:STDOUT: %A: %A.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .A = %A.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -38,6 +33,14 @@ fn A() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .A = %A.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/struct/fail_non_member_access.carbon b/toolchain/check/testdata/struct/fail_non_member_access.carbon index 2375841f5b6e..18fc71284c1e 100644 --- a/toolchain/check/testdata/struct/fail_non_member_access.carbon +++ b/toolchain/check/testdata/struct/fail_non_member_access.carbon @@ -26,18 +26,8 @@ var y: i32 = x.b; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +36,16 @@ var y: i32 = x.b; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11, %.loc11_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_too_few_values.carbon b/toolchain/check/testdata/struct/fail_too_few_values.carbon index 5500bcfea5ca..fb10f1692e51 100644 --- a/toolchain/check/testdata/struct/fail_too_few_values.carbon +++ b/toolchain/check/testdata/struct/fail_too_few_values.carbon @@ -26,17 +26,8 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -45,6 +36,15 @@ var x: {.a: i32, .b: i32} = {.a = 1}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc14_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32.loc14_13 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32.loc14_13, %.loc14_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_type_assign.carbon b/toolchain/check/testdata/struct/fail_type_assign.carbon index ff75290f7e1f..0fbdda90ecc0 100644 --- a/toolchain/check/testdata/struct/fail_type_assign.carbon +++ b/toolchain/check/testdata/struct/fail_type_assign.carbon @@ -23,17 +23,8 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -42,6 +33,15 @@ var x: {.a: i32} = {.a: i32}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_13.1: type = value_of_initializer %int.make_type_32 [template = i32] // CHECK:STDOUT: %.loc14_13.2: type = converted %int.make_type_32, %.loc14_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/fail_value_as_type.carbon b/toolchain/check/testdata/struct/fail_value_as_type.carbon index dc67017a12a1..af6b2b5b14e4 100644 --- a/toolchain/check/testdata/struct/fail_value_as_type.carbon +++ b/toolchain/check/testdata/struct/fail_value_as_type.carbon @@ -20,13 +20,8 @@ var x: {.a = 1}; // CHECK:STDOUT: %.2: type = struct_type {.a: i32} [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -35,6 +30,14 @@ var x: {.a = 1}; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc14_14: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc14_15: %.2 = struct_literal (%.loc14_14) // CHECK:STDOUT: %x.var: ref = var x diff --git a/toolchain/check/testdata/struct/import.carbon b/toolchain/check/testdata/struct/import.carbon index ab11a86bce47..bd37ed8dad9e 100644 --- a/toolchain/check/testdata/struct/import.carbon +++ b/toolchain/check/testdata/struct/import.carbon @@ -85,24 +85,8 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a_ref = %a_ref -// CHECK:STDOUT: .b_ref = %b_ref -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -111,6 +95,18 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a_ref = %a_ref +// CHECK:STDOUT: .b_ref = %b_ref +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_17.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_17.2: type = converted %int.make_type_32.loc4, %.loc4_17.1 [template = i32] @@ -228,7 +224,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %.10: type = struct_type {} [template] // CHECK:STDOUT: %.11: type = struct_type {.a: i32, .b: i32} [template] -// CHECK:STDOUT: %S: %.11 = bind_symbolic_name S 0, .inst+103 [symbolic] +// CHECK:STDOUT: %S: %.11 = bind_symbolic_name S 0, .inst+100 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, invalid(%S) [symbolic] // CHECK:STDOUT: %.12: i32 = int_literal 1 [template] // CHECK:STDOUT: %.13: i32 = int_literal 2 [template] @@ -242,31 +238,11 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: ref %.2 = import_ref Implicit//default, inst+17, loaded -// CHECK:STDOUT: %import_ref.2: ref %.6 = import_ref Implicit//default, inst+60, loaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+104, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+127, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9 = import_ref Implicit//default, inst+108, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = imports.%import_ref.1 -// CHECK:STDOUT: .b_ref = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .F = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2: ref %.6 = import_ref Implicit//default, inst+57, loaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+99, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+122, loaded [template = constants.%F] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -275,6 +251,24 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+103, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_13.1: type = value_of_initializer %int.make_type_32.loc4 [template = i32] // CHECK:STDOUT: %.loc4_13.2: type = converted %int.make_type_32.loc4, %.loc4_13.1 [template = i32] @@ -311,7 +305,7 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.9 +// CHECK:STDOUT: .Self = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -383,25 +377,10 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+60, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+104, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+127, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+108, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = imports.%import_ref.1 -// CHECK:STDOUT: .b_ref = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .F = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .c_bad = %c_bad -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+99, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+122, loaded [template = constants.%F] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -410,6 +389,21 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+103, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .c_bad = %c_bad +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] // CHECK:STDOUT: %.loc13_20: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc13_28: i32 = int_literal 2 [template = constants.%.5] @@ -467,25 +461,10 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+60, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+104, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+127, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+108, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = imports.%import_ref.1 -// CHECK:STDOUT: .b_ref = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .F = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .c_bad = %c_bad -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+99, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+122, loaded [template = constants.%F] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -494,6 +473,21 @@ var c_bad: C({.a = 3, .b = 4}) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+103, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .c_bad = %c_bad +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] // CHECK:STDOUT: %.loc6_20: i32 = int_literal 3 [template = constants.%.4] // CHECK:STDOUT: %.loc6_28: i32 = int_literal 4 [template = constants.%.5] diff --git a/toolchain/check/testdata/struct/literal_member_access.carbon b/toolchain/check/testdata/struct/literal_member_access.carbon index beb5dd5cbca3..686c9fcad72c 100644 --- a/toolchain/check/testdata/struct/literal_member_access.carbon +++ b/toolchain/check/testdata/struct/literal_member_access.carbon @@ -34,20 +34,8 @@ fn F() -> i32 { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -56,6 +44,16 @@ fn F() -> i32 { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { // CHECK:STDOUT: %int.make_type_32.loc11_16: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_16.1: type = value_of_initializer %int.make_type_32.loc11_16 [template = i32] diff --git a/toolchain/check/testdata/struct/member_access.carbon b/toolchain/check/testdata/struct/member_access.carbon index bc4c607ac9ff..4bfbef9eed94 100644 --- a/toolchain/check/testdata/struct/member_access.carbon +++ b/toolchain/check/testdata/struct/member_access.carbon @@ -29,21 +29,9 @@ var z: i32 = y; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: .z = %z -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Float = %import_ref.1 +// CHECK:STDOUT: .Int32 = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -52,6 +40,18 @@ var z: i32 = y; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: .z = %z +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc11_13.1: i32 = int_literal 64 [template = constants.%.1] // CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%.loc11_13.1) [template = f64] // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %float.make_type [template = f64] diff --git a/toolchain/check/testdata/struct/nested_struct_in_place.carbon b/toolchain/check/testdata/struct/nested_struct_in_place.carbon index e91b7158c616..f39ef0727595 100644 --- a/toolchain/check/testdata/struct/nested_struct_in_place.carbon +++ b/toolchain/check/testdata/struct/nested_struct_in_place.carbon @@ -33,25 +33,8 @@ fn G() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -60,6 +43,16 @@ fn G() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/struct/one_entry.carbon b/toolchain/check/testdata/struct/one_entry.carbon index 6304a6d36931..ddd10ffd6efd 100644 --- a/toolchain/check/testdata/struct/one_entry.carbon +++ b/toolchain/check/testdata/struct/one_entry.carbon @@ -23,18 +23,8 @@ var y: {.a: i32} = x; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +33,16 @@ var y: {.a: i32} = x; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] // CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11, %.loc11_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/reorder_fields.carbon b/toolchain/check/testdata/struct/reorder_fields.carbon index 6b1cb314e5ac..a8f48749d9b5 100644 --- a/toolchain/check/testdata/struct/reorder_fields.carbon +++ b/toolchain/check/testdata/struct/reorder_fields.carbon @@ -39,25 +39,9 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.7: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .MakeI32 = %MakeI32.decl -// CHECK:STDOUT: .MakeF64 = %MakeF64.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.1 +// CHECK:STDOUT: .Float = %import_ref.2 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -66,6 +50,18 @@ fn F() -> {.a: i32, .b: f64} { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.2: %Float.type = import_ref Core//prelude/types, inst+32, loaded [template = constants.%Float] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .MakeI32 = %MakeI32.decl +// CHECK:STDOUT: .MakeF64 = %MakeF64.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %MakeI32.decl: %MakeI32.type = fn_decl @MakeI32 [template = constants.%MakeI32] { // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/struct/tuple_as_element.carbon b/toolchain/check/testdata/struct/tuple_as_element.carbon index c42daf50bfe3..92d9d45d1c14 100644 --- a/toolchain/check/testdata/struct/tuple_as_element.carbon +++ b/toolchain/check/testdata/struct/tuple_as_element.carbon @@ -28,20 +28,8 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -50,6 +38,16 @@ var y: {.a: i32, .b: (i32,)} = x; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11_13 [template = i32] // CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11_13, %.loc11_13.1 [template = i32] diff --git a/toolchain/check/testdata/struct/two_entries.carbon b/toolchain/check/testdata/struct/two_entries.carbon index 6bb2fd5072a1..ef19437c9167 100644 --- a/toolchain/check/testdata/struct/two_entries.carbon +++ b/toolchain/check/testdata/struct/two_entries.carbon @@ -28,26 +28,8 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .v = @__global_init.%v -// CHECK:STDOUT: .w = @__global_init.%w -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -56,6 +38,18 @@ var y: {.a: i32, .b: i32} = x; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .v = @__global_init.%v +// CHECK:STDOUT: .w = @__global_init.%w +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_13: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %int.make_type_32.loc11_13 [template = i32] // CHECK:STDOUT: %.loc11_13.2: type = converted %int.make_type_32.loc11_13, %.loc11_13.1 [template = i32] diff --git a/toolchain/check/testdata/tuples/fail_assign_nested.carbon b/toolchain/check/testdata/tuples/fail_assign_nested.carbon index 2a3bb2d00f2e..8d3349150b13 100644 --- a/toolchain/check/testdata/tuples/fail_assign_nested.carbon +++ b/toolchain/check/testdata/tuples/fail_assign_nested.carbon @@ -37,19 +37,8 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -58,6 +47,15 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6)); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc14_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc14_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_18: %.2 = tuple_literal (%int.make_type_32.loc14_10, %int.make_type_32.loc14_15) diff --git a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon index e7dba142c65f..d970315ef8d7 100644 --- a/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon +++ b/toolchain/check/testdata/tuples/fail_element_type_mismatch.carbon @@ -28,17 +28,8 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -47,6 +38,15 @@ var x: (i32, i32) = (2, 65.89); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc14_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_17.1: %.2 = tuple_literal (%int.make_type_32.loc14_9, %int.make_type_32.loc14_14) diff --git a/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon b/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon index 69f62d45840c..5f7cfe6fe62e 100644 --- a/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/tuples/fail_nested_incomplete.carbon @@ -34,18 +34,8 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Incomplete = %Incomplete.decl -// CHECK:STDOUT: .t = %t -// CHECK:STDOUT: .p = %p -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -54,6 +44,17 @@ var p: Incomplete* = &t[1]; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Incomplete = %Incomplete.decl +// CHECK:STDOUT: .t = %t +// CHECK:STDOUT: .p = %p +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %Incomplete.ref.loc19: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete] diff --git a/toolchain/check/testdata/tuples/fail_too_few_element.carbon b/toolchain/check/testdata/tuples/fail_too_few_element.carbon index 3e4b368844a7..34c11630c221 100644 --- a/toolchain/check/testdata/tuples/fail_too_few_element.carbon +++ b/toolchain/check/testdata/tuples/fail_too_few_element.carbon @@ -27,17 +27,8 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -46,6 +37,15 @@ var x: (i32, i32) = (2, ); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc14_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc14_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_17.1: %.2 = tuple_literal (%int.make_type_32.loc14_9, %int.make_type_32.loc14_14) diff --git a/toolchain/check/testdata/tuples/fail_type_assign.carbon b/toolchain/check/testdata/tuples/fail_type_assign.carbon index c9c34332b2e1..c5cce186534e 100644 --- a/toolchain/check/testdata/tuples/fail_type_assign.carbon +++ b/toolchain/check/testdata/tuples/fail_type_assign.carbon @@ -24,17 +24,8 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -43,6 +34,15 @@ var x: (i32, ) = (i32, ); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc14_14.1: %.2 = tuple_literal (%int.make_type_32) // CHECK:STDOUT: %.loc14_14.2: type = value_of_initializer %int.make_type_32 [template = i32] diff --git a/toolchain/check/testdata/tuples/fail_value_as_type.carbon b/toolchain/check/testdata/tuples/fail_value_as_type.carbon index d1c7c1ac2779..ab18061107f7 100644 --- a/toolchain/check/testdata/tuples/fail_value_as_type.carbon +++ b/toolchain/check/testdata/tuples/fail_value_as_type.carbon @@ -20,13 +20,8 @@ var x: (1, ); // CHECK:STDOUT: %.2: type = tuple_type (i32) [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -35,6 +30,14 @@ var x: (1, ); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc14_9: i32 = int_literal 1 [template = constants.%.1] // CHECK:STDOUT: %.loc14_12: %.2 = tuple_literal (%.loc14_9) // CHECK:STDOUT: %x.var: ref = var x diff --git a/toolchain/check/testdata/tuples/import.carbon b/toolchain/check/testdata/tuples/import.carbon index a45e616b30d8..44427af86b49 100644 --- a/toolchain/check/testdata/tuples/import.carbon +++ b/toolchain/check/testdata/tuples/import.carbon @@ -90,25 +90,8 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a_ref = %a_ref -// CHECK:STDOUT: .b_ref = %b_ref -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -117,6 +100,18 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a_ref = %a_ref +// CHECK:STDOUT: .b_ref = %b_ref +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_17.1: %.2 = tuple_literal (%int.make_type_32.loc4) // CHECK:STDOUT: %.loc4_17.2: type = value_of_initializer %int.make_type_32.loc4 [template = i32] @@ -253,7 +248,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: %C.type: type = generic_class_type @C [template] // CHECK:STDOUT: %C.1: %C.type = struct_value () [template] // CHECK:STDOUT: %.14: type = struct_type {} [template] -// CHECK:STDOUT: %X: %.8 = bind_symbolic_name X 0, .inst+105 [symbolic] +// CHECK:STDOUT: %X: %.8 = bind_symbolic_name X 0, .inst+101 [symbolic] // CHECK:STDOUT: %C.2: type = class_type @C, invalid(%X) [symbolic] // CHECK:STDOUT: %.15: i32 = int_literal 1 [template] // CHECK:STDOUT: %.16: i32 = int_literal 2 [template] @@ -266,32 +261,11 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1: ref %.3 = import_ref Implicit//default, inst+17, loaded -// CHECK:STDOUT: %import_ref.2: ref %.9 = import_ref Implicit//default, inst+61, loaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+109, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+127, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10 = import_ref Implicit//default, inst+113, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = imports.%import_ref.1 -// CHECK:STDOUT: .b_ref = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .F = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .a = %a -// CHECK:STDOUT: .b = %b -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2: ref %.9 = import_ref Implicit//default, inst+57, loaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+103, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+121, loaded [template = constants.%F] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref.5 // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -300,6 +274,24 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: %import_ref.6 = import_ref Implicit//default, inst+107, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .a = %a +// CHECK:STDOUT: .b = %b +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc4: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc4_13.1: %.2 = tuple_literal (%int.make_type_32.loc4) // CHECK:STDOUT: %.loc4_13.2: type = value_of_initializer %int.make_type_32.loc4 [template = i32] @@ -344,7 +336,7 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: class @C { // CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%import_ref.10 +// CHECK:STDOUT: .Self = imports.%import_ref.6 // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32"; @@ -425,25 +417,10 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+61, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+109, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+127, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+113, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = imports.%import_ref.1 -// CHECK:STDOUT: .b_ref = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .F = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .c_bad = %c_bad -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+103, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+121, loaded [template = constants.%F] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -452,6 +429,21 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+107, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .c_bad = %c_bad +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] // CHECK:STDOUT: %.loc14_15: i32 = int_literal 1 [template = constants.%.4] // CHECK:STDOUT: %.loc14_18: i32 = int_literal 2 [template = constants.%.5] @@ -510,25 +502,10 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %import_ref.1 = import_ref Implicit//default, inst+17, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+61, unloaded -// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+109, loaded [template = constants.%C.1] -// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+127, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+113, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .a_ref = imports.%import_ref.1 -// CHECK:STDOUT: .b_ref = imports.%import_ref.2 -// CHECK:STDOUT: .C = imports.%import_ref.3 -// CHECK:STDOUT: .F = imports.%import_ref.4 -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .c_bad = %c_bad -// CHECK:STDOUT: } -// CHECK:STDOUT: %Implicit.import = import Implicit -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %import_ref.2 = import_ref Implicit//default, inst+57, unloaded +// CHECK:STDOUT: %import_ref.3: %C.type = import_ref Implicit//default, inst+103, loaded [template = constants.%C.1] +// CHECK:STDOUT: %import_ref.4: %F.type = import_ref Implicit//default, inst+121, loaded [template = constants.%F] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -537,6 +514,21 @@ var c_bad: C((3, 4)) = F(); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref.5 = import_ref Implicit//default, inst+107, unloaded +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .a_ref = imports.%import_ref.1 +// CHECK:STDOUT: .b_ref = imports.%import_ref.2 +// CHECK:STDOUT: .C = imports.%import_ref.3 +// CHECK:STDOUT: .F = imports.%import_ref.4 +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .c_bad = %c_bad +// CHECK:STDOUT: } +// CHECK:STDOUT: %Implicit.import = import Implicit +// CHECK:STDOUT: %default.import = import +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.3 [template = constants.%C.1] // CHECK:STDOUT: %.loc7_15: i32 = int_literal 3 [template = constants.%.4] // CHECK:STDOUT: %.loc7_18: i32 = int_literal 4 [template = constants.%.5] diff --git a/toolchain/check/testdata/tuples/nested_tuple.carbon b/toolchain/check/testdata/tuples/nested_tuple.carbon index e727cc497c43..f7217da82ffa 100644 --- a/toolchain/check/testdata/tuples/nested_tuple.carbon +++ b/toolchain/check/testdata/tuples/nested_tuple.carbon @@ -31,18 +31,8 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -51,6 +41,15 @@ var x: ((i32, i32), i32) = ((12, 76), 6); // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_10: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_15: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_18: %.2 = tuple_literal (%int.make_type_32.loc11_10, %int.make_type_32.loc11_15) diff --git a/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon b/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon index 9c052888fda1..b71074e59c73 100644 --- a/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon +++ b/toolchain/check/testdata/tuples/nested_tuple_in_place.carbon @@ -46,31 +46,8 @@ fn H() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.9: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.10: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.11: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.12: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.13: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.14: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .H = %H.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -79,6 +56,17 @@ fn H() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .H = %H.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %int.make_type_32.loc11_12: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_17: init type = call constants.%Int32() [template = i32] diff --git a/toolchain/check/testdata/tuples/one_element.carbon b/toolchain/check/testdata/tuples/one_element.carbon index 57c6741b5d33..ab0f0a1702d8 100644 --- a/toolchain/check/testdata/tuples/one_element.carbon +++ b/toolchain/check/testdata/tuples/one_element.carbon @@ -24,18 +24,8 @@ var y: (i32,) = x; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -44,6 +34,16 @@ var y: (i32,) = x; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_13.1: %.2 = tuple_literal (%int.make_type_32.loc11) // CHECK:STDOUT: %.loc11_13.2: type = value_of_initializer %int.make_type_32.loc11 [template = i32] diff --git a/toolchain/check/testdata/tuples/two_elements.carbon b/toolchain/check/testdata/tuples/two_elements.carbon index 8cf1b7f86274..4e8fc2b6ad0b 100644 --- a/toolchain/check/testdata/tuples/two_elements.carbon +++ b/toolchain/check/testdata/tuples/two_elements.carbon @@ -29,26 +29,8 @@ var y: (i32, i32) = x; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.2: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.3: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.4: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.5: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.6: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.7: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: %import_ref.8: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .v = @__global_init.%v -// CHECK:STDOUT: .w = @__global_init.%w -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Int32 = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -57,6 +39,18 @@ var y: (i32, i32) = x; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Int32.type = import_ref Core//prelude/types, inst+4, loaded [template = constants.%Int32] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .v = @__global_init.%v +// CHECK:STDOUT: .w = @__global_init.%w +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %int.make_type_32.loc11_9: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %int.make_type_32.loc11_14: init type = call constants.%Int32() [template = i32] // CHECK:STDOUT: %.loc11_17.1: %.2 = tuple_literal (%int.make_type_32.loc11_9, %int.make_type_32.loc11_14) diff --git a/toolchain/check/testdata/var/fail_not_copyable.carbon b/toolchain/check/testdata/var/fail_not_copyable.carbon index 51d7213bdb3b..c75be8106810 100644 --- a/toolchain/check/testdata/var/fail_not_copyable.carbon +++ b/toolchain/check/testdata/var/fail_not_copyable.carbon @@ -40,14 +40,8 @@ fn F(x: X) { // CHECK:STDOUT: %.5: String = string_literal "hello" [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .X = %X.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -56,6 +50,15 @@ fn F(x: X) { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .X = %X.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %X.decl: type = class_decl @X [template = constants.%X] {} // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { // CHECK:STDOUT: %X.ref: type = name_ref X, %X.decl [template = constants.%X] diff --git a/toolchain/check/testdata/var/fail_storage_is_literal.carbon b/toolchain/check/testdata/var/fail_storage_is_literal.carbon index 58e66f36cc15..2cbf5b2528f1 100644 --- a/toolchain/check/testdata/var/fail_storage_is_literal.carbon +++ b/toolchain/check/testdata/var/fail_storage_is_literal.carbon @@ -24,13 +24,8 @@ fn Main() { // CHECK:STDOUT: %.2: i32 = int_literal 1 [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Main = %Main.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -39,6 +34,14 @@ fn Main() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Main = %Main.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon index a4230c73a112..a236905c7682 100644 --- a/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon +++ b/toolchain/check/testdata/var/fail_todo_control_flow_init.carbon @@ -67,20 +67,8 @@ var y2: bool = false or true; // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: .x2 = %x2 -// CHECK:STDOUT: .y = %y -// CHECK:STDOUT: .y2 = %y2 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -89,6 +77,18 @@ var y2: bool = false or true; // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .x2 = %x2 +// CHECK:STDOUT: .y = %y +// CHECK:STDOUT: .y2 = %y2 +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %.loc23_9.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc23_9.2: type = converted %.loc23_9.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %x.var: ref %.1 = var x diff --git a/toolchain/check/testdata/var/no_prelude/import_access.carbon b/toolchain/check/testdata/var/no_prelude/import_access.carbon index 3526d161063d..714b3ab43027 100644 --- a/toolchain/check/testdata/var/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/var/no_prelude/import_access.carbon @@ -140,15 +140,18 @@ var v2: () = Test.v; // CHECK:STDOUT: %.1: type = tuple_type () [template] // CHECK:STDOUT: } // CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Test: = namespace file.%Test.import, [template] { +// CHECK:STDOUT: import Test//def +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Test = %Test +// CHECK:STDOUT: .Test = imports.%Test // CHECK:STDOUT: .v2 = %v2 // CHECK:STDOUT: } // CHECK:STDOUT: %Test.import = import Test -// CHECK:STDOUT: %Test: = namespace %Test.import, [template] { -// CHECK:STDOUT: import Test//def -// CHECK:STDOUT: } // CHECK:STDOUT: %.loc9_10.1: %.1 = tuple_literal () // CHECK:STDOUT: %.loc9_10.2: type = converted %.loc9_10.1, constants.%.1 [template = constants.%.1] // CHECK:STDOUT: %v2.var: ref %.1 = var v2 @@ -157,7 +160,7 @@ var v2: () = Test.v; // CHECK:STDOUT: // CHECK:STDOUT: fn @__global_init() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Test.ref: = name_ref Test, file.%Test [template = file.%Test] +// CHECK:STDOUT: %Test.ref: = name_ref Test, imports.%Test [template = imports.%Test] // CHECK:STDOUT: %v.ref: = name_ref v, [template = ] // CHECK:STDOUT: assign file.%v2.var, // CHECK:STDOUT: return diff --git a/toolchain/check/testdata/while/break_continue.carbon b/toolchain/check/testdata/while/break_continue.carbon index 370f7f5a8387..753362b55993 100644 --- a/toolchain/check/testdata/while/break_continue.carbon +++ b/toolchain/check/testdata/while/break_continue.carbon @@ -57,19 +57,22 @@ fn While() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.2: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.3: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.4: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.5: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.6: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.7: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: %import_ref.8: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/operators +// CHECK:STDOUT: import Core//prelude/types +// CHECK:STDOUT: import Core//prelude/operators/arithmetic +// CHECK:STDOUT: import Core//prelude/operators/bitwise +// CHECK:STDOUT: import Core//prelude/operators/comparison +// CHECK:STDOUT: import Core//prelude/types/bool +// CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core +// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .A = %A.decl // CHECK:STDOUT: .B = %B.decl // CHECK:STDOUT: .C = %C.decl @@ -81,15 +84,6 @@ fn While() { // CHECK:STDOUT: .While = %While.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/operators -// CHECK:STDOUT: import Core//prelude/types -// CHECK:STDOUT: import Core//prelude/operators/arithmetic -// CHECK:STDOUT: import Core//prelude/operators/bitwise -// CHECK:STDOUT: import Core//prelude/operators/comparison -// CHECK:STDOUT: import Core//prelude/types/bool -// CHECK:STDOUT: } // CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] { // CHECK:STDOUT: %bool.make_type.loc11: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type.loc11 [template = bool] diff --git a/toolchain/check/testdata/while/fail_bad_condition.carbon b/toolchain/check/testdata/while/fail_bad_condition.carbon index 6b1cf81bf1f9..1d4307aa95ed 100644 --- a/toolchain/check/testdata/while/fail_bad_condition.carbon +++ b/toolchain/check/testdata/while/fail_bad_condition.carbon @@ -25,13 +25,8 @@ fn While() { // CHECK:STDOUT: %.3: String = string_literal "Hello" [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .While = %While.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -40,6 +35,14 @@ fn While() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .While = %While.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/while/fail_break_continue.carbon b/toolchain/check/testdata/while/fail_break_continue.carbon index 6e54d9581254..28f34b121017 100644 --- a/toolchain/check/testdata/while/fail_break_continue.carbon +++ b/toolchain/check/testdata/while/fail_break_continue.carbon @@ -43,13 +43,8 @@ fn While() { // CHECK:STDOUT: %.2: bool = bool_literal false [template] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .While = %While.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -58,6 +53,14 @@ fn While() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .While = %While.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %While.decl: %While.type = fn_decl @While [template = constants.%While] {} // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/while/unreachable_end.carbon b/toolchain/check/testdata/while/unreachable_end.carbon index 6c697048aa32..fa97597b962b 100644 --- a/toolchain/check/testdata/while/unreachable_end.carbon +++ b/toolchain/check/testdata/while/unreachable_end.carbon @@ -42,20 +42,8 @@ fn While() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Cond = %Cond.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .H = %H.decl -// CHECK:STDOUT: .While = %While.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -64,6 +52,19 @@ fn While() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Cond = %Cond.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .H = %H.decl +// CHECK:STDOUT: .While = %While.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Cond.decl: %Cond.type = fn_decl @Cond [template = constants.%Cond] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %bool.make_type [template = bool] diff --git a/toolchain/check/testdata/while/while.carbon b/toolchain/check/testdata/while/while.carbon index 518675490873..1981a1f3a95c 100644 --- a/toolchain/check/testdata/while/while.carbon +++ b/toolchain/check/testdata/while/while.carbon @@ -41,20 +41,8 @@ fn While() { // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = %Core -// CHECK:STDOUT: .Cond = %Cond.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .H = %H.decl -// CHECK:STDOUT: .While = %While.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Core: = namespace %Core.import, [template] { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { +// CHECK:STDOUT: .Bool = %import_ref // CHECK:STDOUT: import Core//prelude // CHECK:STDOUT: import Core//prelude/operators // CHECK:STDOUT: import Core//prelude/types @@ -63,6 +51,19 @@ fn While() { // CHECK:STDOUT: import Core//prelude/operators/comparison // CHECK:STDOUT: import Core//prelude/types/bool // CHECK:STDOUT: } +// CHECK:STDOUT: %import_ref: %Bool.type = import_ref Core//prelude/types/bool, inst+2, loaded [template = constants.%Bool] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [template] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .Cond = %Cond.decl +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: .G = %G.decl +// CHECK:STDOUT: .H = %H.decl +// CHECK:STDOUT: .While = %While.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Cond.decl: %Cond.type = fn_decl @Cond [template = constants.%Cond] { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] // CHECK:STDOUT: %.loc11_14.1: type = value_of_initializer %bool.make_type [template = bool]