mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 14:00:30 +00:00
Diagnostic rendering was part of the data model: `Loc::FormatLocation` and `Loc::FormatSnippet` wrote plain text to a stream, so no capability, color, or terminal width could reach them. A diagnostic is now one message with labels, contexts, and location information attached, and `Diagnostics::Renderer` draws it into a `Terminal::Buffer`. The design is in `toolchain/docs/diagnostics_rendering.md` (#7668), authoring in `toolchain/docs/diagnostics.md`. Before: ``` example.carbon:6:3: error: 1 argument passed to function expecting 0 arguments Run0(1); ^~~~~~~ example.carbon:3:1: note: calling function declared here fn Run0() {} ^~~~~~~~~~~ ``` After: ``` error: 1 argument passed to function expecting 0 arguments ╭─┤ example.carbon:6:3 ┆ 3 │ fn Run0() {} · ─────┬───── · ╰──┤ calling function declared here ┆ -> 6 │ Run0(1); · ─────── ╰──────────── ``` `--no-diagnostic-snippets` gives a compact form, `example.carbon:6:3-9`. File tests use it; the rendering tests under `toolchain/diagnostics/testdata` ask for snippets. C++ interop diagnostics are data now rather than text Clang drew: `SemIR::ClangSourceLocId` names a `clang::SourceRange`, and a Clang location is marked as the point it names. `StreamConsumer` moves to a `:renderer` target that `:emitter` does not depend on, keeping `common/terminal` out of `consumer.h`. Capabilities come from the file behind the error stream, so tests get plain ASCII. `renderer_fuzzer` draws diagnostics built from fuzzer bytes with every capability combination, since a shape the renderer doesn't expect must never be why the compiler dies while reporting a problem. TODOs mark the follow-ups: line weights and crossing lines, wrapping that keeps a quoted type whole, and ordering diagnostics that share a byte offset. Also: `IncorrectExtension`'s hint moves into its message, since its note had no location of its own, and `strip_noise` in `check_diagnostics.py` blanks multi-line `#define`s instead of deleting them. Assisted-by: Claude Code
970 lines
47 KiB
Plaintext
970 lines
47 KiB
Plaintext
// 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: imported from: fail_conflict_on_export_import.carbon:[[@LINE+4]]:1 [InImport]
|
|
// CHECK:STDERR: base.carbon:4:1-9: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
|
// CHECK:STDERR: imported from: fail_conflict_on_export_import.carbon:[[@LINE+2]]:1 [InImport]
|
|
// CHECK:STDERR: conflict.carbon:4:1-8: note: name is previously declared here [NameDeclPrevious]
|
|
import Other library "export_import";
|
|
import Other library "conflict";
|
|
|
|
// CHECK:STDERR: fail_conflict_on_export_import.carbon:[[@LINE+2]]:11-17: note: in name lookup for `C` [InNameLookup]
|
|
// CHECK:STDERR:
|
|
alias C = Other.C;
|
|
|
|
// --- fail_conflict_on_export_name.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
// CHECK:STDERR: imported from: fail_conflict_on_export_name.carbon:[[@LINE+5]]:1 [InImport]
|
|
// CHECK:STDERR: conflict.carbon:4:1-8: error: duplicate name `C` being declared in the same scope [NameDeclDuplicate]
|
|
// CHECK:STDERR: imported from: fail_conflict_on_export_name.carbon:[[@LINE+3]]:1 [InImport]
|
|
// CHECK:STDERR: imported from: export_name.carbon:4:1 [InImport]
|
|
// CHECK:STDERR: base.carbon:4:1-9: note: name is previously declared here [NameDeclPrevious]
|
|
import Other library "export_name";
|
|
import Other library "conflict";
|
|
|
|
// CHECK:STDERR: fail_conflict_on_export_name.carbon:[[@LINE+2]]:11-17: note: in name lookup for `C` [InNameLookup]
|
|
// CHECK:STDERR:
|
|
alias C = Other.C;
|
|
|
|
// CHECK:STDOUT: --- base.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// 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: %field_decl: %C.elem = field_decl x, element0, %.loc5_11.2 in [concrete] {
|
|
// 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: }
|
|
// 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 = %field_decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- conflict.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// 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: type: type = facet_type <type> [concrete]
|
|
// 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.0cc = import_ref Other//base, inst{{[0-9A-F]+}} [no loc], unloaded
|
|
// CHECK:STDOUT: %Other.import_ref.d09 = 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.0cc
|
|
// CHECK:STDOUT: .x = imports.%Other.import_ref.d09
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- export_name_copy.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// 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.0cc = import_ref Other//base, inst{{[0-9A-F]+}} [no loc], unloaded
|
|
// CHECK:STDOUT: %Other.import_ref.d09 = 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.0cc
|
|
// CHECK:STDOUT: .x = imports.%Other.import_ref.d09
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- export_name_indirect.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// 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.4fa = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: %Other.import_ref.82f = 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.4fa
|
|
// CHECK:STDOUT: .x = imports.%Other.import_ref.82f
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- use_export_import.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// 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: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
|
|
// CHECK:STDOUT: %.a6a: 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.0cc = import_ref Other//base, inst{{[0-9A-F]+}} [no loc], unloaded
|
|
// CHECK:STDOUT: %Other.import_ref.d09 = 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: %c.var: ref %C = var_storage %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 = wrapper_binding c, %c.var [concrete = %c.var]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete = constants.%c.patt]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete = constants.%c.var_patt]
|
|
// CHECK:STDOUT: }
|
|
// 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.0cc
|
|
// CHECK:STDOUT: .x = imports.%Other.import_ref.d09
|
|
// 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.%.a6a]
|
|
// 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: type: type = facet_type <type> [concrete]
|
|
// 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: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
|
|
// CHECK:STDOUT: %.a6a: 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.0cc = import_ref Other//base, inst{{[0-9A-F]+}} [no loc], unloaded
|
|
// CHECK:STDOUT: %Other.import_ref.d09 = 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: %c.var: ref %C = var_storage %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 = wrapper_binding c, %c.var [concrete = %c.var]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete = constants.%c.patt]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete = constants.%c.var_patt]
|
|
// CHECK:STDOUT: }
|
|
// 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.0cc
|
|
// CHECK:STDOUT: .x = imports.%Other.import_ref.d09
|
|
// 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.%.a6a]
|
|
// 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: type: type = facet_type <type> [concrete]
|
|
// 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: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
|
|
// CHECK:STDOUT: %.a6a: 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.0cc = import_ref Other//base, inst{{[0-9A-F]+}} [no loc], unloaded
|
|
// CHECK:STDOUT: %Other.import_ref.d09 = 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: %c.var: ref %C = var_storage %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 = wrapper_binding c, %c.var [concrete = %c.var]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete = constants.%c.patt]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete = constants.%c.var_patt]
|
|
// CHECK:STDOUT: }
|
|
// 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.0cc
|
|
// CHECK:STDOUT: .x = imports.%Other.import_ref.d09
|
|
// 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.%.a6a]
|
|
// 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: type: type = facet_type <type> [concrete]
|
|
// 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: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
|
|
// CHECK:STDOUT: %.a6a: 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.4fa = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: %Other.import_ref.82f = 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: %c.var: ref %C = var_storage %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 = wrapper_binding c, %c.var [concrete = %c.var]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete = constants.%c.patt]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete = constants.%c.var_patt]
|
|
// CHECK:STDOUT: }
|
|
// 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.4fa
|
|
// CHECK:STDOUT: .x = imports.%Other.import_ref.82f
|
|
// 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.%.a6a]
|
|
// 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: type: type = facet_type <type> [concrete]
|
|
// 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: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
|
|
// CHECK:STDOUT: %.a6a: 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.4fa = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: %Other.import_ref.82f = 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: %c.var: ref %C = var_storage %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 = wrapper_binding c, %c.var [concrete = %c.var]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete = constants.%c.patt]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete = constants.%c.var_patt]
|
|
// CHECK:STDOUT: }
|
|
// 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.4fa
|
|
// CHECK:STDOUT: .x = imports.%Other.import_ref.82f
|
|
// 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.%.a6a]
|
|
// 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: type: type = facet_type <type> [concrete]
|
|
// 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: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
|
|
// CHECK:STDOUT: %.a6a: 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.b97 = import_ref Other//export_name_indirect, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: %Other.import_ref.de6 = 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: %c.var: ref %C = var_storage %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 = wrapper_binding c, %c.var [concrete = %c.var]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete = constants.%c.patt]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete = constants.%c.var_patt]
|
|
// CHECK:STDOUT: }
|
|
// 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.b97
|
|
// CHECK:STDOUT: .x = imports.%Other.import_ref.de6
|
|
// 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.%.a6a]
|
|
// 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: type: type = facet_type <type> [concrete]
|
|
// 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: %c.patt: %pattern_type = ref_binding_pattern c [concrete]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %struct: %struct_type.x = struct_value (%empty_tuple) [concrete]
|
|
// CHECK:STDOUT: %.a6a: 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.4fa = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: %Other.import_ref.82f = 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: %c.var: ref %C = var_storage %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 = wrapper_binding c, %c.var [concrete = %c.var]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %c.patt: %pattern_type = ref_binding_pattern c [concrete = constants.%c.patt]
|
|
// CHECK:STDOUT: %c.var_patt: %pattern_type = var_pattern %c.patt [concrete = constants.%c.var_patt]
|
|
// CHECK:STDOUT: }
|
|
// 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.4fa
|
|
// CHECK:STDOUT: .x = imports.%Other.import_ref.82f
|
|
// 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.%.a6a]
|
|
// 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: type: type = facet_type <type> [concrete]
|
|
// 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, %C.ref [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: type: type = facet_type <type> [concrete]
|
|
// 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.4fa = import_ref Other//export_name, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: %Other.import_ref.82f = 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, %C.ref [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.4fa
|
|
// CHECK:STDOUT: .x = imports.%Other.import_ref.82f
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|