mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 20:00:12 +01:00
759 lines
34 KiB
Plaintext
759 lines
34 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
|
|
//
|
|
// AUTOUPDATE
|
|
// TIP: To test this file alone, run:
|
|
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_abstract.carbon
|
|
// TIP: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_abstract.carbon
|
|
|
|
// --- fail_abstract_field.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
abstract class Abstract {
|
|
}
|
|
|
|
class Contains {
|
|
// CHECK:STDERR: fail_abstract_field.carbon:[[@LINE+7]]:10: error: field has abstract type `Abstract` [AbstractTypeInFieldDecl]
|
|
// CHECK:STDERR: var a: Abstract;
|
|
// CHECK:STDERR: ^~~~~~~~
|
|
// CHECK:STDERR: fail_abstract_field.carbon:[[@LINE-7]]:1: note: class was declared abstract here [ClassAbstractHere]
|
|
// CHECK:STDERR: abstract class Abstract {
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// CHECK:STDERR:
|
|
var a: Abstract;
|
|
}
|
|
|
|
// --- fail_abstract_var.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
abstract class Abstract {
|
|
}
|
|
|
|
fn Var() {
|
|
// CHECK:STDERR: fail_abstract_var.carbon:[[@LINE+7]]:10: error: variable has abstract type `Abstract` [AbstractTypeInVarDecl]
|
|
// CHECK:STDERR: var v: Abstract;
|
|
// CHECK:STDERR: ^~~~~~~~
|
|
// CHECK:STDERR: fail_abstract_var.carbon:[[@LINE-7]]:1: note: class was declared abstract here [ClassAbstractHere]
|
|
// CHECK:STDERR: abstract class Abstract {
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// CHECK:STDERR:
|
|
var v: Abstract;
|
|
}
|
|
|
|
// --- abstract_let.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
abstract class Abstract {
|
|
}
|
|
|
|
fn F(a: Abstract) {
|
|
let l: Abstract = a;
|
|
}
|
|
|
|
// --- fail_abstract_adapter.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
abstract class Abstract {
|
|
}
|
|
|
|
class Adapter {
|
|
// TODO(#4387): This should probably be valid
|
|
// CHECK:STDERR: fail_abstract_adapter.carbon:[[@LINE+7]]:3: error: adapted type `Abstract` is an abstract type [AbstractTypeInAdaptDecl]
|
|
// CHECK:STDERR: adapt Abstract;
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~
|
|
// CHECK:STDERR: fail_abstract_adapter.carbon:[[@LINE-8]]:1: note: class was declared abstract here [ClassAbstractHere]
|
|
// CHECK:STDERR: abstract class Abstract {
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// CHECK:STDERR:
|
|
adapt Abstract;
|
|
}
|
|
|
|
// --- define_and_call_abstract_param.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
abstract class Abstract {
|
|
}
|
|
|
|
fn Param(a: Abstract);
|
|
|
|
fn Call(p: Abstract) {
|
|
Param(p);
|
|
}
|
|
|
|
// --- fail_todo_return_nonabstract_derived.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
abstract class Abstract {
|
|
}
|
|
|
|
class Derived {
|
|
extend base: Abstract;
|
|
|
|
var d: i32;
|
|
}
|
|
|
|
fn Make() -> Derived {
|
|
// TODO: This should be valid, and should construct an instance of `partial Abstract` as the base.
|
|
// CHECK:STDERR: fail_todo_return_nonabstract_derived.carbon:[[@LINE+7]]:10: error: initialization of abstract type `Abstract` [AbstractTypeInInit]
|
|
// CHECK:STDERR: return {.base = {.a = 1}, .d = 7};
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// CHECK:STDERR: fail_todo_return_nonabstract_derived.carbon:[[@LINE-14]]:1: note: class was declared abstract here [ClassAbstractHere]
|
|
// CHECK:STDERR: abstract class Abstract {
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// CHECK:STDERR:
|
|
return {.base = {.a = 1}, .d = 7};
|
|
}
|
|
|
|
// --- fail_return_abstract.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
abstract class Abstract {
|
|
}
|
|
|
|
class Derived {
|
|
extend base: Abstract;
|
|
|
|
var d: i32;
|
|
}
|
|
|
|
fn Return(a: Abstract) -> Abstract {
|
|
// TODO: Seems like this would be better off failing with "function returns abstract type" here instead of this \/
|
|
// CHECK:STDERR: fail_return_abstract.carbon:[[@LINE+7]]:3: error: initialization of abstract type `Abstract` [AbstractTypeInInit]
|
|
// CHECK:STDERR: return a;
|
|
// CHECK:STDERR: ^~~~~~~~~
|
|
// CHECK:STDERR: fail_return_abstract.carbon:[[@LINE-14]]:1: note: class was declared abstract here [ClassAbstractHere]
|
|
// CHECK:STDERR: abstract class Abstract {
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// CHECK:STDERR:
|
|
return a;
|
|
}
|
|
|
|
// --- access_abstract_subobject.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
abstract class Abstract {
|
|
var a: i32;
|
|
}
|
|
|
|
class Derived {
|
|
extend base: Abstract;
|
|
|
|
var d: i32;
|
|
}
|
|
|
|
fn Access(d: Derived) -> i32 {
|
|
return d.base.a;
|
|
}
|
|
|
|
// --- abstract_let_temporary.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
abstract class Abstract {
|
|
}
|
|
|
|
fn F() {
|
|
let l: Abstract = {};
|
|
}
|
|
|
|
// --- fail_call_abstract_return.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
abstract class Abstract {
|
|
}
|
|
|
|
fn ReturnAbstract() -> Abstract;
|
|
|
|
fn CallReturnAbstract() {
|
|
// CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE+10]]:3: error: function returns abstract type `Abstract` [AbstractTypeInFunctionReturnType]
|
|
// CHECK:STDERR: ReturnAbstract();
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
|
// CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE-9]]:1: note: class was declared abstract here [ClassAbstractHere]
|
|
// CHECK:STDERR: abstract class Abstract {
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// CHECK:STDERR: fail_call_abstract_return.carbon:[[@LINE-9]]:21: note: return type declared here [IncompleteReturnTypeHere]
|
|
// CHECK:STDERR: fn ReturnAbstract() -> Abstract;
|
|
// CHECK:STDERR: ^~~~~~~~~~~
|
|
// CHECK:STDERR:
|
|
ReturnAbstract();
|
|
}
|
|
|
|
// CHECK:STDOUT: --- fail_abstract_field.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
|
|
// CHECK:STDOUT: %Contains: type = class_type @Contains [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .Abstract = %Abstract.decl
|
|
// CHECK:STDOUT: .Contains = %Contains.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
|
|
// CHECK:STDOUT: %Contains.decl: type = class_decl @Contains [template = constants.%Contains] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Abstract {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Contains {
|
|
// CHECK:STDOUT: %.loc15_8: <error> = field_decl a, element0 [template]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %.loc15_3: <error> = var_pattern %.loc15_8
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.var: ref <error> = var <invalid>
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness <error> [template = <error>]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_abstract_var.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
|
|
// CHECK:STDOUT: %Var.type: type = fn_type @Var [template]
|
|
// CHECK:STDOUT: %Var: %Var.type = struct_value () [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .Abstract = %Abstract.decl
|
|
// CHECK:STDOUT: .Var = %Var.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
|
|
// CHECK:STDOUT: %Var.decl: %Var.type = fn_decl @Var [template = constants.%Var] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Abstract {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @Var() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %v.patt: <error> = binding_pattern v
|
|
// CHECK:STDOUT: %.loc15: <error> = var_pattern %v.patt
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %v.var: ref <error> = var v
|
|
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %v: <error> = bind_name v, <error>
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- abstract_let.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .Abstract = %Abstract.decl
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
|
|
// CHECK:STDOUT: %a.patt: %Abstract = binding_pattern a
|
|
// CHECK:STDOUT: %a.param_patt: %Abstract = value_param_pattern %a.patt, runtime_param0
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %a.param: %Abstract = value_param runtime_param0
|
|
// CHECK:STDOUT: %Abstract.ref.loc7: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Abstract {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F(%a.param_patt: %Abstract) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %l.patt: %Abstract = binding_pattern l
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %a.ref: %Abstract = name_ref a, %a
|
|
// CHECK:STDOUT: %Abstract.ref.loc8: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %l: %Abstract = bind_name l, <error>
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_abstract_adapter.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
|
|
// CHECK:STDOUT: %Adapter: type = class_type @Adapter [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .Abstract = %Abstract.decl
|
|
// CHECK:STDOUT: .Adapter = %Adapter.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
|
|
// CHECK:STDOUT: %Adapter.decl: type = class_decl @Adapter [template = constants.%Adapter] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Abstract {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Adapter {
|
|
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: adapt_decl <error> [template]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness <error> [template = <error>]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- define_and_call_abstract_param.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
|
|
// CHECK:STDOUT: %Param.type: type = fn_type @Param [template]
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
|
|
// CHECK:STDOUT: %Param: %Param.type = struct_value () [template]
|
|
// CHECK:STDOUT: %Call.type: type = fn_type @Call [template]
|
|
// CHECK:STDOUT: %Call: %Call.type = struct_value () [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .Abstract = %Abstract.decl
|
|
// CHECK:STDOUT: .Param = %Param.decl
|
|
// CHECK:STDOUT: .Call = %Call.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
|
|
// CHECK:STDOUT: %Param.decl: %Param.type = fn_decl @Param [template = constants.%Param] {
|
|
// CHECK:STDOUT: %a.patt: %Abstract = binding_pattern a
|
|
// CHECK:STDOUT: %a.param_patt: %Abstract = value_param_pattern %a.patt, runtime_param0
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %a.param: %Abstract = value_param runtime_param0
|
|
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Call.decl: %Call.type = fn_decl @Call [template = constants.%Call] {
|
|
// CHECK:STDOUT: %p.patt: %Abstract = binding_pattern p
|
|
// CHECK:STDOUT: %p.param_patt: %Abstract = value_param_pattern %p.patt, runtime_param0
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %p.param: %Abstract = value_param runtime_param0
|
|
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %p: %Abstract = bind_name p, %p.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Abstract {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @Param(%a.param_patt: %Abstract);
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @Call(%p.param_patt: %Abstract) {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %Param.ref: %Param.type = name_ref Param, file.%Param.decl [template = constants.%Param]
|
|
// CHECK:STDOUT: %p.ref: %Abstract = name_ref p, %p
|
|
// CHECK:STDOUT: %Param.call: init %empty_tuple.type = call %Param.ref(<error>)
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_todo_return_nonabstract_derived.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
|
|
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
|
|
// CHECK:STDOUT: %Derived: type = class_type @Derived [template]
|
|
// CHECK:STDOUT: %Derived.elem.513: type = unbound_element_type %Derived, %Abstract [template]
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
|
|
// CHECK:STDOUT: %Derived.elem.344: type = unbound_element_type %Derived, %i32 [template]
|
|
// CHECK:STDOUT: %struct_type.base.d.c44: type = struct_type {.base: %Abstract, .d: %i32} [template]
|
|
// CHECK:STDOUT: %complete_type.32a: <witness> = complete_type_witness %struct_type.base.d.c44 [template]
|
|
// CHECK:STDOUT: %Make.type: type = fn_type @Make [template]
|
|
// CHECK:STDOUT: %Make: %Make.type = struct_value () [template]
|
|
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
|
|
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: Core.IntLiteral} [template]
|
|
// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template]
|
|
// CHECK:STDOUT: %struct_type.base.d.9c6: type = struct_type {.base: %struct_type.a, .d: Core.IntLiteral} [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: .Int = %import_ref.485
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .Abstract = %Abstract.decl
|
|
// CHECK:STDOUT: .Derived = %Derived.decl
|
|
// CHECK:STDOUT: .Make = %Make.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
|
|
// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {}
|
|
// CHECK:STDOUT: %Make.decl: %Make.type = fn_decl @Make [template = constants.%Make] {
|
|
// CHECK:STDOUT: %return.patt: %Derived = return_slot_pattern
|
|
// CHECK:STDOUT: %return.param_patt: %Derived = out_param_pattern %return.patt, runtime_param0
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived]
|
|
// CHECK:STDOUT: %return.param: ref %Derived = out_param runtime_param0
|
|
// CHECK:STDOUT: %return: ref %Derived = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Abstract {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Derived {
|
|
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %.loc8: %Derived.elem.513 = base_decl %Abstract.ref, element0 [template]
|
|
// CHECK:STDOUT: %.loc10_8: %Derived.elem.344 = field_decl d, element1 [template]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %.loc10_3: %Derived.elem.344 = var_pattern %.loc10_8
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.var: ref %Derived.elem.344 = var <invalid>
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base.d.c44 [template = constants.%complete_type.32a]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @Make() -> %return.param_patt: %Derived {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
|
// CHECK:STDOUT: %.loc22_26: %struct_type.a = struct_literal (%int_1)
|
|
// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [template = constants.%int_7]
|
|
// CHECK:STDOUT: %.loc22_35: %struct_type.base.d.9c6 = struct_literal (%.loc22_26, %int_7)
|
|
// CHECK:STDOUT: return <error> to %return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_return_abstract.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
|
|
// CHECK:STDOUT: %complete_type.357: <witness> = complete_type_witness %empty_struct_type [template]
|
|
// CHECK:STDOUT: %Derived: type = class_type @Derived [template]
|
|
// CHECK:STDOUT: %Derived.elem.513: type = unbound_element_type %Derived, %Abstract [template]
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
|
|
// CHECK:STDOUT: %Derived.elem.344: type = unbound_element_type %Derived, %i32 [template]
|
|
// CHECK:STDOUT: %struct_type.base.d: type = struct_type {.base: %Abstract, .d: %i32} [template]
|
|
// CHECK:STDOUT: %complete_type.32a: <witness> = complete_type_witness %struct_type.base.d [template]
|
|
// CHECK:STDOUT: %Return.type: type = fn_type @Return [template]
|
|
// CHECK:STDOUT: %Return: %Return.type = struct_value () [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: .Int = %import_ref.485
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .Abstract = %Abstract.decl
|
|
// CHECK:STDOUT: .Derived = %Derived.decl
|
|
// CHECK:STDOUT: .Return = %Return.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
|
|
// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {}
|
|
// CHECK:STDOUT: %Return.decl: %Return.type = fn_decl @Return [template = constants.%Return] {
|
|
// CHECK:STDOUT: %a.patt: %Abstract = binding_pattern a
|
|
// CHECK:STDOUT: %a.param_patt: %Abstract = value_param_pattern %a.patt, runtime_param0
|
|
// CHECK:STDOUT: %return.patt: %Abstract = return_slot_pattern
|
|
// CHECK:STDOUT: %return.param_patt: %Abstract = out_param_pattern %return.patt, runtime_param1
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %Abstract.ref.loc13_27: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %a.param: %Abstract = value_param runtime_param0
|
|
// CHECK:STDOUT: %Abstract.ref.loc13_14: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %a: %Abstract = bind_name a, %a.param
|
|
// CHECK:STDOUT: %return.param: ref %Abstract = out_param runtime_param1
|
|
// CHECK:STDOUT: %return: ref %Abstract = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Abstract {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type.357]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Derived {
|
|
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %.loc8: %Derived.elem.513 = base_decl %Abstract.ref, element0 [template]
|
|
// CHECK:STDOUT: %.loc10_8: %Derived.elem.344 = field_decl d, element1 [template]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %.loc10_3: %Derived.elem.344 = var_pattern %.loc10_8
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.var: ref %Derived.elem.344 = var <invalid>
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base.d [template = constants.%complete_type.32a]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @Return(%a.param_patt: %Abstract) -> %return.param_patt: %Abstract {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %a.ref: %Abstract = name_ref a, %a
|
|
// CHECK:STDOUT: return <error> to %return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- access_abstract_subobject.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
|
|
// CHECK:STDOUT: %Abstract.elem: type = unbound_element_type %Abstract, %i32 [template]
|
|
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template]
|
|
// CHECK:STDOUT: %complete_type.fd7: <witness> = complete_type_witness %struct_type.a [template]
|
|
// CHECK:STDOUT: %Derived: type = class_type @Derived [template]
|
|
// CHECK:STDOUT: %Derived.elem.513: type = unbound_element_type %Derived, %Abstract [template]
|
|
// CHECK:STDOUT: %Derived.elem.344: type = unbound_element_type %Derived, %i32 [template]
|
|
// CHECK:STDOUT: %struct_type.base.d.c44: type = struct_type {.base: %Abstract, .d: %i32} [template]
|
|
// CHECK:STDOUT: %complete_type.32a: <witness> = complete_type_witness %struct_type.base.d.c44 [template]
|
|
// CHECK:STDOUT: %Access.type: type = fn_type @Access [template]
|
|
// CHECK:STDOUT: %Access: %Access.type = struct_value () [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: .Int = %import_ref.485
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .Abstract = %Abstract.decl
|
|
// CHECK:STDOUT: .Derived = %Derived.decl
|
|
// CHECK:STDOUT: .Access = %Access.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
|
|
// CHECK:STDOUT: %Derived.decl: type = class_decl @Derived [template = constants.%Derived] {} {}
|
|
// CHECK:STDOUT: %Access.decl: %Access.type = fn_decl @Access [template = constants.%Access] {
|
|
// CHECK:STDOUT: %d.patt: %Derived = binding_pattern d
|
|
// CHECK:STDOUT: %d.param_patt: %Derived = value_param_pattern %d.patt, runtime_param0
|
|
// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
|
|
// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
|
// CHECK:STDOUT: %d.param: %Derived = value_param runtime_param0
|
|
// CHECK:STDOUT: %Derived.ref: type = name_ref Derived, file.%Derived.decl [template = constants.%Derived]
|
|
// CHECK:STDOUT: %d: %Derived = bind_name d, %d.param
|
|
// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1
|
|
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Abstract {
|
|
// CHECK:STDOUT: %.loc5_8: %Abstract.elem = field_decl a, element0 [template]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %.loc5_3: %Abstract.elem = var_pattern %.loc5_8
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.var: ref %Abstract.elem = var <invalid>
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.a [template = constants.%complete_type.fd7]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Derived {
|
|
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %.loc9: %Derived.elem.513 = base_decl %Abstract.ref, element0 [template]
|
|
// CHECK:STDOUT: %.loc11_8: %Derived.elem.344 = field_decl d, element1 [template]
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %.loc11_3: %Derived.elem.344 = var_pattern %.loc11_8
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.var: ref %Derived.elem.344 = var <invalid>
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.base.d.c44 [template = constants.%complete_type.32a]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @Access(%d.param_patt: %Derived) -> %i32 {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %d.ref: %Derived = name_ref d, %d
|
|
// CHECK:STDOUT: %base.ref: %Derived.elem.513 = name_ref base, @Derived.%.loc9 [template = @Derived.%.loc9]
|
|
// CHECK:STDOUT: %.loc15: ref %Abstract = class_element_access %d.ref, element0
|
|
// CHECK:STDOUT: %a.ref: <error> = name_ref a, <error> [template = <error>]
|
|
// CHECK:STDOUT: return <error>
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- abstract_let_temporary.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
|
|
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
|
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .Abstract = %Abstract.decl
|
|
// CHECK:STDOUT: .F = %F.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
|
|
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Abstract {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @F() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: name_binding_decl {
|
|
// CHECK:STDOUT: %l.patt: %Abstract = binding_pattern l
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %.loc8: %empty_struct_type = struct_literal ()
|
|
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %l: %Abstract = bind_name l, <error>
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: --- fail_call_abstract_return.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: constants {
|
|
// CHECK:STDOUT: %Abstract: type = class_type @Abstract [template]
|
|
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template]
|
|
// CHECK:STDOUT: %ReturnAbstract.type: type = fn_type @ReturnAbstract [template]
|
|
// CHECK:STDOUT: %ReturnAbstract: %ReturnAbstract.type = struct_value () [template]
|
|
// CHECK:STDOUT: %CallReturnAbstract.type: type = fn_type @CallReturnAbstract [template]
|
|
// CHECK:STDOUT: %CallReturnAbstract: %CallReturnAbstract.type = struct_value () [template]
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
|
|
// CHECK:STDOUT: import Core//prelude
|
|
// CHECK:STDOUT: import Core//prelude/...
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
|
// CHECK:STDOUT: .Core = imports.%Core
|
|
// CHECK:STDOUT: .Abstract = %Abstract.decl
|
|
// CHECK:STDOUT: .ReturnAbstract = %ReturnAbstract.decl
|
|
// CHECK:STDOUT: .CallReturnAbstract = %CallReturnAbstract.decl
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Core.import = import Core
|
|
// CHECK:STDOUT: %Abstract.decl: type = class_decl @Abstract [template = constants.%Abstract] {} {}
|
|
// CHECK:STDOUT: %ReturnAbstract.decl: %ReturnAbstract.type = fn_decl @ReturnAbstract [template = constants.%ReturnAbstract] {
|
|
// CHECK:STDOUT: %return.patt: %Abstract = return_slot_pattern
|
|
// CHECK:STDOUT: %return.param_patt: %Abstract = out_param_pattern %return.patt, runtime_param0
|
|
// CHECK:STDOUT: } {
|
|
// CHECK:STDOUT: %Abstract.ref: type = name_ref Abstract, file.%Abstract.decl [template = constants.%Abstract]
|
|
// CHECK:STDOUT: %return.param: ref %Abstract = out_param runtime_param0
|
|
// CHECK:STDOUT: %return: ref %Abstract = return_slot %return.param
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %CallReturnAbstract.decl: %CallReturnAbstract.type = fn_decl @CallReturnAbstract [template = constants.%CallReturnAbstract] {} {}
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: class @Abstract {
|
|
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [template = constants.%complete_type]
|
|
// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @ReturnAbstract() -> %Abstract;
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: fn @CallReturnAbstract() {
|
|
// CHECK:STDOUT: !entry:
|
|
// CHECK:STDOUT: %ReturnAbstract.ref: %ReturnAbstract.type = name_ref ReturnAbstract, file.%ReturnAbstract.decl [template = constants.%ReturnAbstract]
|
|
// CHECK:STDOUT: %ReturnAbstract.call: init <error> = call %ReturnAbstract.ref()
|
|
// CHECK:STDOUT: return
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|