mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-17 10:18:13 +00:00
Historically, we disabled the rendered form in tests outside of `toolchain/diagnostics`. The idea was to keep tests shorter and avoid very long chains of autoupdate before stabilizing due to all the line numbers and other artifacts in the rendered form. This PR adds `--diagnostic-line-numbers=[all|first]` and defaults to `first` in tests. This keeps the rendered form so that we can easily code review that form and the visual cues it does or doesn't provide. But it removes all but the first location's line numbers to provide significantly more stability in tests. By default, tests get the full unicode line-drawing form of diagnostics so we can ensure all of the artifacts there make sense with the specific case being diagnosed, but we do retain some focused ASCII-rendering tests to ensure that fallback remains usable. There are some issues here that will be fixed in subsequent PRs. Notably, we try to keep the frame together in the check lines, and so force some parts to use the first location. This largely works, but fails in some edge cases, causing the entire frame to be located incorrectly. There is a TODO about this that we need to fix, and it only occurs 6 times across the test suite, so it didn't seem worth front-loading a fix for here. Assisted-by: Claude Code
627 lines
26 KiB
Plaintext
627 lines
26 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/interface/import_access.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/import_access.carbon
|
|
|
|
// ============================================================================
|
|
// Setup files
|
|
// ============================================================================
|
|
|
|
// --- def.carbon
|
|
|
|
package Test library "[[@TEST_NAME]]";
|
|
|
|
private interface Def {}
|
|
|
|
// --- forward_with_def.carbon
|
|
|
|
package Test library "[[@TEST_NAME]]";
|
|
|
|
private interface ForwardWithDef;
|
|
|
|
interface ForwardWithDef {}
|
|
|
|
// --- forward.carbon
|
|
|
|
package Test library "[[@TEST_NAME]]";
|
|
|
|
// TODO: Import of forward declared interfaces crashes.
|
|
// private interface Forward;
|
|
|
|
// ============================================================================
|
|
// Test files
|
|
// ============================================================================
|
|
|
|
// --- def.impl.carbon
|
|
|
|
impl package Test library "[[@TEST_NAME]]";
|
|
|
|
fn F(unused i: Def) {}
|
|
|
|
// --- fail_local_def.carbon
|
|
|
|
package Test library "[[@TEST_NAME]]";
|
|
|
|
import library "def";
|
|
|
|
// CHECK:STDERR: ╭─┤ fail_local_def.carbon:[[@LINE+6]]:16
|
|
// CHECK:STDERR: -> │ fn F(unused i: Def) {}
|
|
// CHECK:STDERR: · ━┳━
|
|
// CHECK:STDERR: · ┗━━┫ error: name `Def` not found [NameNotFound]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
fn F(unused i: Def) {}
|
|
|
|
// --- fail_other_def.carbon
|
|
|
|
package Other library "[[@TEST_NAME]]";
|
|
|
|
import Test library "def";
|
|
|
|
// CHECK:STDERR: ╭─┤ fail_other_def.carbon:[[@LINE+7]]:16
|
|
// CHECK:STDERR: -> │ fn F(unused i: Test.Def) {}
|
|
// CHECK:STDERR: · ━━━━┳━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: member name `Def` not found in `Test`
|
|
// CHECK:STDERR: · ┃ [MemberNameNotFoundInInstScope]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
fn F(unused i: Test.Def) {}
|
|
|
|
// --- forward_with_def.impl.carbon
|
|
|
|
impl package Test library "[[@TEST_NAME]]";
|
|
|
|
fn F(unused i: ForwardWithDef) {}
|
|
|
|
// --- fail_local_forward_with_def.carbon
|
|
|
|
package Test library "[[@TEST_NAME]]";
|
|
|
|
import library "forward_with_def";
|
|
|
|
// CHECK:STDERR: ╭─┤ fail_local_forward_with_def.carbon:[[@LINE+6]]:16
|
|
// CHECK:STDERR: -> │ fn F(unused i: ForwardWithDef) {}
|
|
// CHECK:STDERR: · ━━━━━━━┳━━━━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: name `ForwardWithDef` not found [NameNotFound]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
fn F(unused i: ForwardWithDef) {}
|
|
|
|
// --- fail_other_forward_with_def.carbon
|
|
|
|
package Other library "[[@TEST_NAME]]";
|
|
|
|
import Test library "forward_with_def";
|
|
|
|
// CHECK:STDERR: ╭─┤ fail_other_forward_with_def.carbon:[[@LINE+7]]:16
|
|
// CHECK:STDERR: -> │ fn F(unused i: Test.ForwardWithDef) {}
|
|
// CHECK:STDERR: · ━━━━━┳━━━━━━━━━━━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: member name `ForwardWithDef` not found in `Test`
|
|
// CHECK:STDERR: · ┃ [MemberNameNotFoundInInstScope]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
fn F(unused i: Test.ForwardWithDef) {}
|
|
|
|
// --- fail_todo_forward.impl.carbon
|
|
|
|
impl package Test library "[[@TEST_NAME]]";
|
|
|
|
// CHECK:STDERR: ╭─┤ fail_todo_forward.impl.carbon:[[@LINE+17]]:16
|
|
// CHECK:STDERR: -> │ fn F(unused i: Forward*) {}
|
|
// CHECK:STDERR: · ━━━┳━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: name `Forward` not found [NameNotFound]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
// CHECK:STDERR: ╭─┤ fail_todo_forward.impl.carbon:[[@LINE+11]]:16
|
|
// CHECK:STDERR: -> │ fn F(unused i: Forward*) {}
|
|
// CHECK:STDERR: · ━━━┳━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: name `Forward` used before it was declared
|
|
// CHECK:STDERR: · ┃ [NameUseBeforeDecl]
|
|
// CHECK:STDERR: │
|
|
// CHECK:STDERR: │ interface Forward {}
|
|
// CHECK:STDERR: · ───┬───
|
|
// CHECK:STDERR: · ╰──┤ declared here [NameUseBeforeDeclNote]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
fn F(unused i: Forward*) {}
|
|
|
|
interface Forward {}
|
|
|
|
// --- fail_local_forward.carbon
|
|
|
|
package Test library "[[@TEST_NAME]]";
|
|
|
|
import library "forward";
|
|
|
|
// CHECK:STDERR: ╭─┤ fail_local_forward.carbon:[[@LINE+6]]:16
|
|
// CHECK:STDERR: -> │ fn F(unused i: Forward*) {}
|
|
// CHECK:STDERR: · ━━━┳━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: name `Forward` not found [NameNotFound]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
fn F(unused i: Forward*) {}
|
|
|
|
// --- fail_other_forward.carbon
|
|
|
|
package Other library "[[@TEST_NAME]]";
|
|
|
|
import Test library "forward";
|
|
|
|
// CHECK:STDERR: ╭─┤ fail_other_forward.carbon:[[@LINE+6]]:16
|
|
// CHECK:STDERR: -> │ fn F(unused i: Forward*) {}
|
|
// CHECK:STDERR: · ━━━┳━━━
|
|
// CHECK:STDERR: · ┗━━┫ error: name `Forward` not found [NameNotFound]
|
|
// CHECK:STDERR: ╰────
|
|
// CHECK:STDERR:
|
|
fn F(unused i: Forward*) {}
|
|
|
|
// --- todo_fail_private_on_redecl.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
private interface Redecl;
|
|
|
|
private interface Redecl {}
|
|
|
|
// CHECK:STDOUT: --- def.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %Def.type: type = facet_type <@Def> [concrete]
|
|
// CHECK:STDOUT: %Self: %Def.type = symbolic_binding Self, 0 [symbolic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Def [private] = %Def.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Def.decl: type = interface_decl @Def [concrete = constants.%Def.type] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @Def {
|
|
// CHECK:STDOUT: %Self: %Def.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
|
|
// CHECK:STDOUT: %Def.WithSelf.decl = interface_with_self_decl @Def [concrete]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !requires:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @Def.WithSelf(constants.%Self) {}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- forward_with_def.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %ForwardWithDef.type: type = facet_type <@ForwardWithDef> [concrete]
|
|
// CHECK:STDOUT: %Self: %ForwardWithDef.type = symbolic_binding Self, 0 [symbolic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .ForwardWithDef [private] = %ForwardWithDef.decl.loc4
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %ForwardWithDef.decl.loc4: type = interface_decl @ForwardWithDef [concrete = constants.%ForwardWithDef.type] {} {}
|
|
// CHECK:STDOUT: %ForwardWithDef.decl.loc6: type = interface_decl @ForwardWithDef [concrete = constants.%ForwardWithDef.type] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @ForwardWithDef {
|
|
// CHECK:STDOUT: %Self: %ForwardWithDef.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
|
|
// CHECK:STDOUT: %ForwardWithDef.WithSelf.decl = interface_with_self_decl @ForwardWithDef [concrete]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !requires:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @ForwardWithDef.WithSelf(constants.%Self) {}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- forward.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- def.impl.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %Def.type: type = facet_type <@Def> [concrete]
|
|
// CHECK:STDOUT: %Self: %Def.type = symbolic_binding Self, 0 [symbolic]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %Def.type [concrete]
|
|
// CHECK:STDOUT: %i.param_patt: %pattern_type = value_param_pattern [concrete]
|
|
// CHECK:STDOUT: %i.patt: %pattern_type = wrapper_binding_pattern i, %i.param_patt [concrete]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Test.Def: type = import_ref Test//def, Def, loaded [concrete = constants.%Def.type]
|
|
// CHECK:STDOUT: %Test.import_ref.d50 = import_ref Test//def, loc4_23, unloaded
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Def [private] = imports.%Test.Def
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Test.import = import Test
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
|
// CHECK:STDOUT: %i.param_patt: %pattern_type = value_param_pattern [concrete = constants.%i.param_patt]
|
|
// CHECK:STDOUT: %i.patt: %pattern_type = wrapper_binding_pattern i, %i.param_patt [concrete = constants.%i.patt]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %i.param: %Def.type = value_param call_param0
|
|
// CHECK:STDOUT: %Def.ref: type = name_ref Def, imports.%Test.Def [concrete = constants.%Def.type]
|
|
// CHECK:STDOUT: %i: %Def.type = wrapper_binding i, %i.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @Def [from "def.carbon"] {
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%Test.import_ref.d50
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !requires:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%i.param: %Def.type) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @Def.WithSelf(constants.%Self) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_local_def.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Def = <poisoned>
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
|
// CHECK:STDOUT: %i.param_patt: <error> = value_param_pattern [concrete = <error>]
|
|
// CHECK:STDOUT: %i.patt: <error> = wrapper_binding_pattern i, %i.param_patt [concrete = <error>]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %i.param: <error> = value_param call_param0
|
|
// CHECK:STDOUT: %Def.ref: <error> = name_ref Def, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: %i: <error> = wrapper_binding i, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%i.param: <error>) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_other_def.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Test: <namespace> = namespace file.%Test.import, [concrete] {
|
|
// CHECK:STDOUT: .Def = <poisoned>
|
|
// CHECK:STDOUT: import Test//def
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Test = imports.%Test
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Test.import = import Test
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
|
// CHECK:STDOUT: %i.param_patt: <error> = value_param_pattern [concrete = <error>]
|
|
// CHECK:STDOUT: %i.patt: <error> = wrapper_binding_pattern i, %i.param_patt [concrete = <error>]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %i.param: <error> = value_param call_param0
|
|
// CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
|
|
// CHECK:STDOUT: %Test.ref: <namespace> = name_ref Test, imports.%Test [concrete = imports.%Test]
|
|
// CHECK:STDOUT: %Def.ref: <error> = name_ref Def, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %i: <error> = wrapper_binding i, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%i.param: <error>) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- forward_with_def.impl.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %ForwardWithDef.type: type = facet_type <@ForwardWithDef> [concrete]
|
|
// CHECK:STDOUT: %Self: %ForwardWithDef.type = symbolic_binding Self, 0 [symbolic]
|
|
// CHECK:STDOUT: %pattern_type: type = pattern_type %ForwardWithDef.type [concrete]
|
|
// CHECK:STDOUT: %i.param_patt: %pattern_type = value_param_pattern [concrete]
|
|
// CHECK:STDOUT: %i.patt: %pattern_type = wrapper_binding_pattern i, %i.param_patt [concrete]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Test.ForwardWithDef: type = import_ref Test//forward_with_def, ForwardWithDef, loaded [concrete = constants.%ForwardWithDef.type]
|
|
// CHECK:STDOUT: %Test.import_ref.223 = import_ref Test//forward_with_def, loc6_26, unloaded
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .ForwardWithDef [private] = imports.%Test.ForwardWithDef
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Test.import = import Test
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
|
// CHECK:STDOUT: %i.param_patt: %pattern_type = value_param_pattern [concrete = constants.%i.param_patt]
|
|
// CHECK:STDOUT: %i.patt: %pattern_type = wrapper_binding_pattern i, %i.param_patt [concrete = constants.%i.patt]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %i.param: %ForwardWithDef.type = value_param call_param0
|
|
// CHECK:STDOUT: %ForwardWithDef.ref: type = name_ref ForwardWithDef, imports.%Test.ForwardWithDef [concrete = constants.%ForwardWithDef.type]
|
|
// CHECK:STDOUT: %i: %ForwardWithDef.type = wrapper_binding i, %i.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @ForwardWithDef [from "forward_with_def.carbon"] {
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = imports.%Test.import_ref.223
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !requires:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%i.param: %ForwardWithDef.type) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @ForwardWithDef.WithSelf(constants.%Self) {
|
|
// CHECK:STDOUT: !definition:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_local_forward_with_def.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .ForwardWithDef = <poisoned>
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
|
// CHECK:STDOUT: %i.param_patt: <error> = value_param_pattern [concrete = <error>]
|
|
// CHECK:STDOUT: %i.patt: <error> = wrapper_binding_pattern i, %i.param_patt [concrete = <error>]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %i.param: <error> = value_param call_param0
|
|
// CHECK:STDOUT: %ForwardWithDef.ref: <error> = name_ref ForwardWithDef, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: %i: <error> = wrapper_binding i, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%i.param: <error>) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_other_forward_with_def.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Test: <namespace> = namespace file.%Test.import, [concrete] {
|
|
// CHECK:STDOUT: .ForwardWithDef = <poisoned>
|
|
// CHECK:STDOUT: import Test//forward_with_def
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Test = imports.%Test
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Test.import = import Test
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
|
// CHECK:STDOUT: %i.param_patt: <error> = value_param_pattern [concrete = <error>]
|
|
// CHECK:STDOUT: %i.patt: <error> = wrapper_binding_pattern i, %i.param_patt [concrete = <error>]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %i.param: <error> = value_param call_param0
|
|
// CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
|
|
// CHECK:STDOUT: %Test.ref: <namespace> = name_ref Test, imports.%Test [concrete = imports.%Test]
|
|
// CHECK:STDOUT: %ForwardWithDef.ref: <error> = name_ref ForwardWithDef, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %i: <error> = wrapper_binding i, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%i.param: <error>) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_todo_forward.impl.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: %Forward.type: type = facet_type <@Forward> [concrete]
|
|
// CHECK:STDOUT: %Self: %Forward.type = symbolic_binding Self, 0 [symbolic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Forward = <poisoned>
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Test.import = import Test
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
|
// CHECK:STDOUT: %i.param_patt: <error> = value_param_pattern [concrete = <error>]
|
|
// CHECK:STDOUT: %i.patt: <error> = wrapper_binding_pattern i, %i.param_patt [concrete = <error>]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %i.param: <error> = value_param call_param0
|
|
// CHECK:STDOUT: %.loc21: type = splice_block %ptr [concrete = <error>] {
|
|
// CHECK:STDOUT: %Forward.ref: <error> = name_ref Forward, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: %ptr: type = ptr_type <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %i: <error> = wrapper_binding i, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Forward.decl: type = interface_decl @Forward [concrete = constants.%Forward.type] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @Forward {
|
|
// CHECK:STDOUT: %Self: %Forward.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
|
|
// CHECK:STDOUT: %Forward.WithSelf.decl = interface_with_self_decl @Forward [concrete]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !requires:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%i.param: <error>) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @Forward.WithSelf(constants.%Self) {}
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_local_forward.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Forward = <poisoned>
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %default.import = import <none>
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
|
// CHECK:STDOUT: %i.param_patt: <error> = value_param_pattern [concrete = <error>]
|
|
// CHECK:STDOUT: %i.patt: <error> = wrapper_binding_pattern i, %i.param_patt [concrete = <error>]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %i.param: <error> = value_param call_param0
|
|
// CHECK:STDOUT: %.loc12: type = splice_block %ptr [concrete = <error>] {
|
|
// CHECK:STDOUT: %Forward.ref: <error> = name_ref Forward, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: %ptr: type = ptr_type <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %i: <error> = wrapper_binding i, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%i.param: <error>) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_other_forward.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Test: <namespace> = namespace file.%Test.import, [concrete] {
|
|
// CHECK:STDOUT: import Test//forward
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Test = imports.%Test
|
|
// CHECK:STDOUT: .Forward = <poisoned>
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Test.import = import Test
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
|
// CHECK:STDOUT: %i.param_patt: <error> = value_param_pattern [concrete = <error>]
|
|
// CHECK:STDOUT: %i.patt: <error> = wrapper_binding_pattern i, %i.param_patt [concrete = <error>]
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %i.param: <error> = value_param call_param0
|
|
// CHECK:STDOUT: %.loc12: type = splice_block %ptr [concrete = <error>] {
|
|
// CHECK:STDOUT: %Forward.ref: <error> = name_ref Forward, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: %ptr: type = ptr_type <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %i: <error> = wrapper_binding i, <error> [concrete = <error>]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%i.param: <error>) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- todo_fail_private_on_redecl.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: type: type = facet_type <type> [concrete]
|
|
// CHECK:STDOUT: %Redecl.type: type = facet_type <@Redecl> [concrete]
|
|
// CHECK:STDOUT: %Self: %Redecl.type = symbolic_binding Self, 0 [symbolic]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Redecl [private] = %Redecl.decl.loc4
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Redecl.decl.loc4: type = interface_decl @Redecl [concrete = constants.%Redecl.type] {} {}
|
|
// CHECK:STDOUT: %Redecl.decl.loc6: type = interface_decl @Redecl [concrete = constants.%Redecl.type] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: interface @Redecl {
|
|
// CHECK:STDOUT: %Self: %Redecl.type = symbolic_binding Self, 0 [symbolic = constants.%Self]
|
|
// CHECK:STDOUT: %Redecl.WithSelf.decl = interface_with_self_decl @Redecl [concrete]
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !members:
|
|
// CHECK:STDOUT: .Self = %Self
|
|
// CHECK:STDOUT: witness = ()
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: !requires:
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: specific @Redecl.WithSelf(constants.%Self) {}
|
|
// CHECK:STDOUT:
|