| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952 |
- // 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
- //
- // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
- // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
- // EXTRA-ARGS: --dump-sem-ir-ranges=if-present
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/cross_package_export.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/cross_package_export.carbon
- // ============================================================================
- // Setup files
- // ============================================================================
- // --- base.carbon
- package Other library "[[@TEST_NAME]]";
- class C {
- var x: ();
- };
- // --- conflict.carbon
- package Other library "[[@TEST_NAME]]";
- fn C() {}
- // --- export_import.carbon
- package Other library "[[@TEST_NAME]]";
- export import library "base";
- // --- export_import_copy.carbon
- package Other library "[[@TEST_NAME]]";
- export import library "base";
- // --- export_import_indirect.carbon
- package Other library "[[@TEST_NAME]]";
- export import library "export_import";
- // --- export_name.carbon
- package Other library "[[@TEST_NAME]]";
- import library "base";
- export C;
- // --- export_name_copy.carbon
- package Other library "[[@TEST_NAME]]";
- import library "base";
- export C;
- // --- export_name_indirect.carbon
- package Other library "[[@TEST_NAME]]";
- import library "export_name";
- export C;
- // ============================================================================
- // Test files
- // ============================================================================
- // --- use_export_import.carbon
- library "[[@TEST_NAME]]";
- import Other library "export_import";
- var c: Other.C = {.x = ()};
- // --- use_export_import_with_copy.carbon
- library "[[@TEST_NAME]]";
- import Other library "export_import";
- import Other library "export_import_copy";
- var c: Other.C = {.x = ()};
- // --- use_export_import_indirect.carbon
- library "[[@TEST_NAME]]";
- import Other library "export_import_indirect";
- var c: Other.C = {.x = ()};
- // --- use_export_name.carbon
- library "[[@TEST_NAME]]";
- import Other library "export_name";
- var c: Other.C = {.x = ()};
- // --- use_export_name_with_copy.carbon
- library "[[@TEST_NAME]]";
- import Other library "export_name";
- import Other library "export_name_copy";
- var c: Other.C = {.x = ()};
- // --- use_export_name_indirect.carbon
- library "[[@TEST_NAME]]";
- import Other library "export_name_indirect";
- var c: Other.C = {.x = ()};
- // --- use_export_all.carbon
- library "[[@TEST_NAME]]";
- import Other library "export_import";
- import Other library "export_name";
- import Other library "export_import_copy";
- import Other library "export_name_copy";
- import Other library "export_import_indirect";
- import Other library "export_name_indirect";
- var c: Other.C = {.x = ()};
- // --- unused_conflict_on_export_import.carbon
- library "[[@TEST_NAME]]";
- import Other library "export_import";
- import Other library "conflict";
- // --- unused_conflict_on_export_name.carbon
- library "[[@TEST_NAME]]";
- import Other library "export_name";
- import Other library "conflict";
- // --- fail_conflict_on_export_import.carbon
- library "[[@TEST_NAME]]";
- // CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+8]]:1: in import [InImport]
- // CHECK:STDERR: base.carbon:4:1: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
- // CHECK:STDERR: class C {
- // CHECK:STDERR: ^~~~~~~~~
- // CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+4]]:1: in import [InImport]
- // CHECK:STDERR: conflict.carbon:4:1: note: name is previously declared here [NameDeclPrevious]
- // CHECK:STDERR: fn C() {}
- // CHECK:STDERR: ^~~~~~~~
- import Other library "export_import";
- import Other library "conflict";
- // CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+4]]:11: note: in name lookup for `C` [InNameLookup]
- // CHECK:STDERR: alias C = Other.C;
- // CHECK:STDERR: ^~~~~~~
- // CHECK:STDERR:
- alias C = Other.C;
- // --- fail_conflict_on_export_name.carbon
- library "[[@TEST_NAME]]";
- // CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+9]]:1: in import [InImport]
- // CHECK:STDERR: conflict.carbon:4:1: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
- // CHECK:STDERR: fn C() {}
- // CHECK:STDERR: ^~~~~~~~
- // CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+5]]:1: in import [InImport]
- // CHECK:STDERR: export_name.carbon:4:1: in import [InImport]
- // CHECK:STDERR: base.carbon:4:1: note: name is previously declared here [NameDeclPrevious]
- // CHECK:STDERR: class C {
- // CHECK:STDERR: ^~~~~~~~~
- import Other library "export_name";
- import Other library "conflict";
- // CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+4]]:11: note: in name lookup for `C` [InNameLookup]
- // CHECK:STDERR: alias C = Other.C;
- // CHECK:STDERR: ^~~~~~~
- // CHECK:STDERR:
- alias C = Other.C;
- // CHECK:STDOUT: --- base.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
- // CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %empty_tuple.type [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .C = %C.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C {
- // CHECK:STDOUT: %.loc5_11.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
- // CHECK:STDOUT: %.loc5_8: %C.elem = field_decl x, element0 [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.x [concrete = constants.%complete_type]
- // CHECK:STDOUT: complete_type_witness = %complete_type
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%C
- // CHECK:STDOUT: .x = %.loc5_8
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- conflict.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C.type: type = fn_type @C [concrete]
- // CHECK:STDOUT: %C: %C.type = struct_value () [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .C = %C.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %C.decl: %C.type = fn_decl @C [concrete = constants.%C] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @C() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- export_import.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other.C = import_ref Other//base, C, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .C = imports.%Other.C
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- export_import_copy.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other.C = import_ref Other//base, C, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .C = imports.%Other.C
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- export_import_indirect.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other.C = import_ref Other//base, C, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .C = imports.%Other.C
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- export_name.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other.C: type = import_ref Other//base, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Other.import_ref.56d: <witness> = import_ref Other//base, loc6_1, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Other.import_ref.42d = import_ref Other//base, inst{{[0-9A-F]+}} [no loc], unloaded
- // CHECK:STDOUT: %Other.import_ref.640 = import_ref Other//base, loc5_8, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .C = %C
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: %C: type = export C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "base.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Other.import_ref.56d
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Other.import_ref.42d
- // CHECK:STDOUT: .x = imports.%Other.import_ref.640
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- export_name_copy.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other.C: type = import_ref Other//base, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Other.import_ref.56d: <witness> = import_ref Other//base, loc6_1, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Other.import_ref.42d = import_ref Other//base, inst{{[0-9A-F]+}} [no loc], unloaded
- // CHECK:STDOUT: %Other.import_ref.640 = import_ref Other//base, loc5_8, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .C = %C
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: %C: type = export C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "base.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Other.import_ref.56d
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Other.import_ref.42d
- // CHECK:STDOUT: .x = imports.%Other.import_ref.640
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- export_name_indirect.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other.C: type = import_ref Other//export_name, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Other.import_ref.ad3: <witness> = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Other.import_ref.3c4 = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: %Other.import_ref.249 = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .C = %C
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %default.import = import <none>
- // CHECK:STDOUT: %C: type = export C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "export_name.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Other.import_ref.ad3
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Other.import_ref.3c4
- // CHECK:STDOUT: .x = imports.%Other.import_ref.249
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_export_import.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
- // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
- // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: %.dd7: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete]
- // CHECK:STDOUT: %C.val: %C = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other: <namespace> = namespace file.%Other.import, [concrete] {
- // CHECK:STDOUT: .C = %Other.C
- // CHECK:STDOUT: import Other//export_import
- // CHECK:STDOUT: import Other//base
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.C: type = import_ref Other//base, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Other.import_ref.56d: <witness> = import_ref Other//base, loc6_1, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Other.import_ref.42d = import_ref Other//base, inst{{[0-9A-F]+}} [no loc], unloaded
- // CHECK:STDOUT: %Other.import_ref.640 = import_ref Other//base, loc5_8, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Other = imports.%Other
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.import = import Other
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt [concrete]
- // CHECK:STDOUT: %.loc6: type = splice_block %C.ref [concrete = constants.%C] {
- // CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, imports.%Other [concrete = imports.%Other]
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var [concrete = %c.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "base.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Other.import_ref.56d
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Other.import_ref.42d
- // CHECK:STDOUT: .x = imports.%Other.import_ref.640
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc6_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.1: %struct_type.x = struct_literal (%.loc6_25.1) [concrete = constants.%struct]
- // CHECK:STDOUT: %.loc6_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7]
- // CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type to %.loc6_26.2 = tuple_init () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.3: init %empty_tuple.type = converted %.loc6_25.1, %.loc6_25.2 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.4: init %empty_tuple.type to %.loc6_26.2 = in_place_init %.loc6_26.3 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.5: init %C to file.%c.var = class_init (%.loc6_26.4) [concrete = constants.%C.val]
- // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_26.1, %.loc6_26.5 [concrete = constants.%C.val]
- // CHECK:STDOUT: assign file.%c.var, %.loc6_1
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_export_import_with_copy.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
- // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
- // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: %.dd7: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete]
- // CHECK:STDOUT: %C.val: %C = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other: <namespace> = namespace file.%Other.import, [concrete] {
- // CHECK:STDOUT: .C = %Other.C
- // CHECK:STDOUT: import Other//export_import
- // CHECK:STDOUT: import Other//export_import_copy
- // CHECK:STDOUT: import Other//base
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.C: type = import_ref Other//base, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Other.import_ref.56d: <witness> = import_ref Other//base, loc6_1, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Other.import_ref.42d = import_ref Other//base, inst{{[0-9A-F]+}} [no loc], unloaded
- // CHECK:STDOUT: %Other.import_ref.640 = import_ref Other//base, loc5_8, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Other = imports.%Other
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.import = import Other
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt [concrete]
- // CHECK:STDOUT: %.loc7: type = splice_block %C.ref [concrete = constants.%C] {
- // CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, imports.%Other [concrete = imports.%Other]
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var [concrete = %c.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "base.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Other.import_ref.56d
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Other.import_ref.42d
- // CHECK:STDOUT: .x = imports.%Other.import_ref.640
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc7_26.1: %struct_type.x = struct_literal (%.loc7_25.1) [concrete = constants.%struct]
- // CHECK:STDOUT: %.loc7_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7]
- // CHECK:STDOUT: %.loc7_25.2: init %empty_tuple.type to %.loc7_26.2 = tuple_init () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc7_26.3: init %empty_tuple.type = converted %.loc7_25.1, %.loc7_25.2 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc7_26.4: init %empty_tuple.type to %.loc7_26.2 = in_place_init %.loc7_26.3 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc7_26.5: init %C to file.%c.var = class_init (%.loc7_26.4) [concrete = constants.%C.val]
- // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_26.1, %.loc7_26.5 [concrete = constants.%C.val]
- // CHECK:STDOUT: assign file.%c.var, %.loc7_1
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_export_import_indirect.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
- // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
- // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: %.dd7: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete]
- // CHECK:STDOUT: %C.val: %C = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other: <namespace> = namespace file.%Other.import, [concrete] {
- // CHECK:STDOUT: .C = %Other.C
- // CHECK:STDOUT: import Other//export_import_indirect
- // CHECK:STDOUT: import Other//export_import
- // CHECK:STDOUT: import Other//base
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.C: type = import_ref Other//base, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Other.import_ref.56d: <witness> = import_ref Other//base, loc6_1, loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Other.import_ref.42d = import_ref Other//base, inst{{[0-9A-F]+}} [no loc], unloaded
- // CHECK:STDOUT: %Other.import_ref.640 = import_ref Other//base, loc5_8, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Other = imports.%Other
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.import = import Other
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt [concrete]
- // CHECK:STDOUT: %.loc6: type = splice_block %C.ref [concrete = constants.%C] {
- // CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, imports.%Other [concrete = imports.%Other]
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var [concrete = %c.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "base.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Other.import_ref.56d
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Other.import_ref.42d
- // CHECK:STDOUT: .x = imports.%Other.import_ref.640
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc6_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.1: %struct_type.x = struct_literal (%.loc6_25.1) [concrete = constants.%struct]
- // CHECK:STDOUT: %.loc6_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7]
- // CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type to %.loc6_26.2 = tuple_init () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.3: init %empty_tuple.type = converted %.loc6_25.1, %.loc6_25.2 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.4: init %empty_tuple.type to %.loc6_26.2 = in_place_init %.loc6_26.3 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.5: init %C to file.%c.var = class_init (%.loc6_26.4) [concrete = constants.%C.val]
- // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_26.1, %.loc6_26.5 [concrete = constants.%C.val]
- // CHECK:STDOUT: assign file.%c.var, %.loc6_1
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_export_name.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
- // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
- // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: %.dd7: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete]
- // CHECK:STDOUT: %C.val: %C = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other: <namespace> = namespace file.%Other.import, [concrete] {
- // CHECK:STDOUT: .C = %Other.C
- // CHECK:STDOUT: import Other//export_name
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.C: type = import_ref Other//export_name, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Other.import_ref.ad3: <witness> = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Other.import_ref.3c4 = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: %Other.import_ref.249 = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Other = imports.%Other
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.import = import Other
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt [concrete]
- // CHECK:STDOUT: %.loc6: type = splice_block %C.ref [concrete = constants.%C] {
- // CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, imports.%Other [concrete = imports.%Other]
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var [concrete = %c.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "export_name.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Other.import_ref.ad3
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Other.import_ref.3c4
- // CHECK:STDOUT: .x = imports.%Other.import_ref.249
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc6_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.1: %struct_type.x = struct_literal (%.loc6_25.1) [concrete = constants.%struct]
- // CHECK:STDOUT: %.loc6_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7]
- // CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type to %.loc6_26.2 = tuple_init () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.3: init %empty_tuple.type = converted %.loc6_25.1, %.loc6_25.2 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.4: init %empty_tuple.type to %.loc6_26.2 = in_place_init %.loc6_26.3 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.5: init %C to file.%c.var = class_init (%.loc6_26.4) [concrete = constants.%C.val]
- // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_26.1, %.loc6_26.5 [concrete = constants.%C.val]
- // CHECK:STDOUT: assign file.%c.var, %.loc6_1
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_export_name_with_copy.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
- // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
- // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: %.dd7: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete]
- // CHECK:STDOUT: %C.val: %C = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other: <namespace> = namespace file.%Other.import, [concrete] {
- // CHECK:STDOUT: .C = %Other.C
- // CHECK:STDOUT: import Other//export_name
- // CHECK:STDOUT: import Other//export_name_copy
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.C: type = import_ref Other//export_name, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Other.import_ref.ad3: <witness> = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Other.import_ref.3c4 = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: %Other.import_ref.249 = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Other = imports.%Other
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.import = import Other
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt [concrete]
- // CHECK:STDOUT: %.loc7: type = splice_block %C.ref [concrete = constants.%C] {
- // CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, imports.%Other [concrete = imports.%Other]
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var [concrete = %c.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "export_name.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Other.import_ref.ad3
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Other.import_ref.3c4
- // CHECK:STDOUT: .x = imports.%Other.import_ref.249
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc7_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc7_26.1: %struct_type.x = struct_literal (%.loc7_25.1) [concrete = constants.%struct]
- // CHECK:STDOUT: %.loc7_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7]
- // CHECK:STDOUT: %.loc7_25.2: init %empty_tuple.type to %.loc7_26.2 = tuple_init () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc7_26.3: init %empty_tuple.type = converted %.loc7_25.1, %.loc7_25.2 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc7_26.4: init %empty_tuple.type to %.loc7_26.2 = in_place_init %.loc7_26.3 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc7_26.5: init %C to file.%c.var = class_init (%.loc7_26.4) [concrete = constants.%C.val]
- // CHECK:STDOUT: %.loc7_1: init %C = converted %.loc7_26.1, %.loc7_26.5 [concrete = constants.%C.val]
- // CHECK:STDOUT: assign file.%c.var, %.loc7_1
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_export_name_indirect.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
- // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
- // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: %.dd7: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete]
- // CHECK:STDOUT: %C.val: %C = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other: <namespace> = namespace file.%Other.import, [concrete] {
- // CHECK:STDOUT: .C = %Other.C
- // CHECK:STDOUT: import Other//export_name_indirect
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.C: type = import_ref Other//export_name_indirect, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Other.import_ref.328: <witness> = import_ref Other//export_name_indirect, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Other.import_ref.c1f = import_ref Other//export_name_indirect, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: %Other.import_ref.3e3 = import_ref Other//export_name_indirect, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Other = imports.%Other
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.import = import Other
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt [concrete]
- // CHECK:STDOUT: %.loc6: type = splice_block %C.ref [concrete = constants.%C] {
- // CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, imports.%Other [concrete = imports.%Other]
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var [concrete = %c.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "export_name_indirect.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Other.import_ref.328
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Other.import_ref.c1f
- // CHECK:STDOUT: .x = imports.%Other.import_ref.3e3
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc6_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.1: %struct_type.x = struct_literal (%.loc6_25.1) [concrete = constants.%struct]
- // CHECK:STDOUT: %.loc6_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7]
- // CHECK:STDOUT: %.loc6_25.2: init %empty_tuple.type to %.loc6_26.2 = tuple_init () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.3: init %empty_tuple.type = converted %.loc6_25.1, %.loc6_25.2 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.4: init %empty_tuple.type to %.loc6_26.2 = in_place_init %.loc6_26.3 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc6_26.5: init %C to file.%c.var = class_init (%.loc6_26.4) [concrete = constants.%C.val]
- // CHECK:STDOUT: %.loc6_1: init %C = converted %.loc6_26.1, %.loc6_26.5 [concrete = constants.%C.val]
- // CHECK:STDOUT: assign file.%c.var, %.loc6_1
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_export_all.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: %pattern_type: type = pattern_type %C [concrete]
- // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
- // CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: %.dd7: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete]
- // CHECK:STDOUT: %C.val: %C = struct_value (%empty_tuple) [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other: <namespace> = namespace file.%Other.import, [concrete] {
- // CHECK:STDOUT: .C = %Other.C
- // CHECK:STDOUT: import Other//export_import
- // CHECK:STDOUT: import Other//export_name
- // CHECK:STDOUT: import Other//export_import_copy
- // CHECK:STDOUT: import Other//export_name_copy
- // CHECK:STDOUT: import Other//export_import_indirect
- // CHECK:STDOUT: import Other//export_name_indirect
- // CHECK:STDOUT: import Other//base
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.C: type = import_ref Other//export_name, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Other.import_ref.ad3: <witness> = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Other.import_ref.3c4 = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: %Other.import_ref.249 = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Other = imports.%Other
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.import = import Other
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
- // CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref %C = var %c.var_patt [concrete]
- // CHECK:STDOUT: %.loc11: type = splice_block %C.ref [concrete = constants.%C] {
- // CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, imports.%Other [concrete = imports.%Other]
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var [concrete = %c.var]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "export_name.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Other.import_ref.ad3
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Other.import_ref.3c4
- // CHECK:STDOUT: .x = imports.%Other.import_ref.249
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc11_25.1: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc11_26.1: %struct_type.x = struct_literal (%.loc11_25.1) [concrete = constants.%struct]
- // CHECK:STDOUT: %.loc11_26.2: ref %empty_tuple.type = class_element_access file.%c.var, element0 [concrete = constants.%.dd7]
- // CHECK:STDOUT: %.loc11_25.2: init %empty_tuple.type to %.loc11_26.2 = tuple_init () [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc11_26.3: init %empty_tuple.type = converted %.loc11_25.1, %.loc11_25.2 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc11_26.4: init %empty_tuple.type to %.loc11_26.2 = in_place_init %.loc11_26.3 [concrete = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc11_26.5: init %C to file.%c.var = class_init (%.loc11_26.4) [concrete = constants.%C.val]
- // CHECK:STDOUT: %.loc11_1: init %C = converted %.loc11_26.1, %.loc11_26.5 [concrete = constants.%C.val]
- // CHECK:STDOUT: assign file.%c.var, %.loc11_1
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- unused_conflict_on_export_import.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other: <namespace> = namespace file.%Other.import, [concrete] {
- // CHECK:STDOUT: import Other//export_import
- // CHECK:STDOUT: import Other//conflict
- // CHECK:STDOUT: import Other//base
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Other = imports.%Other
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.import = import Other
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- unused_conflict_on_export_name.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other: <namespace> = namespace file.%Other.import, [concrete] {
- // CHECK:STDOUT: import Other//export_name
- // CHECK:STDOUT: import Other//conflict
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // 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 {
- // CHECK:STDOUT: %C.type: type = fn_type @C [concrete]
- // CHECK:STDOUT: %C: %C.type = struct_value () [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other: <namespace> = namespace file.%Other.import, [concrete] {
- // CHECK:STDOUT: .C = %Other.C
- // CHECK:STDOUT: import Other//export_import
- // CHECK:STDOUT: import Other//conflict
- // CHECK:STDOUT: import Other//base
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.C: %C.type = import_ref Other//conflict, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Other = imports.%Other
- // CHECK:STDOUT: .C = %C
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.import = import Other
- // CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, imports.%Other [concrete = imports.%Other]
- // CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: %C: %C.type = alias_binding C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @C [from "conflict.carbon"];
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_conflict_on_export_name.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [concrete]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
- // CHECK:STDOUT: %struct_type.x: type = struct_type {.x: %empty_tuple.type} [concrete]
- // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.x [concrete]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Other: <namespace> = namespace file.%Other.import, [concrete] {
- // CHECK:STDOUT: .C = %Other.C
- // CHECK:STDOUT: import Other//export_name
- // CHECK:STDOUT: import Other//conflict
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.C: type = import_ref Other//export_name, C, loaded [concrete = constants.%C]
- // CHECK:STDOUT: %Other.import_ref.ad3: <witness> = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
- // CHECK:STDOUT: %Other.import_ref.3c4 = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: %Other.import_ref.249 = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
- // CHECK:STDOUT: .Other = imports.%Other
- // CHECK:STDOUT: .C = %C
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Other.import = import Other
- // CHECK:STDOUT: %Other.ref: <namespace> = name_ref Other, imports.%Other [concrete = imports.%Other]
- // CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: %C: type = alias_binding C, imports.%Other.C [concrete = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C [from "export_name.carbon"] {
- // CHECK:STDOUT: complete_type_witness = imports.%Other.import_ref.ad3
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = imports.%Other.import_ref.3c4
- // CHECK:STDOUT: .x = imports.%Other.import_ref.249
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|