| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902 |
- // 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/packages/no_prelude/export_name.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/export_name.carbon
- // ============================================================================
- // Setup files
- // ============================================================================
- // --- base.carbon
- library "base";
- class C {
- var x: ();
- };
- namespace NS;
- class NS.NSC {
- var y: ();
- };
- // --- export.carbon
- library "export";
- import library "base";
- export C;
- export NS.NSC;
- // --- not_reexporting.carbon
- library "not_reexporting";
- import library "export";
- // --- export_export.carbon
- library "export_export";
- import library "export";
- export C;
- export NS.NSC;
- // --- export_in_impl.carbon
- // This is just providing an API for the implicit import.
- library "export_in_impl";
- // ============================================================================
- // Test files
- // ============================================================================
- // --- use_export.carbon
- library "use_export";
- import library "export";
- var c: C = {.x = ()};
- var nsc: NS.NSC = {.y = ()};
- // --- export_export.impl.carbon
- impl library "export_export";
- var c: C = {.x = ()};
- var nsc: NS.NSC = {.y = ()};
- // --- use_export_export.carbon
- library "use_export_export";
- import library "export_export";
- var c: C = {.x = ()};
- var nsc: NS.NSC = {.y = ()};
- // --- fail_export_ns.carbon
- library "fail_export_ns";
- import library "base";
- // CHECK:STDERR: fail_export_ns.carbon:[[@LINE+10]]:1: ERROR: Only imported entities are valid for `export`.
- // CHECK:STDERR: export NS;
- // CHECK:STDERR: ^~~~~~~~~~
- // CHECK:STDERR: fail_export_ns.carbon:[[@LINE-5]]:1: In import.
- // CHECK:STDERR: import library "base";
- // CHECK:STDERR: ^~~~~~
- // CHECK:STDERR: base.carbon:8:1: Name is declared here.
- // CHECK:STDERR: namespace NS;
- // CHECK:STDERR: ^~~~~~~~~~~~~
- // CHECK:STDERR:
- export NS;
- // --- fail_export_decl.carbon
- library "fail_export_decl";
- class Local {}
- // CHECK:STDERR: fail_export_decl.carbon:[[@LINE+7]]:1: ERROR: Only imported entities are valid for `export`.
- // CHECK:STDERR: export Local;
- // CHECK:STDERR: ^~~~~~~~~~~~~
- // CHECK:STDERR: fail_export_decl.carbon:[[@LINE-5]]:1: Name is declared here.
- // CHECK:STDERR: class Local {}
- // CHECK:STDERR: ^~~~~~~~~~~~~
- // CHECK:STDERR:
- export Local;
- // --- fail_export_member.carbon
- library "fail_export_member";
- import library "base";
- // CHECK:STDERR: fail_export_member.carbon:[[@LINE+10]]:8: ERROR: Name qualifiers are only allowed for entities that provide a scope.
- // CHECK:STDERR: export C.x;
- // CHECK:STDERR: ^
- // CHECK:STDERR: fail_export_member.carbon:[[@LINE-5]]:1: In import.
- // CHECK:STDERR: import library "base";
- // CHECK:STDERR: ^~~~~~
- // CHECK:STDERR: base.carbon:4:1: Referenced non-scope entity declared here.
- // CHECK:STDERR: class C {
- // CHECK:STDERR: ^~~~~~~~~
- // CHECK:STDERR:
- export C.x;
- // --- import_both.carbon
- library "import_both";
- import library "base";
- import library "export";
- var c: C = {.x = ()};
- var nsc: NS.NSC = {.y = ()};
- // --- import_both_reversed.carbon
- library "import_both_reversed";
- import library "export";
- import library "base";
- var c: C = {.x = ()};
- var nsc: NS.NSC = {.y = ()};
- // --- fail_use_not_reexporting.carbon
- library "fail_use_not_reexporting";
- import library "not_reexporting";
- // CHECK:STDERR: fail_use_not_reexporting.carbon:[[@LINE+4]]:15: ERROR: Name `C` not found.
- // CHECK:STDERR: alias Local = C;
- // CHECK:STDERR: ^
- // CHECK:STDERR:
- alias Local = C;
- // CHECK:STDERR: fail_use_not_reexporting.carbon:[[@LINE+4]]:17: ERROR: Name `NS` not found.
- // CHECK:STDERR: alias NSLocal = NS.NSC;
- // CHECK:STDERR: ^~
- // CHECK:STDERR:
- alias NSLocal = NS.NSC;
- // --- repeat_export.carbon
- library "repeat_export";
- import library "base";
- export C;
- // CHECK:STDERR: repeat_export.carbon:[[@LINE+7]]:1: WARNING: `export` matches previous `export`.
- // CHECK:STDERR: export C;
- // CHECK:STDERR: ^~~~~~~~~
- // CHECK:STDERR: repeat_export.carbon:[[@LINE-4]]:1: Previous `export` here.
- // CHECK:STDERR: export C;
- // CHECK:STDERR: ^~~~~~~~~
- // CHECK:STDERR:
- export C;
- // --- use_repeat_export.carbon
- library "use_repeat_export";
- import library "repeat_export";
- var c: C = {.x = ()};
- // --- fail_modifiers.carbon
- library "fail_modifiers";
- import library "base";
- // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+3]]:1: ERROR: `private` not allowed on `export` declaration.
- // CHECK:STDERR: private export C;
- // CHECK:STDERR: ^~~~~~~
- private export C;
- // CHECK:STDOUT: --- base.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = unbound_element_type %C, %.1 [template]
- // CHECK:STDOUT: %.3: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: %NSC: type = class_type @NSC [template]
- // CHECK:STDOUT: %.4: type = unbound_element_type %NSC, %.1 [template]
- // CHECK:STDOUT: %.5: type = struct_type {.y: %.1} [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %C.decl
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
- // CHECK:STDOUT: %NS: <namespace> = namespace [template] {
- // CHECK:STDOUT: .NSC = %NSC.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %NSC.decl: type = class_decl @NSC [template = constants.%NSC] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C {
- // CHECK:STDOUT: %.loc5_11.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc5_11.2: type = converted %.loc5_11.1, constants.%.1 [template = constants.%.1]
- // CHECK:STDOUT: %.loc5_8: %.2 = field_decl x, element0 [template]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%C
- // CHECK:STDOUT: .x = %.loc5_8
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @NSC {
- // CHECK:STDOUT: %.loc10_11.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc10_11.2: type = converted %.loc10_11.1, constants.%.1 [template = constants.%.1]
- // CHECK:STDOUT: %.loc10_8: %.4 = field_decl y, element0 [template]
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%NSC
- // CHECK:STDOUT: .y = %.loc10_8
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- export.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: %NSC: type = class_type @NSC [template]
- // CHECK:STDOUT: %.3: type = struct_type {.y: %.1} [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %C
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C]
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir1, inst+11, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %NSC
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+12, loaded [template = constants.%NSC]
- // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+7, unloaded
- // CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C]
- // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+13, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+17, unloaded
- // CHECK:STDOUT: %NSC: type = export NSC, %import_ref.3 [template = constants.%NSC]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.4
- // CHECK:STDOUT: .x = file.%import_ref.5
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @NSC {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.6
- // CHECK:STDOUT: .y = file.%import_ref.7
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- not_reexporting.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %import_ref.1
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+13, unloaded
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir1, inst+3, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %import_ref.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+21, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- export_export.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: %NSC: type = class_type @NSC [template]
- // CHECK:STDOUT: %.3: type = struct_type {.y: %.1} [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %C
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+13, loaded [template = constants.%C]
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir1, inst+3, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %NSC
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+21, loaded [template = constants.%NSC]
- // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+11, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+12, unloaded
- // CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C]
- // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+19, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+20, unloaded
- // CHECK:STDOUT: %NSC: type = export NSC, %import_ref.3 [template = constants.%NSC]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.4
- // CHECK:STDOUT: .x = file.%import_ref.5
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @NSC {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.6
- // CHECK:STDOUT: .y = file.%import_ref.7
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- export_in_impl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_export.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
- // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template]
- // CHECK:STDOUT: %struct.1: %C = struct_value (%tuple) [template]
- // CHECK:STDOUT: %NSC: type = class_type @NSC [template]
- // CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template]
- // CHECK:STDOUT: %.5: type = ptr_type %.4 [template]
- // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %import_ref.1
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: .nsc = %nsc
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+13, loaded [template = constants.%C]
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir1, inst+3, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %import_ref.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+21, loaded [template = constants.%NSC]
- // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+11, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+12, unloaded
- // CHECK:STDOUT: %C.ref: type = name_ref C, %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: <namespace> = name_ref NS, %NS [template = %NS]
- // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+19, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+20, unloaded
- // CHECK:STDOUT: %NSC.ref: type = name_ref NSC, %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 = file.%import_ref.4
- // CHECK:STDOUT: .x = file.%import_ref.5
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @NSC {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.6
- // CHECK:STDOUT: .y = file.%import_ref.7
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc6_19.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc6_20.1: %.2 = struct_literal (%.loc6_19.1)
- // CHECK:STDOUT: %.loc6_20.2: ref %.1 = class_element_access file.%c.var, element0
- // CHECK:STDOUT: %.loc6_19.2: init %.1 = tuple_init () to %.loc6_20.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc6_20.3: init %.1 = converted %.loc6_19.1, %.loc6_19.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc6_20.4: init %C = class_init (%.loc6_20.3), file.%c.var [template = constants.%struct.1]
- // CHECK:STDOUT: %.loc6_21: init %C = converted %.loc6_20.1, %.loc6_20.4 [template = constants.%struct.1]
- // CHECK:STDOUT: assign file.%c.var, %.loc6_21
- // CHECK:STDOUT: %.loc7_26.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc7_27.1: %.4 = struct_literal (%.loc7_26.1)
- // CHECK:STDOUT: %.loc7_27.2: ref %.1 = class_element_access file.%nsc.var, element0
- // CHECK:STDOUT: %.loc7_26.2: init %.1 = tuple_init () to %.loc7_27.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc7_27.3: init %.1 = converted %.loc7_26.1, %.loc7_26.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc7_27.4: init %NSC = class_init (%.loc7_27.3), file.%nsc.var [template = constants.%struct.2]
- // CHECK:STDOUT: %.loc7_28: init %NSC = converted %.loc7_27.1, %.loc7_27.4 [template = constants.%struct.2]
- // CHECK:STDOUT: assign file.%nsc.var, %.loc7_28
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- export_export.impl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
- // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template]
- // CHECK:STDOUT: %struct.1: %C = struct_value (%tuple) [template]
- // CHECK:STDOUT: %NSC: type = class_type @NSC [template]
- // CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template]
- // CHECK:STDOUT: %.5: type = ptr_type %.4 [template]
- // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %import_ref.1
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: .nsc = %nsc
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir0, inst+13, loaded [template = constants.%C]
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir0, inst+3, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %import_ref.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3: type = import_ref ir0, inst+21, loaded [template = constants.%NSC]
- // CHECK:STDOUT: %import_ref.4 = import_ref ir0, inst+11, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref ir0, inst+12, unloaded
- // CHECK:STDOUT: %C.ref: type = name_ref C, %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: <namespace> = name_ref NS, %NS [template = %NS]
- // CHECK:STDOUT: %import_ref.6 = import_ref ir0, inst+19, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref ir0, inst+20, unloaded
- // CHECK:STDOUT: %NSC.ref: type = name_ref NSC, %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 = file.%import_ref.4
- // CHECK:STDOUT: .x = file.%import_ref.5
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @NSC {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.6
- // CHECK:STDOUT: .y = file.%import_ref.7
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc4_19.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc4_20.1: %.2 = struct_literal (%.loc4_19.1)
- // CHECK:STDOUT: %.loc4_20.2: ref %.1 = class_element_access file.%c.var, element0
- // CHECK:STDOUT: %.loc4_19.2: init %.1 = tuple_init () to %.loc4_20.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc4_20.3: init %.1 = converted %.loc4_19.1, %.loc4_19.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc4_20.4: init %C = class_init (%.loc4_20.3), file.%c.var [template = constants.%struct.1]
- // CHECK:STDOUT: %.loc4_21: init %C = converted %.loc4_20.1, %.loc4_20.4 [template = constants.%struct.1]
- // CHECK:STDOUT: assign file.%c.var, %.loc4_21
- // CHECK:STDOUT: %.loc5_26.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc5_27.1: %.4 = struct_literal (%.loc5_26.1)
- // CHECK:STDOUT: %.loc5_27.2: ref %.1 = class_element_access file.%nsc.var, element0
- // CHECK:STDOUT: %.loc5_26.2: init %.1 = tuple_init () to %.loc5_27.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc5_27.3: init %.1 = converted %.loc5_26.1, %.loc5_26.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc5_27.4: init %NSC = class_init (%.loc5_27.3), file.%nsc.var [template = constants.%struct.2]
- // CHECK:STDOUT: %.loc5_28: init %NSC = converted %.loc5_27.1, %.loc5_27.4 [template = constants.%struct.2]
- // CHECK:STDOUT: assign file.%nsc.var, %.loc5_28
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_export_export.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
- // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template]
- // CHECK:STDOUT: %struct.1: %C = struct_value (%tuple) [template]
- // CHECK:STDOUT: %NSC: type = class_type @NSC [template]
- // CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template]
- // CHECK:STDOUT: %.5: type = ptr_type %.4 [template]
- // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %import_ref.1
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: .nsc = %nsc
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+13, loaded [template = constants.%C]
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir1, inst+3, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %import_ref.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+21, loaded [template = constants.%NSC]
- // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+11, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+12, unloaded
- // CHECK:STDOUT: %C.ref: type = name_ref C, %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: <namespace> = name_ref NS, %NS [template = %NS]
- // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+19, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+20, unloaded
- // CHECK:STDOUT: %NSC.ref: type = name_ref NSC, %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 = file.%import_ref.4
- // CHECK:STDOUT: .x = file.%import_ref.5
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @NSC {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.6
- // CHECK:STDOUT: .y = file.%import_ref.7
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc6_19.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc6_20.1: %.2 = struct_literal (%.loc6_19.1)
- // CHECK:STDOUT: %.loc6_20.2: ref %.1 = class_element_access file.%c.var, element0
- // CHECK:STDOUT: %.loc6_19.2: init %.1 = tuple_init () to %.loc6_20.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc6_20.3: init %.1 = converted %.loc6_19.1, %.loc6_19.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc6_20.4: init %C = class_init (%.loc6_20.3), file.%c.var [template = constants.%struct.1]
- // CHECK:STDOUT: %.loc6_21: init %C = converted %.loc6_20.1, %.loc6_20.4 [template = constants.%struct.1]
- // CHECK:STDOUT: assign file.%c.var, %.loc6_21
- // CHECK:STDOUT: %.loc7_26.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc7_27.1: %.4 = struct_literal (%.loc7_26.1)
- // CHECK:STDOUT: %.loc7_27.2: ref %.1 = class_element_access file.%nsc.var, element0
- // CHECK:STDOUT: %.loc7_26.2: init %.1 = tuple_init () to %.loc7_27.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc7_27.3: init %.1 = converted %.loc7_26.1, %.loc7_26.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc7_27.4: init %NSC = class_init (%.loc7_27.3), file.%nsc.var [template = constants.%struct.2]
- // CHECK:STDOUT: %.loc7_28: init %NSC = converted %.loc7_27.1, %.loc7_27.4 [template = constants.%struct.2]
- // CHECK:STDOUT: assign file.%nsc.var, %.loc7_28
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_export_ns.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %import_ref.1
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1 = import_ref ir1, inst+1, unloaded
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir1, inst+11, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %import_ref.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_export_decl.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Local: type = class_type @Local [template]
- // CHECK:STDOUT: %.1: type = struct_type {} [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Local = %Local.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Local.decl: type = class_decl @Local [template = constants.%Local] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @Local {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = constants.%Local
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_export_member.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %import_ref.1
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C]
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir1, inst+11, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %import_ref.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+7, unloaded
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.4
- // CHECK:STDOUT: .x = file.%import_ref.5
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- import_both.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
- // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template]
- // CHECK:STDOUT: %struct.1: %C = struct_value (%tuple) [template]
- // CHECK:STDOUT: %NSC: type = class_type @NSC [template]
- // CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template]
- // CHECK:STDOUT: %.5: type = ptr_type %.4 [template]
- // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %import_ref.1
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: .nsc = %nsc
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C]
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir1, inst+11, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %import_ref.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+12, loaded [template = constants.%NSC]
- // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+7, unloaded
- // CHECK:STDOUT: %C.ref: type = name_ref C, %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: <namespace> = name_ref NS, %NS [template = %NS]
- // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+13, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+17, unloaded
- // CHECK:STDOUT: %NSC.ref: type = name_ref NSC, %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 = file.%import_ref.4
- // CHECK:STDOUT: .x = file.%import_ref.5
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @NSC {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.6
- // CHECK:STDOUT: .y = file.%import_ref.7
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc7_19.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc7_20.1: %.2 = struct_literal (%.loc7_19.1)
- // CHECK:STDOUT: %.loc7_20.2: ref %.1 = class_element_access file.%c.var, element0
- // CHECK:STDOUT: %.loc7_19.2: init %.1 = tuple_init () to %.loc7_20.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc7_20.3: init %.1 = converted %.loc7_19.1, %.loc7_19.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc7_20.4: init %C = class_init (%.loc7_20.3), file.%c.var [template = constants.%struct.1]
- // CHECK:STDOUT: %.loc7_21: init %C = converted %.loc7_20.1, %.loc7_20.4 [template = constants.%struct.1]
- // CHECK:STDOUT: assign file.%c.var, %.loc7_21
- // CHECK:STDOUT: %.loc8_26.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc8_27.1: %.4 = struct_literal (%.loc8_26.1)
- // CHECK:STDOUT: %.loc8_27.2: ref %.1 = class_element_access file.%nsc.var, element0
- // CHECK:STDOUT: %.loc8_26.2: init %.1 = tuple_init () to %.loc8_27.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc8_27.3: init %.1 = converted %.loc8_26.1, %.loc8_26.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc8_27.4: init %NSC = class_init (%.loc8_27.3), file.%nsc.var [template = constants.%struct.2]
- // CHECK:STDOUT: %.loc8_28: init %NSC = converted %.loc8_27.1, %.loc8_27.4 [template = constants.%struct.2]
- // CHECK:STDOUT: assign file.%nsc.var, %.loc8_28
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- import_both_reversed.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
- // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template]
- // CHECK:STDOUT: %struct.1: %C = struct_value (%tuple) [template]
- // CHECK:STDOUT: %NSC: type = class_type @NSC [template]
- // CHECK:STDOUT: %.4: type = struct_type {.y: %.1} [template]
- // CHECK:STDOUT: %.5: type = ptr_type %.4 [template]
- // CHECK:STDOUT: %struct.2: %NSC = struct_value (%tuple) [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %import_ref.1
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: .nsc = %nsc
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+13, loaded [template = constants.%C]
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir1, inst+3, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %import_ref.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3: type = import_ref ir1, inst+21, loaded [template = constants.%NSC]
- // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+11, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+12, unloaded
- // CHECK:STDOUT: %C.ref: type = name_ref C, %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: <namespace> = name_ref NS, %NS [template = %NS]
- // CHECK:STDOUT: %import_ref.6 = import_ref ir1, inst+19, unloaded
- // CHECK:STDOUT: %import_ref.7 = import_ref ir1, inst+20, unloaded
- // CHECK:STDOUT: %NSC.ref: type = name_ref NSC, %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 = file.%import_ref.4
- // CHECK:STDOUT: .x = file.%import_ref.5
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @NSC {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.6
- // CHECK:STDOUT: .y = file.%import_ref.7
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc7_19.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc7_20.1: %.2 = struct_literal (%.loc7_19.1)
- // CHECK:STDOUT: %.loc7_20.2: ref %.1 = class_element_access file.%c.var, element0
- // CHECK:STDOUT: %.loc7_19.2: init %.1 = tuple_init () to %.loc7_20.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc7_20.3: init %.1 = converted %.loc7_19.1, %.loc7_19.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc7_20.4: init %C = class_init (%.loc7_20.3), file.%c.var [template = constants.%struct.1]
- // CHECK:STDOUT: %.loc7_21: init %C = converted %.loc7_20.1, %.loc7_20.4 [template = constants.%struct.1]
- // CHECK:STDOUT: assign file.%c.var, %.loc7_21
- // CHECK:STDOUT: %.loc8_26.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc8_27.1: %.4 = struct_literal (%.loc8_26.1)
- // CHECK:STDOUT: %.loc8_27.2: ref %.1 = class_element_access file.%nsc.var, element0
- // CHECK:STDOUT: %.loc8_26.2: init %.1 = tuple_init () to %.loc8_27.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc8_27.3: init %.1 = converted %.loc8_26.1, %.loc8_26.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc8_27.4: init %NSC = class_init (%.loc8_27.3), file.%nsc.var [template = constants.%struct.2]
- // CHECK:STDOUT: %.loc8_28: init %NSC = converted %.loc8_27.1, %.loc8_27.4 [template = constants.%struct.2]
- // CHECK:STDOUT: assign file.%nsc.var, %.loc8_28
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_use_not_reexporting.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Local = %Local
- // CHECK:STDOUT: .NSLocal = %NSLocal
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %C.ref: <error> = name_ref C, <error> [template = <error>]
- // CHECK:STDOUT: %Local: <error> = bind_alias Local, <error> [template = <error>]
- // CHECK:STDOUT: %NS.ref: <error> = name_ref NS, <error> [template = <error>]
- // CHECK:STDOUT: %NSLocal: <error> = bind_alias NSLocal, <error> [template = <error>]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- repeat_export.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %C
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C]
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir1, inst+11, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %import_ref.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+7, unloaded
- // CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.4
- // CHECK:STDOUT: .x = file.%import_ref.5
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- use_repeat_export.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: %.3: type = ptr_type %.2 [template]
- // CHECK:STDOUT: %tuple: %.1 = tuple_value () [template]
- // CHECK:STDOUT: %struct: %C = struct_value (%tuple) [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %import_ref.1
- // CHECK:STDOUT: .c = %c
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+13, loaded [template = constants.%C]
- // CHECK:STDOUT: %import_ref.2 = import_ref ir1, inst+11, unloaded
- // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded
- // CHECK:STDOUT: %C.ref: type = name_ref C, %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: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.2
- // CHECK:STDOUT: .x = file.%import_ref.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @__global_init() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc6_19.1: %.1 = tuple_literal ()
- // CHECK:STDOUT: %.loc6_20.1: %.2 = struct_literal (%.loc6_19.1)
- // CHECK:STDOUT: %.loc6_20.2: ref %.1 = class_element_access file.%c.var, element0
- // CHECK:STDOUT: %.loc6_19.2: init %.1 = tuple_init () to %.loc6_20.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc6_20.3: init %.1 = converted %.loc6_19.1, %.loc6_19.2 [template = constants.%tuple]
- // CHECK:STDOUT: %.loc6_20.4: init %C = class_init (%.loc6_20.3), file.%c.var [template = constants.%struct]
- // CHECK:STDOUT: %.loc6_21: init %C = converted %.loc6_20.1, %.loc6_20.4 [template = constants.%struct]
- // CHECK:STDOUT: assign file.%c.var, %.loc6_21
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: --- fail_modifiers.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %C: type = class_type @C [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %.2: type = struct_type {.x: %.1} [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .C = %C
- // CHECK:STDOUT: .NS = %NS
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.1: type = import_ref ir1, inst+1, loaded [template = constants.%C]
- // CHECK:STDOUT: %import_ref.2: <namespace> = import_ref ir1, inst+11, loaded
- // CHECK:STDOUT: %NS: <namespace> = namespace %import_ref.2, [template] {
- // CHECK:STDOUT: .NSC = %import_ref.3
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %import_ref.3 = import_ref ir1, inst+12, unloaded
- // CHECK:STDOUT: %import_ref.4 = import_ref ir1, inst+2, unloaded
- // CHECK:STDOUT: %import_ref.5 = import_ref ir1, inst+7, unloaded
- // CHECK:STDOUT: %C: type = export C, %import_ref.1 [template = constants.%C]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: class @C {
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = file.%import_ref.4
- // CHECK:STDOUT: .x = file.%import_ref.5
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|