mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:30:14 +01:00
Instead of naming the root namespace `package` (because it's accessed by the `package` keyword), change it to use the current package name. Note, buried in the checksum changes, `toolchain/check/testdata/package_expr/fail_not_found.carbon`: ``` - // CHECK:STDERR: fail_not_found.carbon:[[@LINE+4]]:16: error: member name `x` not found in `package` [MemberNameNotFoundInInstScope] + // CHECK:STDERR: fail_not_found.carbon:[[@LINE+4]]:16: error: member name `x` not found in `Main` [MemberNameNotFoundInInstScope] ``` for: ``` // CHECK:STDERR: var y: i32 = package.x; // CHECK:STDERR: ^~~~~~~~~ ``` I'll leave it to you if you prefer this; the alternative I see is to just rename `IsCorePackage` to `IsImportedCorePackage`, and/or change it to a helper that takes a `Context` and does the right thing with `parse_tree` (which, I need for `Destroy`-related reasons and was my default approach).
565 lines
24 KiB
Plaintext
565 lines
24 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/class/indirect_import_member.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/indirect_import_member.carbon
|
|
|
|
// ============================================================================
|
|
// Setup files
|
|
// ============================================================================
|
|
|
|
// --- a.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
class C {
|
|
fn F() {}
|
|
}
|
|
|
|
// --- b.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
export import library "a";
|
|
|
|
// --- c.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
import library "b";
|
|
|
|
export C;
|
|
|
|
// --- d.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
export import library "c";
|
|
|
|
// --- e.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
import library "c";
|
|
|
|
class D {
|
|
alias C = package.C;
|
|
}
|
|
|
|
// --- f.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
export import library "e";
|
|
|
|
// ============================================================================
|
|
// Test files
|
|
// ============================================================================
|
|
|
|
// --- use_b.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
import library "b";
|
|
|
|
var x: () = C.F();
|
|
|
|
// --- use_c.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
import library "c";
|
|
|
|
var x: () = C.F();
|
|
|
|
// --- use_d.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
import library "d";
|
|
|
|
var x: () = C.F();
|
|
|
|
// --- use_e.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
import library "e";
|
|
|
|
var x: () = D.C.F();
|
|
|
|
// --- use_f.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
import library "f";
|
|
|
|
var x: () = D.C.F();
|
|
|
|
// CHECK:STDOUT: --- a.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %C.F.type: type = fn_type @C.F [concrete]
|
|
// CHECK:STDOUT: %C.F: %C.F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [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: %C.F.decl: %C.F.type = fn_decl @C.F [concrete = constants.%C.F] {} {}
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%C
|
|
// CHECK:STDOUT: .F = %C.F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.F() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- b.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Main.C = import_ref Main//a, C, unloaded
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .C = imports.%Main.C
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- c.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Main.C: type = import_ref Main//a, C, loaded [concrete = constants.%C]
|
|
// CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//a, loc6_1, loaded [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: %Main.import_ref.743 = import_ref Main//a, inst{{[0-9A-F]+}} [no loc], unloaded
|
|
// CHECK:STDOUT: %Main.import_ref.071 = import_ref Main//a, loc5_10, 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.%Main.C [concrete = constants.%C]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C [from "a.carbon"] {
|
|
// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f2
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%Main.import_ref.743
|
|
// CHECK:STDOUT: .F = imports.%Main.import_ref.071
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- d.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Main.C = import_ref Main//c, C, unloaded
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .C = imports.%Main.C
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- e.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %D: type = class_type @D [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Main.C: type = import_ref Main//c, C, loaded [concrete = constants.%C]
|
|
// CHECK:STDOUT: %Main.import_ref.8db: <witness> = import_ref Main//c, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: %Main.import_ref.a60 = import_ref Main//c, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: %Main.import_ref.2b4 = import_ref Main//c, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .C = imports.%Main.C
|
|
// CHECK:STDOUT: .D = %D.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: %D.decl: type = class_decl @D [concrete = constants.%D] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @D {
|
|
// CHECK:STDOUT: %package.ref: <namespace> = name_ref package, package [concrete = package]
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
|
|
// CHECK:STDOUT: %C: type = alias_binding C, imports.%Main.C [concrete = constants.%C]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%empty_struct_type [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = constants.%D
|
|
// CHECK:STDOUT: .C = %C
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C [from "c.carbon"] {
|
|
// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8db
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%Main.import_ref.a60
|
|
// CHECK:STDOUT: .F = imports.%Main.import_ref.2b4
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- f.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Main.D = import_ref Main//e, D, unloaded
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .D = imports.%Main.D
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- use_b.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: %C.F.type: type = fn_type @C.F [concrete]
|
|
// CHECK:STDOUT: %C.F: %C.F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Main.C: type = import_ref Main//a, C, loaded [concrete = constants.%C]
|
|
// CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//a, loc6_1, loaded [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: %Main.import_ref.743 = import_ref Main//a, inst{{[0-9A-F]+}} [no loc], unloaded
|
|
// CHECK:STDOUT: %Main.import_ref.25c: %C.F.type = import_ref Main//a, loc5_10, loaded [concrete = constants.%C.F]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .C = imports.%Main.C
|
|
// CHECK:STDOUT: .x = %x
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %x.patt: %pattern_type = ref_binding_pattern x [concrete]
|
|
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt [concrete]
|
|
// CHECK:STDOUT: %.loc6_9.1: type = splice_block %.loc6_9.3 [concrete = constants.%empty_tuple.type] {
|
|
// CHECK:STDOUT: %.loc6_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %x.var [concrete = %x.var]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C [from "a.carbon"] {
|
|
// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f2
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%Main.import_ref.743
|
|
// CHECK:STDOUT: .F = imports.%Main.import_ref.25c
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.F [from "a.carbon"];
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @__global_init() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
|
|
// CHECK:STDOUT: %F.ref: %C.F.type = name_ref F, imports.%Main.import_ref.25c [concrete = constants.%C.F]
|
|
// CHECK:STDOUT: %C.F.call: init %empty_tuple.type = call %F.ref()
|
|
// CHECK:STDOUT: assign file.%x.var, %C.F.call
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- use_c.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: %C.F.type: type = fn_type @C.F [concrete]
|
|
// CHECK:STDOUT: %C.F: %C.F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Main.C: type = import_ref Main//c, C, loaded [concrete = constants.%C]
|
|
// CHECK:STDOUT: %Main.import_ref.8db: <witness> = import_ref Main//c, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: %Main.import_ref.a60 = import_ref Main//c, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: %Main.import_ref.7e5: %C.F.type = import_ref Main//c, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%C.F]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .C = imports.%Main.C
|
|
// CHECK:STDOUT: .x = %x
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %x.patt: %pattern_type = ref_binding_pattern x [concrete]
|
|
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt [concrete]
|
|
// CHECK:STDOUT: %.loc6_9.1: type = splice_block %.loc6_9.3 [concrete = constants.%empty_tuple.type] {
|
|
// CHECK:STDOUT: %.loc6_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %x.var [concrete = %x.var]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C [from "c.carbon"] {
|
|
// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8db
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%Main.import_ref.a60
|
|
// CHECK:STDOUT: .F = imports.%Main.import_ref.7e5
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.F [from "a.carbon"];
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @__global_init() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
|
|
// CHECK:STDOUT: %F.ref: %C.F.type = name_ref F, imports.%Main.import_ref.7e5 [concrete = constants.%C.F]
|
|
// CHECK:STDOUT: %C.F.call: init %empty_tuple.type = call %F.ref()
|
|
// CHECK:STDOUT: assign file.%x.var, %C.F.call
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- use_d.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: %C.F.type: type = fn_type @C.F [concrete]
|
|
// CHECK:STDOUT: %C.F: %C.F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Main.C: type = import_ref Main//c, C, loaded [concrete = constants.%C]
|
|
// CHECK:STDOUT: %Main.import_ref.8db: <witness> = import_ref Main//c, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: %Main.import_ref.a60 = import_ref Main//c, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: %Main.import_ref.7e5: %C.F.type = import_ref Main//c, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%C.F]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .C = imports.%Main.C
|
|
// CHECK:STDOUT: .x = %x
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %x.patt: %pattern_type = ref_binding_pattern x [concrete]
|
|
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt [concrete]
|
|
// CHECK:STDOUT: %.loc6_9.1: type = splice_block %.loc6_9.3 [concrete = constants.%empty_tuple.type] {
|
|
// CHECK:STDOUT: %.loc6_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %x.var [concrete = %x.var]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C [from "c.carbon"] {
|
|
// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8db
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%Main.import_ref.a60
|
|
// CHECK:STDOUT: .F = imports.%Main.import_ref.7e5
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.F [from "a.carbon"];
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @__global_init() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.C [concrete = constants.%C]
|
|
// CHECK:STDOUT: %F.ref: %C.F.type = name_ref F, imports.%Main.import_ref.7e5 [concrete = constants.%C.F]
|
|
// CHECK:STDOUT: %C.F.call: init %empty_tuple.type = call %F.ref()
|
|
// CHECK:STDOUT: assign file.%x.var, %C.F.call
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- use_e.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %D: type = class_type @D [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %C.F.type: type = fn_type @C.F [concrete]
|
|
// CHECK:STDOUT: %C.F: %C.F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Main.D: type = import_ref Main//e, D, loaded [concrete = constants.%D]
|
|
// CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//e, loc8_1, loaded [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: %Main.import_ref.1d5 = import_ref Main//e, inst{{[0-9A-F]+}} [no loc], unloaded
|
|
// CHECK:STDOUT: %Main.import_ref.7a9: type = import_ref Main//e, loc7_9, loaded [concrete = constants.%C]
|
|
// CHECK:STDOUT: %Main.import_ref.8f3: <witness> = import_ref Main//e, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: %Main.import_ref.76e = import_ref Main//e, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: %Main.import_ref.c63: %C.F.type = import_ref Main//e, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%C.F]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .D = imports.%Main.D
|
|
// CHECK:STDOUT: .x = %x
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %x.patt: %pattern_type = ref_binding_pattern x [concrete]
|
|
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt [concrete]
|
|
// CHECK:STDOUT: %.loc6_9.1: type = splice_block %.loc6_9.3 [concrete = constants.%empty_tuple.type] {
|
|
// CHECK:STDOUT: %.loc6_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %x.var [concrete = %x.var]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @D [from "e.carbon"] {
|
|
// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f2
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%Main.import_ref.1d5
|
|
// CHECK:STDOUT: .C = imports.%Main.import_ref.7a9
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C [from "e.carbon"] {
|
|
// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f3
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%Main.import_ref.76e
|
|
// CHECK:STDOUT: .F = imports.%Main.import_ref.c63
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.F [from "a.carbon"];
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @__global_init() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%Main.D [concrete = constants.%D]
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.import_ref.7a9 [concrete = constants.%C]
|
|
// CHECK:STDOUT: %F.ref: %C.F.type = name_ref F, imports.%Main.import_ref.c63 [concrete = constants.%C.F]
|
|
// CHECK:STDOUT: %C.F.call: init %empty_tuple.type = call %F.ref()
|
|
// CHECK:STDOUT: assign file.%x.var, %C.F.call
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- use_f.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %empty_tuple.type [concrete]
|
|
// CHECK:STDOUT: %D: type = class_type @D [concrete]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
// CHECK:STDOUT: %C.F.type: type = fn_type @C.F [concrete]
|
|
// CHECK:STDOUT: %C.F: %C.F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Main.D: type = import_ref Main//e, D, loaded [concrete = constants.%D]
|
|
// CHECK:STDOUT: %Main.import_ref.8f2: <witness> = import_ref Main//e, loc8_1, loaded [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: %Main.import_ref.1d5 = import_ref Main//e, inst{{[0-9A-F]+}} [no loc], unloaded
|
|
// CHECK:STDOUT: %Main.import_ref.7a9: type = import_ref Main//e, loc7_9, loaded [concrete = constants.%C]
|
|
// CHECK:STDOUT: %Main.import_ref.8f3: <witness> = import_ref Main//e, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%complete_type]
|
|
// CHECK:STDOUT: %Main.import_ref.76e = import_ref Main//e, inst{{[0-9A-F]+}} [indirect], unloaded
|
|
// CHECK:STDOUT: %Main.import_ref.c63: %C.F.type = import_ref Main//e, inst{{[0-9A-F]+}} [indirect], loaded [concrete = constants.%C.F]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .D = imports.%Main.D
|
|
// CHECK:STDOUT: .x = %x
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %x.patt: %pattern_type = ref_binding_pattern x [concrete]
|
|
// CHECK:STDOUT: %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x.var: ref %empty_tuple.type = var %x.var_patt [concrete]
|
|
// CHECK:STDOUT: %.loc6_9.1: type = splice_block %.loc6_9.3 [concrete = constants.%empty_tuple.type] {
|
|
// CHECK:STDOUT: %.loc6_9.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
|
// CHECK:STDOUT: %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %x: ref %empty_tuple.type = ref_binding x, %x.var [concrete = %x.var]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @D [from "e.carbon"] {
|
|
// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f2
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%Main.import_ref.1d5
|
|
// CHECK:STDOUT: .C = imports.%Main.import_ref.7a9
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @C [from "e.carbon"] {
|
|
// CHECK:STDOUT: complete_type_witness = imports.%Main.import_ref.8f3
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%Main.import_ref.76e
|
|
// CHECK:STDOUT: .F = imports.%Main.import_ref.c63
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @C.F [from "a.carbon"];
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @__global_init() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %D.ref: type = name_ref D, imports.%Main.D [concrete = constants.%D]
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%Main.import_ref.7a9 [concrete = constants.%C]
|
|
// CHECK:STDOUT: %F.ref: %C.F.type = name_ref F, imports.%Main.import_ref.c63 [concrete = constants.%C.F]
|
|
// CHECK:STDOUT: %C.F.call: init %empty_tuple.type = call %F.ref()
|
|
// CHECK:STDOUT: assign file.%x.var, %C.F.call
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|