|
|
@@ -3,8 +3,6 @@
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
//
|
|
|
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/int.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:
|
|
|
@@ -12,6 +10,10 @@
|
|
|
// TIP: To dump output, run:
|
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/derived_to_base.carbon
|
|
|
|
|
|
+// --- basic.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
base class A {
|
|
|
var a: i32;
|
|
|
}
|
|
|
@@ -26,6 +28,7 @@ class C {
|
|
|
var c: i32;
|
|
|
}
|
|
|
|
|
|
+//@dump-sem-ir-begin
|
|
|
fn ConvertCToB(p: C*) -> B* { return p; }
|
|
|
fn ConvertBToA(p: B*) -> A* { return p; }
|
|
|
fn ConvertCToA(p: C*) -> A* { return p; }
|
|
|
@@ -41,46 +44,95 @@ fn ConvertRef(c: C*) -> A* {
|
|
|
fn ConvertInit() {
|
|
|
let a: A = {.base = {.base = {.a = 1}, .b = 2}, .c = 3} as C;
|
|
|
}
|
|
|
+//@dump-sem-ir-end
|
|
|
+
|
|
|
+// --- qualified.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+base class A {
|
|
|
+}
|
|
|
+
|
|
|
+class B {
|
|
|
+ extend base: A;
|
|
|
+}
|
|
|
+
|
|
|
+fn TakeConstAPtr(p: const A*);
|
|
|
+
|
|
|
+fn PassNonConstBPtr(p: B*) {
|
|
|
+ //@dump-sem-ir-begin
|
|
|
+ TakeConstAPtr(p);
|
|
|
+ //@dump-sem-ir-end
|
|
|
+}
|
|
|
+
|
|
|
+fn PassConstBPtr(p: const B*) {
|
|
|
+ //@dump-sem-ir-begin
|
|
|
+ TakeConstAPtr(p);
|
|
|
+ //@dump-sem-ir-end
|
|
|
+}
|
|
|
+
|
|
|
+// --- fail_todo_qualified_non_ptr.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+base class A {
|
|
|
+}
|
|
|
+
|
|
|
+class B {
|
|
|
+ extend base: A;
|
|
|
+}
|
|
|
|
|
|
-// CHECK:STDOUT: --- derived_to_base.carbon
|
|
|
+fn TakeConstA(p: const A);
|
|
|
+
|
|
|
+fn PassNonConstB(p: B) {
|
|
|
+ //@dump-sem-ir-begin
|
|
|
+ // CHECK:STDERR: fail_todo_qualified_non_ptr.carbon:[[@LINE+10]]:14: error: cannot implicitly convert expression of type `B` to `const A` [ConversionFailure]
|
|
|
+ // CHECK:STDERR: TakeConstA(p);
|
|
|
+ // CHECK:STDERR: ^
|
|
|
+ // CHECK:STDERR: fail_todo_qualified_non_ptr.carbon:[[@LINE+7]]:14: note: type `B` does not implement interface `Core.ImplicitAs(const A)` [MissingImplInMemberAccessNote]
|
|
|
+ // CHECK:STDERR: TakeConstA(p);
|
|
|
+ // CHECK:STDERR: ^
|
|
|
+ // CHECK:STDERR: fail_todo_qualified_non_ptr.carbon:[[@LINE-10]]:15: note: initializing function parameter [InCallToFunctionParam]
|
|
|
+ // CHECK:STDERR: fn TakeConstA(p: const A);
|
|
|
+ // CHECK:STDERR: ^~~~~~~~~~
|
|
|
+ // CHECK:STDERR:
|
|
|
+ TakeConstA(p);
|
|
|
+ //@dump-sem-ir-end
|
|
|
+}
|
|
|
+
|
|
|
+fn PassConstB(p: const B) {
|
|
|
+ //@dump-sem-ir-begin
|
|
|
+ // CHECK:STDERR: fail_todo_qualified_non_ptr.carbon:[[@LINE+10]]:14: error: cannot implicitly convert expression of type `const B` to `const A` [ConversionFailure]
|
|
|
+ // CHECK:STDERR: TakeConstA(p);
|
|
|
+ // CHECK:STDERR: ^
|
|
|
+ // CHECK:STDERR: fail_todo_qualified_non_ptr.carbon:[[@LINE+7]]:14: note: type `const B` does not implement interface `Core.ImplicitAs(const A)` [MissingImplInMemberAccessNote]
|
|
|
+ // CHECK:STDERR: TakeConstA(p);
|
|
|
+ // CHECK:STDERR: ^
|
|
|
+ // CHECK:STDERR: fail_todo_qualified_non_ptr.carbon:[[@LINE-26]]:15: note: initializing function parameter [InCallToFunctionParam]
|
|
|
+ // CHECK:STDERR: fn TakeConstA(p: const A);
|
|
|
+ // CHECK:STDERR: ^~~~~~~~~~
|
|
|
+ // CHECK:STDERR:
|
|
|
+ TakeConstA(p);
|
|
|
+ //@dump-sem-ir-end
|
|
|
+}
|
|
|
+
|
|
|
+// CHECK:STDOUT: --- basic.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %A: type = class_type @A [concrete]
|
|
|
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
|
|
-// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete]
|
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
-// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
|
|
-// CHECK:STDOUT: %A.elem: type = unbound_element_type %A, %i32 [concrete]
|
|
|
-// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
|
|
-// CHECK:STDOUT: %pattern_type.f6d: type = pattern_type auto [concrete]
|
|
|
-// CHECK:STDOUT: %Destroy.impl_witness.b44: <witness> = impl_witness @A.%Destroy.impl_witness_table [concrete]
|
|
|
// CHECK:STDOUT: %ptr.6db: type = ptr_type %A [concrete]
|
|
|
// CHECK:STDOUT: %pattern_type.5f8: type = pattern_type %ptr.6db [concrete]
|
|
|
-// CHECK:STDOUT: %A.as.Destroy.impl.Op.type: type = fn_type @A.as.Destroy.impl.Op [concrete]
|
|
|
-// CHECK:STDOUT: %A.as.Destroy.impl.Op: %A.as.Destroy.impl.Op.type = struct_value () [concrete]
|
|
|
-// CHECK:STDOUT: %struct_type.a.ba9: type = struct_type {.a: %i32} [concrete]
|
|
|
-// CHECK:STDOUT: %complete_type.fd7: <witness> = complete_type_witness %struct_type.a.ba9 [concrete]
|
|
|
// CHECK:STDOUT: %B: type = class_type @B [concrete]
|
|
|
-// CHECK:STDOUT: %B.elem.e38: type = unbound_element_type %B, %A [concrete]
|
|
|
-// CHECK:STDOUT: %B.elem.5c3: type = unbound_element_type %B, %i32 [concrete]
|
|
|
-// CHECK:STDOUT: %Destroy.impl_witness.40d: <witness> = impl_witness @B.%Destroy.impl_witness_table [concrete]
|
|
|
// CHECK:STDOUT: %ptr.e79: type = ptr_type %B [concrete]
|
|
|
// CHECK:STDOUT: %pattern_type.960: type = pattern_type %ptr.e79 [concrete]
|
|
|
-// CHECK:STDOUT: %B.as.Destroy.impl.Op.type: type = fn_type @B.as.Destroy.impl.Op [concrete]
|
|
|
-// CHECK:STDOUT: %B.as.Destroy.impl.Op: %B.as.Destroy.impl.Op.type = struct_value () [concrete]
|
|
|
-// CHECK:STDOUT: %struct_type.base.b.b44: type = struct_type {.base: %A, .b: %i32} [concrete]
|
|
|
-// CHECK:STDOUT: %complete_type.725: <witness> = complete_type_witness %struct_type.base.b.b44 [concrete]
|
|
|
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
|
|
-// CHECK:STDOUT: %C.elem.f0c: type = unbound_element_type %C, %B [concrete]
|
|
|
-// CHECK:STDOUT: %C.elem.646: type = unbound_element_type %C, %i32 [concrete]
|
|
|
-// CHECK:STDOUT: %Destroy.impl_witness.edd: <witness> = impl_witness @C.%Destroy.impl_witness_table [concrete]
|
|
|
// CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
|
|
|
// CHECK:STDOUT: %pattern_type.44a: type = pattern_type %ptr.019 [concrete]
|
|
|
// CHECK:STDOUT: %C.as.Destroy.impl.Op.type: type = fn_type @C.as.Destroy.impl.Op [concrete]
|
|
|
// CHECK:STDOUT: %C.as.Destroy.impl.Op: %C.as.Destroy.impl.Op.type = struct_value () [concrete]
|
|
|
-// CHECK:STDOUT: %struct_type.base.c.8e2: type = struct_type {.base: %B, .c: %i32} [concrete]
|
|
|
-// CHECK:STDOUT: %complete_type.58a: <witness> = complete_type_witness %struct_type.base.c.8e2 [concrete]
|
|
|
// CHECK:STDOUT: %ConvertCToB.type: type = fn_type @ConvertCToB [concrete]
|
|
|
// CHECK:STDOUT: %ConvertCToB: %ConvertCToB.type = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: %ConvertBToA.type: type = fn_type @ConvertBToA [concrete]
|
|
|
@@ -101,8 +153,6 @@ fn ConvertInit() {
|
|
|
// CHECK:STDOUT: %struct_type.base.b.bf0: type = struct_type {.base: %struct_type.a.a6c, .b: Core.IntLiteral} [concrete]
|
|
|
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
|
|
|
// CHECK:STDOUT: %struct_type.base.c.136: type = struct_type {.base: %struct_type.base.b.bf0, .c: Core.IntLiteral} [concrete]
|
|
|
-// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
|
|
|
-// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
|
|
|
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
|
|
// CHECK:STDOUT: %ImplicitAs.Convert.type.1b6: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%i32) [concrete]
|
|
|
// CHECK:STDOUT: %To: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
|
|
|
@@ -129,37 +179,11 @@ fn ConvertInit() {
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: imports {
|
|
|
-// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
|
|
-// CHECK:STDOUT: .Int = %Core.Int
|
|
|
-// CHECK:STDOUT: .Destroy = %Core.Destroy
|
|
|
-// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
|
|
-// CHECK:STDOUT: import Core//prelude
|
|
|
-// CHECK:STDOUT: import Core//prelude/...
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/parts/int, Int, loaded [concrete = constants.%Int.generic]
|
|
|
-// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
|
|
|
-// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/parts/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
|
|
|
// CHECK:STDOUT: %Core.import_ref.a5b: @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert.type (%Core.IntLiteral.as.ImplicitAs.impl.Convert.type.0f9) = import_ref Core//prelude/parts/int, loc16_39, loaded [symbolic = @Core.IntLiteral.as.ImplicitAs.impl.%Core.IntLiteral.as.ImplicitAs.impl.Convert (constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f06)]
|
|
|
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @Core.IntLiteral.as.ImplicitAs.impl [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: file {
|
|
|
-// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
|
-// CHECK:STDOUT: .Core = imports.%Core
|
|
|
-// CHECK:STDOUT: .A = %A.decl
|
|
|
-// CHECK:STDOUT: .B = %B.decl
|
|
|
-// CHECK:STDOUT: .C = %C.decl
|
|
|
-// CHECK:STDOUT: .ConvertCToB = %ConvertCToB.decl
|
|
|
-// CHECK:STDOUT: .ConvertBToA = %ConvertBToA.decl
|
|
|
-// CHECK:STDOUT: .ConvertCToA = %ConvertCToA.decl
|
|
|
-// CHECK:STDOUT: .ConvertValue = %ConvertValue.decl
|
|
|
-// CHECK:STDOUT: .ConvertRef = %ConvertRef.decl
|
|
|
-// CHECK:STDOUT: .ConvertInit = %ConvertInit.decl
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT: %Core.import = import Core
|
|
|
-// CHECK:STDOUT: %A.decl: type = class_decl @A [concrete = constants.%A] {} {}
|
|
|
-// CHECK:STDOUT: %B.decl: type = class_decl @B [concrete = constants.%B] {} {}
|
|
|
-// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
|
|
// CHECK:STDOUT: %ConvertCToB.decl: %ConvertCToB.type = fn_decl @ConvertCToB [concrete = constants.%ConvertCToB] {
|
|
|
// CHECK:STDOUT: %p.patt: %pattern_type.44a = binding_pattern p [concrete]
|
|
|
// CHECK:STDOUT: %p.param_patt: %pattern_type.44a = value_param_pattern %p.patt, call_param0 [concrete]
|
|
|
@@ -167,11 +191,11 @@ fn ConvertInit() {
|
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.960 = out_param_pattern %return.patt, call_param1 [concrete]
|
|
|
// CHECK:STDOUT: } {
|
|
|
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
|
|
|
-// CHECK:STDOUT: %ptr.loc29_27: type = ptr_type %B.ref [concrete = constants.%ptr.e79]
|
|
|
+// CHECK:STDOUT: %ptr.loc19_27: type = ptr_type %B.ref [concrete = constants.%ptr.e79]
|
|
|
// CHECK:STDOUT: %p.param: %ptr.019 = value_param call_param0
|
|
|
-// CHECK:STDOUT: %.loc29_20: type = splice_block %ptr.loc29_20 [concrete = constants.%ptr.019] {
|
|
|
+// CHECK:STDOUT: %.loc19_20: type = splice_block %ptr.loc19_20 [concrete = constants.%ptr.019] {
|
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
|
-// CHECK:STDOUT: %ptr.loc29_20: type = ptr_type %C.ref [concrete = constants.%ptr.019]
|
|
|
+// CHECK:STDOUT: %ptr.loc19_20: type = ptr_type %C.ref [concrete = constants.%ptr.019]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %p: %ptr.019 = bind_name p, %p.param
|
|
|
// CHECK:STDOUT: %return.param: ref %ptr.e79 = out_param call_param1
|
|
|
@@ -184,11 +208,11 @@ fn ConvertInit() {
|
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.5f8 = out_param_pattern %return.patt, call_param1 [concrete]
|
|
|
// CHECK:STDOUT: } {
|
|
|
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
|
|
-// CHECK:STDOUT: %ptr.loc30_27: type = ptr_type %A.ref [concrete = constants.%ptr.6db]
|
|
|
+// CHECK:STDOUT: %ptr.loc20_27: type = ptr_type %A.ref [concrete = constants.%ptr.6db]
|
|
|
// CHECK:STDOUT: %p.param: %ptr.e79 = value_param call_param0
|
|
|
-// CHECK:STDOUT: %.loc30_20: type = splice_block %ptr.loc30_20 [concrete = constants.%ptr.e79] {
|
|
|
+// CHECK:STDOUT: %.loc20_20: type = splice_block %ptr.loc20_20 [concrete = constants.%ptr.e79] {
|
|
|
// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
|
|
|
-// CHECK:STDOUT: %ptr.loc30_20: type = ptr_type %B.ref [concrete = constants.%ptr.e79]
|
|
|
+// CHECK:STDOUT: %ptr.loc20_20: type = ptr_type %B.ref [concrete = constants.%ptr.e79]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %p: %ptr.e79 = bind_name p, %p.param
|
|
|
// CHECK:STDOUT: %return.param: ref %ptr.6db = out_param call_param1
|
|
|
@@ -201,11 +225,11 @@ fn ConvertInit() {
|
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.5f8 = out_param_pattern %return.patt, call_param1 [concrete]
|
|
|
// CHECK:STDOUT: } {
|
|
|
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
|
|
-// CHECK:STDOUT: %ptr.loc31_27: type = ptr_type %A.ref [concrete = constants.%ptr.6db]
|
|
|
+// CHECK:STDOUT: %ptr.loc21_27: type = ptr_type %A.ref [concrete = constants.%ptr.6db]
|
|
|
// CHECK:STDOUT: %p.param: %ptr.019 = value_param call_param0
|
|
|
-// CHECK:STDOUT: %.loc31_20: type = splice_block %ptr.loc31_20 [concrete = constants.%ptr.019] {
|
|
|
+// CHECK:STDOUT: %.loc21_20: type = splice_block %ptr.loc21_20 [concrete = constants.%ptr.019] {
|
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
|
-// CHECK:STDOUT: %ptr.loc31_20: type = ptr_type %C.ref [concrete = constants.%ptr.019]
|
|
|
+// CHECK:STDOUT: %ptr.loc21_20: type = ptr_type %C.ref [concrete = constants.%ptr.019]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %p: %ptr.019 = bind_name p, %p.param
|
|
|
// CHECK:STDOUT: %return.param: ref %ptr.6db = out_param call_param1
|
|
|
@@ -225,12 +249,12 @@ fn ConvertInit() {
|
|
|
// CHECK:STDOUT: %return.patt: %pattern_type.5f8 = return_slot_pattern [concrete]
|
|
|
// CHECK:STDOUT: %return.param_patt: %pattern_type.5f8 = out_param_pattern %return.patt, call_param1 [concrete]
|
|
|
// CHECK:STDOUT: } {
|
|
|
-// CHECK:STDOUT: %A.ref.loc37: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
|
|
-// CHECK:STDOUT: %ptr.loc37_26: type = ptr_type %A.ref.loc37 [concrete = constants.%ptr.6db]
|
|
|
+// CHECK:STDOUT: %A.ref.loc27: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
|
|
+// CHECK:STDOUT: %ptr.loc27_26: type = ptr_type %A.ref.loc27 [concrete = constants.%ptr.6db]
|
|
|
// CHECK:STDOUT: %c.param: %ptr.019 = value_param call_param0
|
|
|
-// CHECK:STDOUT: %.loc37: type = splice_block %ptr.loc37_19 [concrete = constants.%ptr.019] {
|
|
|
+// CHECK:STDOUT: %.loc27: type = splice_block %ptr.loc27_19 [concrete = constants.%ptr.019] {
|
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
|
-// CHECK:STDOUT: %ptr.loc37_19: type = ptr_type %C.ref [concrete = constants.%ptr.019]
|
|
|
+// CHECK:STDOUT: %ptr.loc27_19: type = ptr_type %C.ref [concrete = constants.%ptr.019]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %c: %ptr.019 = bind_name c, %c.param
|
|
|
// CHECK:STDOUT: %return.param: ref %ptr.6db = out_param call_param1
|
|
|
@@ -239,147 +263,35 @@ fn ConvertInit() {
|
|
|
// CHECK:STDOUT: %ConvertInit.decl: %ConvertInit.type = fn_decl @ConvertInit [concrete = constants.%ConvertInit] {} {}
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: impl @A.as.Destroy.impl: @A.%Self.ref as constants.%Destroy.type {
|
|
|
-// CHECK:STDOUT: %A.as.Destroy.impl.Op.decl: %A.as.Destroy.impl.Op.type = fn_decl @A.as.Destroy.impl.Op [concrete = constants.%A.as.Destroy.impl.Op] {
|
|
|
-// CHECK:STDOUT: %self.patt: %pattern_type.5f8 = binding_pattern self [concrete]
|
|
|
-// CHECK:STDOUT: %self.param_patt: %pattern_type.5f8 = value_param_pattern %self.patt, call_param0 [concrete]
|
|
|
-// CHECK:STDOUT: %.loc15: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
|
|
|
-// CHECK:STDOUT: } {
|
|
|
-// CHECK:STDOUT: %self.param: %ptr.6db = value_param call_param0
|
|
|
-// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%A [concrete = constants.%A]
|
|
|
-// CHECK:STDOUT: %self: %ptr.6db = bind_name self, %self.param
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: !members:
|
|
|
-// CHECK:STDOUT: .Op = %A.as.Destroy.impl.Op.decl
|
|
|
-// CHECK:STDOUT: witness = @A.%Destroy.impl_witness
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: impl @B.as.Destroy.impl: @B.%Self.ref as constants.%Destroy.type {
|
|
|
-// CHECK:STDOUT: %B.as.Destroy.impl.Op.decl: %B.as.Destroy.impl.Op.type = fn_decl @B.as.Destroy.impl.Op [concrete = constants.%B.as.Destroy.impl.Op] {
|
|
|
-// CHECK:STDOUT: %self.patt: %pattern_type.960 = binding_pattern self [concrete]
|
|
|
-// CHECK:STDOUT: %self.param_patt: %pattern_type.960 = value_param_pattern %self.patt, call_param0 [concrete]
|
|
|
-// CHECK:STDOUT: %.loc19: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
|
|
|
-// CHECK:STDOUT: } {
|
|
|
-// CHECK:STDOUT: %self.param: %ptr.e79 = value_param call_param0
|
|
|
-// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [concrete = constants.%B]
|
|
|
-// CHECK:STDOUT: %self: %ptr.e79 = bind_name self, %self.param
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: !members:
|
|
|
-// CHECK:STDOUT: .Op = %B.as.Destroy.impl.Op.decl
|
|
|
-// CHECK:STDOUT: witness = @B.%Destroy.impl_witness
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: impl @C.as.Destroy.impl: @C.%Self.ref as constants.%Destroy.type {
|
|
|
-// CHECK:STDOUT: %C.as.Destroy.impl.Op.decl: %C.as.Destroy.impl.Op.type = fn_decl @C.as.Destroy.impl.Op [concrete = constants.%C.as.Destroy.impl.Op] {
|
|
|
-// CHECK:STDOUT: %self.patt: %pattern_type.44a = binding_pattern self [concrete]
|
|
|
-// CHECK:STDOUT: %self.param_patt: %pattern_type.44a = value_param_pattern %self.patt, call_param0 [concrete]
|
|
|
-// CHECK:STDOUT: %.loc24: %pattern_type.f6d = addr_pattern %self.param_patt [concrete]
|
|
|
-// CHECK:STDOUT: } {
|
|
|
-// CHECK:STDOUT: %self.param: %ptr.019 = value_param call_param0
|
|
|
-// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
-// CHECK:STDOUT: %self: %ptr.019 = bind_name self, %self.param
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: !members:
|
|
|
-// CHECK:STDOUT: .Op = %C.as.Destroy.impl.Op.decl
|
|
|
-// CHECK:STDOUT: witness = @C.%Destroy.impl_witness
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: class @A {
|
|
|
-// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
|
|
-// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
|
|
-// CHECK:STDOUT: %.loc16: %A.elem = field_decl a, element0 [concrete]
|
|
|
-// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%A [concrete = constants.%A]
|
|
|
-// CHECK:STDOUT: impl_decl @A.as.Destroy.impl [concrete] {} {}
|
|
|
-// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@A.as.Destroy.impl.%A.as.Destroy.impl.Op.decl), @A.as.Destroy.impl [concrete]
|
|
|
-// CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.b44]
|
|
|
-// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.a.ba9 [concrete = constants.%complete_type.fd7]
|
|
|
-// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: !members:
|
|
|
-// CHECK:STDOUT: .Self = constants.%A
|
|
|
-// CHECK:STDOUT: .a = %.loc16
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: class @B {
|
|
|
-// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
|
|
-// CHECK:STDOUT: %.loc20: %B.elem.e38 = base_decl %A.ref, element0 [concrete]
|
|
|
-// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
|
|
-// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
|
|
-// CHECK:STDOUT: %.loc21: %B.elem.5c3 = field_decl b, element1 [concrete]
|
|
|
-// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%B [concrete = constants.%B]
|
|
|
-// CHECK:STDOUT: impl_decl @B.as.Destroy.impl [concrete] {} {}
|
|
|
-// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@B.as.Destroy.impl.%B.as.Destroy.impl.Op.decl), @B.as.Destroy.impl [concrete]
|
|
|
-// CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.40d]
|
|
|
-// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.base.b.b44 [concrete = constants.%complete_type.725]
|
|
|
-// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: !members:
|
|
|
-// CHECK:STDOUT: .Self = constants.%B
|
|
|
-// CHECK:STDOUT: .A = <poisoned>
|
|
|
-// CHECK:STDOUT: .base = %.loc20
|
|
|
-// CHECK:STDOUT: .b = %.loc21
|
|
|
-// CHECK:STDOUT: extend %A.ref
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: class @C {
|
|
|
-// CHECK:STDOUT: %B.ref: type = name_ref B, file.%B.decl [concrete = constants.%B]
|
|
|
-// CHECK:STDOUT: %.loc25: %C.elem.f0c = base_decl %B.ref, element0 [concrete]
|
|
|
-// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
|
|
-// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
|
|
-// CHECK:STDOUT: %.loc26: %C.elem.646 = field_decl c, element1 [concrete]
|
|
|
-// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
|
|
|
-// CHECK:STDOUT: impl_decl @C.as.Destroy.impl [concrete] {} {}
|
|
|
-// CHECK:STDOUT: %Destroy.impl_witness_table = impl_witness_table (@C.as.Destroy.impl.%C.as.Destroy.impl.Op.decl), @C.as.Destroy.impl [concrete]
|
|
|
-// CHECK:STDOUT: %Destroy.impl_witness: <witness> = impl_witness %Destroy.impl_witness_table [concrete = constants.%Destroy.impl_witness.edd]
|
|
|
-// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness constants.%struct_type.base.c.8e2 [concrete = constants.%complete_type.58a]
|
|
|
-// CHECK:STDOUT: complete_type_witness = %complete_type
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: !members:
|
|
|
-// CHECK:STDOUT: .Self = constants.%C
|
|
|
-// CHECK:STDOUT: .B = <poisoned>
|
|
|
-// CHECK:STDOUT: .base = %.loc25
|
|
|
-// CHECK:STDOUT: .c = %.loc26
|
|
|
-// CHECK:STDOUT: extend %B.ref
|
|
|
-// CHECK:STDOUT: }
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: fn @A.as.Destroy.impl.Op(%self.param: %ptr.6db) = "no_op";
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: fn @B.as.Destroy.impl.Op(%self.param: %ptr.e79) = "no_op";
|
|
|
-// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: fn @C.as.Destroy.impl.Op(%self.param: %ptr.019) = "no_op";
|
|
|
-// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: fn @ConvertCToB(%p.param: %ptr.019) -> %ptr.e79 {
|
|
|
// CHECK:STDOUT: !entry:
|
|
|
// CHECK:STDOUT: %p.ref: %ptr.019 = name_ref p, %p
|
|
|
-// CHECK:STDOUT: %.loc29_39.1: ref %C = deref %p.ref
|
|
|
-// CHECK:STDOUT: %.loc29_39.2: ref %B = class_element_access %.loc29_39.1, element0
|
|
|
-// CHECK:STDOUT: %addr: %ptr.e79 = addr_of %.loc29_39.2
|
|
|
-// CHECK:STDOUT: %.loc29_39.3: %ptr.e79 = converted %p.ref, %addr
|
|
|
-// CHECK:STDOUT: return %.loc29_39.3
|
|
|
+// CHECK:STDOUT: %.loc19_39.1: ref %C = deref %p.ref
|
|
|
+// CHECK:STDOUT: %.loc19_39.2: ref %B = class_element_access %.loc19_39.1, element0
|
|
|
+// CHECK:STDOUT: %addr: %ptr.e79 = addr_of %.loc19_39.2
|
|
|
+// CHECK:STDOUT: %.loc19_39.3: %ptr.e79 = converted %p.ref, %addr
|
|
|
+// CHECK:STDOUT: return %.loc19_39.3
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: fn @ConvertBToA(%p.param: %ptr.e79) -> %ptr.6db {
|
|
|
// CHECK:STDOUT: !entry:
|
|
|
// CHECK:STDOUT: %p.ref: %ptr.e79 = name_ref p, %p
|
|
|
-// CHECK:STDOUT: %.loc30_39.1: ref %B = deref %p.ref
|
|
|
-// CHECK:STDOUT: %.loc30_39.2: ref %A = class_element_access %.loc30_39.1, element0
|
|
|
-// CHECK:STDOUT: %addr: %ptr.6db = addr_of %.loc30_39.2
|
|
|
-// CHECK:STDOUT: %.loc30_39.3: %ptr.6db = converted %p.ref, %addr
|
|
|
-// CHECK:STDOUT: return %.loc30_39.3
|
|
|
+// CHECK:STDOUT: %.loc20_39.1: ref %B = deref %p.ref
|
|
|
+// CHECK:STDOUT: %.loc20_39.2: ref %A = class_element_access %.loc20_39.1, element0
|
|
|
+// CHECK:STDOUT: %addr: %ptr.6db = addr_of %.loc20_39.2
|
|
|
+// CHECK:STDOUT: %.loc20_39.3: %ptr.6db = converted %p.ref, %addr
|
|
|
+// CHECK:STDOUT: return %.loc20_39.3
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: fn @ConvertCToA(%p.param: %ptr.019) -> %ptr.6db {
|
|
|
// CHECK:STDOUT: !entry:
|
|
|
// CHECK:STDOUT: %p.ref: %ptr.019 = name_ref p, %p
|
|
|
-// CHECK:STDOUT: %.loc31_39.1: ref %C = deref %p.ref
|
|
|
-// CHECK:STDOUT: %.loc31_39.2: ref %B = class_element_access %.loc31_39.1, element0
|
|
|
-// CHECK:STDOUT: %.loc31_39.3: ref %A = class_element_access %.loc31_39.2, element0
|
|
|
-// CHECK:STDOUT: %addr: %ptr.6db = addr_of %.loc31_39.3
|
|
|
-// CHECK:STDOUT: %.loc31_39.4: %ptr.6db = converted %p.ref, %addr
|
|
|
-// CHECK:STDOUT: return %.loc31_39.4
|
|
|
+// CHECK:STDOUT: %.loc21_39.1: ref %C = deref %p.ref
|
|
|
+// CHECK:STDOUT: %.loc21_39.2: ref %B = class_element_access %.loc21_39.1, element0
|
|
|
+// CHECK:STDOUT: %.loc21_39.3: ref %A = class_element_access %.loc21_39.2, element0
|
|
|
+// CHECK:STDOUT: %addr: %ptr.6db = addr_of %.loc21_39.3
|
|
|
+// CHECK:STDOUT: %.loc21_39.4: %ptr.6db = converted %p.ref, %addr
|
|
|
+// CHECK:STDOUT: return %.loc21_39.4
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: fn @ConvertValue(%c.param: %C) {
|
|
|
@@ -389,23 +301,23 @@ fn ConvertInit() {
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
|
|
|
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
|
|
-// CHECK:STDOUT: %.loc34_14.1: ref %B = class_element_access %c.ref, element0
|
|
|
-// CHECK:STDOUT: %.loc34_14.2: ref %A = class_element_access %.loc34_14.1, element0
|
|
|
-// CHECK:STDOUT: %.loc34_14.3: ref %A = converted %c.ref, %.loc34_14.2
|
|
|
-// CHECK:STDOUT: %.loc34_14.4: %A = bind_value %.loc34_14.3
|
|
|
-// CHECK:STDOUT: %a: %A = bind_name a, %.loc34_14.4
|
|
|
+// CHECK:STDOUT: %.loc24_14.1: ref %B = class_element_access %c.ref, element0
|
|
|
+// CHECK:STDOUT: %.loc24_14.2: ref %A = class_element_access %.loc24_14.1, element0
|
|
|
+// CHECK:STDOUT: %.loc24_14.3: ref %A = converted %c.ref, %.loc24_14.2
|
|
|
+// CHECK:STDOUT: %.loc24_14.4: %A = bind_value %.loc24_14.3
|
|
|
+// CHECK:STDOUT: %a: %A = bind_name a, %.loc24_14.4
|
|
|
// CHECK:STDOUT: return
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: fn @ConvertRef(%c.param: %ptr.019) -> %ptr.6db {
|
|
|
// CHECK:STDOUT: !entry:
|
|
|
// CHECK:STDOUT: %c.ref: %ptr.019 = name_ref c, %c
|
|
|
-// CHECK:STDOUT: %.loc38_12: ref %C = deref %c.ref
|
|
|
-// CHECK:STDOUT: %A.ref.loc38: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
|
|
-// CHECK:STDOUT: %.loc38_15.1: ref %B = class_element_access %.loc38_12, element0
|
|
|
-// CHECK:STDOUT: %.loc38_15.2: ref %A = class_element_access %.loc38_15.1, element0
|
|
|
-// CHECK:STDOUT: %.loc38_15.3: ref %A = converted %.loc38_12, %.loc38_15.2
|
|
|
-// CHECK:STDOUT: %addr: %ptr.6db = addr_of %.loc38_15.3
|
|
|
+// CHECK:STDOUT: %.loc28_12: ref %C = deref %c.ref
|
|
|
+// CHECK:STDOUT: %A.ref.loc28: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
|
|
+// CHECK:STDOUT: %.loc28_15.1: ref %B = class_element_access %.loc28_12, element0
|
|
|
+// CHECK:STDOUT: %.loc28_15.2: ref %A = class_element_access %.loc28_15.1, element0
|
|
|
+// CHECK:STDOUT: %.loc28_15.3: ref %A = converted %.loc28_12, %.loc28_15.2
|
|
|
+// CHECK:STDOUT: %addr: %ptr.6db = addr_of %.loc28_15.3
|
|
|
// CHECK:STDOUT: return %addr
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
@@ -415,55 +327,131 @@ fn ConvertInit() {
|
|
|
// CHECK:STDOUT: %a.patt: %pattern_type.c10 = binding_pattern a [concrete]
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
|
|
-// CHECK:STDOUT: %.loc42_39.1: %struct_type.a.a6c = struct_literal (%int_1)
|
|
|
+// CHECK:STDOUT: %.loc32_39.1: %struct_type.a.a6c = struct_literal (%int_1)
|
|
|
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
|
|
|
-// CHECK:STDOUT: %.loc42_48.1: %struct_type.base.b.bf0 = struct_literal (%.loc42_39.1, %int_2)
|
|
|
+// CHECK:STDOUT: %.loc32_48.1: %struct_type.base.b.bf0 = struct_literal (%.loc32_39.1, %int_2)
|
|
|
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
|
|
-// CHECK:STDOUT: %.loc42_57.1: %struct_type.base.c.136 = struct_literal (%.loc42_48.1, %int_3)
|
|
|
+// CHECK:STDOUT: %.loc32_57.1: %struct_type.base.c.136 = struct_literal (%.loc32_48.1, %int_3)
|
|
|
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
|
|
-// CHECK:STDOUT: %impl.elem0.loc42_39: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956]
|
|
|
-// CHECK:STDOUT: %bound_method.loc42_39.1: <bound method> = bound_method %int_1, %impl.elem0.loc42_39 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.ab5]
|
|
|
-// CHECK:STDOUT: %specific_fn.loc42_39: <specific function> = specific_function %impl.elem0.loc42_39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
|
|
-// CHECK:STDOUT: %bound_method.loc42_39.2: <bound method> = bound_method %int_1, %specific_fn.loc42_39 [concrete = constants.%bound_method.9a1]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc42_39: init %i32 = call %bound_method.loc42_39.2(%int_1) [concrete = constants.%int_1.5d2]
|
|
|
-// CHECK:STDOUT: %.loc42_39.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc42_39 [concrete = constants.%int_1.5d2]
|
|
|
-// CHECK:STDOUT: %.loc42_57.2: ref %C = temporary_storage
|
|
|
-// CHECK:STDOUT: %.loc42_57.3: ref %B = class_element_access %.loc42_57.2, element0
|
|
|
-// CHECK:STDOUT: %.loc42_48.2: ref %A = class_element_access %.loc42_57.3, element0
|
|
|
-// CHECK:STDOUT: %.loc42_39.3: ref %i32 = class_element_access %.loc42_48.2, element0
|
|
|
-// CHECK:STDOUT: %.loc42_39.4: init %i32 = initialize_from %.loc42_39.2 to %.loc42_39.3 [concrete = constants.%int_1.5d2]
|
|
|
-// CHECK:STDOUT: %.loc42_39.5: init %A = class_init (%.loc42_39.4), %.loc42_48.2 [concrete = constants.%A.val]
|
|
|
-// CHECK:STDOUT: %.loc42_48.3: init %A = converted %.loc42_39.1, %.loc42_39.5 [concrete = constants.%A.val]
|
|
|
-// CHECK:STDOUT: %impl.elem0.loc42_48: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956]
|
|
|
-// CHECK:STDOUT: %bound_method.loc42_48.1: <bound method> = bound_method %int_2, %impl.elem0.loc42_48 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.ef9]
|
|
|
-// CHECK:STDOUT: %specific_fn.loc42_48: <specific function> = specific_function %impl.elem0.loc42_48, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
|
|
-// CHECK:STDOUT: %bound_method.loc42_48.2: <bound method> = bound_method %int_2, %specific_fn.loc42_48 [concrete = constants.%bound_method.b92]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc42_48: init %i32 = call %bound_method.loc42_48.2(%int_2) [concrete = constants.%int_2.ef8]
|
|
|
-// CHECK:STDOUT: %.loc42_48.4: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc42_48 [concrete = constants.%int_2.ef8]
|
|
|
-// CHECK:STDOUT: %.loc42_48.5: ref %i32 = class_element_access %.loc42_57.3, element1
|
|
|
-// CHECK:STDOUT: %.loc42_48.6: init %i32 = initialize_from %.loc42_48.4 to %.loc42_48.5 [concrete = constants.%int_2.ef8]
|
|
|
-// CHECK:STDOUT: %.loc42_48.7: init %B = class_init (%.loc42_48.3, %.loc42_48.6), %.loc42_57.3 [concrete = constants.%B.val]
|
|
|
-// CHECK:STDOUT: %.loc42_57.4: init %B = converted %.loc42_48.1, %.loc42_48.7 [concrete = constants.%B.val]
|
|
|
-// CHECK:STDOUT: %impl.elem0.loc42_57: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956]
|
|
|
-// CHECK:STDOUT: %bound_method.loc42_57.1: <bound method> = bound_method %int_3, %impl.elem0.loc42_57 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b30]
|
|
|
-// CHECK:STDOUT: %specific_fn.loc42_57: <specific function> = specific_function %impl.elem0.loc42_57, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
|
|
-// CHECK:STDOUT: %bound_method.loc42_57.2: <bound method> = bound_method %int_3, %specific_fn.loc42_57 [concrete = constants.%bound_method.047]
|
|
|
-// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc42_57: init %i32 = call %bound_method.loc42_57.2(%int_3) [concrete = constants.%int_3.822]
|
|
|
-// CHECK:STDOUT: %.loc42_57.5: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc42_57 [concrete = constants.%int_3.822]
|
|
|
-// CHECK:STDOUT: %.loc42_57.6: ref %i32 = class_element_access %.loc42_57.2, element1
|
|
|
-// CHECK:STDOUT: %.loc42_57.7: init %i32 = initialize_from %.loc42_57.5 to %.loc42_57.6 [concrete = constants.%int_3.822]
|
|
|
-// CHECK:STDOUT: %.loc42_57.8: init %C = class_init (%.loc42_57.4, %.loc42_57.7), %.loc42_57.2 [concrete = constants.%C.val]
|
|
|
-// CHECK:STDOUT: %.loc42_57.9: ref %C = temporary %.loc42_57.2, %.loc42_57.8
|
|
|
-// CHECK:STDOUT: %.loc42_59.1: ref %C = converted %.loc42_57.1, %.loc42_57.9
|
|
|
+// CHECK:STDOUT: %impl.elem0.loc32_39: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956]
|
|
|
+// CHECK:STDOUT: %bound_method.loc32_39.1: <bound method> = bound_method %int_1, %impl.elem0.loc32_39 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.ab5]
|
|
|
+// CHECK:STDOUT: %specific_fn.loc32_39: <specific function> = specific_function %impl.elem0.loc32_39, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
|
|
+// CHECK:STDOUT: %bound_method.loc32_39.2: <bound method> = bound_method %int_1, %specific_fn.loc32_39 [concrete = constants.%bound_method.9a1]
|
|
|
+// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_39: init %i32 = call %bound_method.loc32_39.2(%int_1) [concrete = constants.%int_1.5d2]
|
|
|
+// CHECK:STDOUT: %.loc32_39.2: init %i32 = converted %int_1, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_39 [concrete = constants.%int_1.5d2]
|
|
|
+// CHECK:STDOUT: %.loc32_57.2: ref %C = temporary_storage
|
|
|
+// CHECK:STDOUT: %.loc32_57.3: ref %B = class_element_access %.loc32_57.2, element0
|
|
|
+// CHECK:STDOUT: %.loc32_48.2: ref %A = class_element_access %.loc32_57.3, element0
|
|
|
+// CHECK:STDOUT: %.loc32_39.3: ref %i32 = class_element_access %.loc32_48.2, element0
|
|
|
+// CHECK:STDOUT: %.loc32_39.4: init %i32 = initialize_from %.loc32_39.2 to %.loc32_39.3 [concrete = constants.%int_1.5d2]
|
|
|
+// CHECK:STDOUT: %.loc32_39.5: init %A = class_init (%.loc32_39.4), %.loc32_48.2 [concrete = constants.%A.val]
|
|
|
+// CHECK:STDOUT: %.loc32_48.3: init %A = converted %.loc32_39.1, %.loc32_39.5 [concrete = constants.%A.val]
|
|
|
+// CHECK:STDOUT: %impl.elem0.loc32_48: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956]
|
|
|
+// CHECK:STDOUT: %bound_method.loc32_48.1: <bound method> = bound_method %int_2, %impl.elem0.loc32_48 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.ef9]
|
|
|
+// CHECK:STDOUT: %specific_fn.loc32_48: <specific function> = specific_function %impl.elem0.loc32_48, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
|
|
+// CHECK:STDOUT: %bound_method.loc32_48.2: <bound method> = bound_method %int_2, %specific_fn.loc32_48 [concrete = constants.%bound_method.b92]
|
|
|
+// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_48: init %i32 = call %bound_method.loc32_48.2(%int_2) [concrete = constants.%int_2.ef8]
|
|
|
+// CHECK:STDOUT: %.loc32_48.4: init %i32 = converted %int_2, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_48 [concrete = constants.%int_2.ef8]
|
|
|
+// CHECK:STDOUT: %.loc32_48.5: ref %i32 = class_element_access %.loc32_57.3, element1
|
|
|
+// CHECK:STDOUT: %.loc32_48.6: init %i32 = initialize_from %.loc32_48.4 to %.loc32_48.5 [concrete = constants.%int_2.ef8]
|
|
|
+// CHECK:STDOUT: %.loc32_48.7: init %B = class_init (%.loc32_48.3, %.loc32_48.6), %.loc32_57.3 [concrete = constants.%B.val]
|
|
|
+// CHECK:STDOUT: %.loc32_57.4: init %B = converted %.loc32_48.1, %.loc32_48.7 [concrete = constants.%B.val]
|
|
|
+// CHECK:STDOUT: %impl.elem0.loc32_57: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.956]
|
|
|
+// CHECK:STDOUT: %bound_method.loc32_57.1: <bound method> = bound_method %int_3, %impl.elem0.loc32_57 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound.b30]
|
|
|
+// CHECK:STDOUT: %specific_fn.loc32_57: <specific function> = specific_function %impl.elem0.loc32_57, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
|
|
+// CHECK:STDOUT: %bound_method.loc32_57.2: <bound method> = bound_method %int_3, %specific_fn.loc32_57 [concrete = constants.%bound_method.047]
|
|
|
+// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_57: init %i32 = call %bound_method.loc32_57.2(%int_3) [concrete = constants.%int_3.822]
|
|
|
+// CHECK:STDOUT: %.loc32_57.5: init %i32 = converted %int_3, %Core.IntLiteral.as.ImplicitAs.impl.Convert.call.loc32_57 [concrete = constants.%int_3.822]
|
|
|
+// CHECK:STDOUT: %.loc32_57.6: ref %i32 = class_element_access %.loc32_57.2, element1
|
|
|
+// CHECK:STDOUT: %.loc32_57.7: init %i32 = initialize_from %.loc32_57.5 to %.loc32_57.6 [concrete = constants.%int_3.822]
|
|
|
+// CHECK:STDOUT: %.loc32_57.8: init %C = class_init (%.loc32_57.4, %.loc32_57.7), %.loc32_57.2 [concrete = constants.%C.val]
|
|
|
+// CHECK:STDOUT: %.loc32_57.9: ref %C = temporary %.loc32_57.2, %.loc32_57.8
|
|
|
+// CHECK:STDOUT: %.loc32_59.1: ref %C = converted %.loc32_57.1, %.loc32_57.9
|
|
|
// CHECK:STDOUT: %A.ref: type = name_ref A, file.%A.decl [concrete = constants.%A]
|
|
|
-// CHECK:STDOUT: %.loc42_59.2: ref %B = class_element_access %.loc42_59.1, element0
|
|
|
-// CHECK:STDOUT: %.loc42_59.3: ref %A = class_element_access %.loc42_59.2, element0
|
|
|
-// CHECK:STDOUT: %.loc42_59.4: ref %A = converted %.loc42_59.1, %.loc42_59.3
|
|
|
-// CHECK:STDOUT: %.loc42_59.5: %A = bind_value %.loc42_59.4
|
|
|
-// CHECK:STDOUT: %a: %A = bind_name a, %.loc42_59.5
|
|
|
-// CHECK:STDOUT: %C.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc42_57.2, constants.%C.as.Destroy.impl.Op
|
|
|
-// CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc42_57.2
|
|
|
+// CHECK:STDOUT: %.loc32_59.2: ref %B = class_element_access %.loc32_59.1, element0
|
|
|
+// CHECK:STDOUT: %.loc32_59.3: ref %A = class_element_access %.loc32_59.2, element0
|
|
|
+// CHECK:STDOUT: %.loc32_59.4: ref %A = converted %.loc32_59.1, %.loc32_59.3
|
|
|
+// CHECK:STDOUT: %.loc32_59.5: %A = bind_value %.loc32_59.4
|
|
|
+// CHECK:STDOUT: %a: %A = bind_name a, %.loc32_59.5
|
|
|
+// CHECK:STDOUT: %C.as.Destroy.impl.Op.bound: <bound method> = bound_method %.loc32_57.2, constants.%C.as.Destroy.impl.Op
|
|
|
+// CHECK:STDOUT: %addr: %ptr.019 = addr_of %.loc32_57.2
|
|
|
// CHECK:STDOUT: %C.as.Destroy.impl.Op.call: init %empty_tuple.type = call %C.as.Destroy.impl.Op.bound(%addr)
|
|
|
// CHECK:STDOUT: return
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- qualified.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %A: type = class_type @A [concrete]
|
|
|
+// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
+// CHECK:STDOUT: %B: type = class_type @B [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.e79: type = ptr_type %B [concrete]
|
|
|
+// CHECK:STDOUT: %const.d98: type = const_type %A [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.985: type = ptr_type %const.d98 [concrete]
|
|
|
+// CHECK:STDOUT: %TakeConstAPtr.type: type = fn_type @TakeConstAPtr [concrete]
|
|
|
+// CHECK:STDOUT: %TakeConstAPtr: %TakeConstAPtr.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %const.44f: type = const_type %B [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.eb4: type = ptr_type %const.44f [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @PassNonConstBPtr(%p.param: %ptr.e79) {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: %TakeConstAPtr.ref: %TakeConstAPtr.type = name_ref TakeConstAPtr, file.%TakeConstAPtr.decl [concrete = constants.%TakeConstAPtr]
|
|
|
+// CHECK:STDOUT: %p.ref: %ptr.e79 = name_ref p, %p
|
|
|
+// CHECK:STDOUT: %.loc15_17.1: ref %B = deref %p.ref
|
|
|
+// CHECK:STDOUT: %.loc15_17.2: ref %A = class_element_access %.loc15_17.1, element0
|
|
|
+// CHECK:STDOUT: %addr: %ptr.985 = addr_of %.loc15_17.2
|
|
|
+// CHECK:STDOUT: %.loc15_17.3: %ptr.985 = as_compatible %addr
|
|
|
+// CHECK:STDOUT: %.loc15_17.4: %ptr.985 = converted %p.ref, %.loc15_17.3
|
|
|
+// CHECK:STDOUT: %TakeConstAPtr.call: init %empty_tuple.type = call %TakeConstAPtr.ref(%.loc15_17.4)
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @PassConstBPtr(%p.param: %ptr.eb4) {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: %TakeConstAPtr.ref: %TakeConstAPtr.type = name_ref TakeConstAPtr, file.%TakeConstAPtr.decl [concrete = constants.%TakeConstAPtr]
|
|
|
+// CHECK:STDOUT: %p.ref: %ptr.eb4 = name_ref p, %p
|
|
|
+// CHECK:STDOUT: %.loc21_17.1: ref %const.44f = deref %p.ref
|
|
|
+// CHECK:STDOUT: %.loc21_17.2: ref %const.d98 = class_element_access %.loc21_17.1, element0
|
|
|
+// CHECK:STDOUT: %addr: %ptr.985 = addr_of %.loc21_17.2
|
|
|
+// CHECK:STDOUT: %.loc21_17.3: %ptr.985 = converted %p.ref, %addr
|
|
|
+// CHECK:STDOUT: %TakeConstAPtr.call: init %empty_tuple.type = call %TakeConstAPtr.ref(%.loc21_17.3)
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_todo_qualified_non_ptr.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %A: type = class_type @A [concrete]
|
|
|
+// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
+// CHECK:STDOUT: %B: type = class_type @B [concrete]
|
|
|
+// CHECK:STDOUT: %const.d98: type = const_type %A [concrete]
|
|
|
+// CHECK:STDOUT: %TakeConstA.type: type = fn_type @TakeConstA [concrete]
|
|
|
+// CHECK:STDOUT: %TakeConstA: %TakeConstA.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %const.44f: type = const_type %B [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @PassNonConstB(%p.param: %B) {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: %TakeConstA.ref: %TakeConstA.type = name_ref TakeConstA, file.%TakeConstA.decl [concrete = constants.%TakeConstA]
|
|
|
+// CHECK:STDOUT: %p.ref: %B = name_ref p, %p
|
|
|
+// CHECK:STDOUT: %.loc25: %const.d98 = converted %p.ref, <error> [concrete = <error>]
|
|
|
+// CHECK:STDOUT: %TakeConstA.call: init %empty_tuple.type = call %TakeConstA.ref(<error>)
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @PassConstB(%p.param: %const.44f) {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: %TakeConstA.ref: %TakeConstA.type = name_ref TakeConstA, file.%TakeConstA.decl [concrete = constants.%TakeConstA]
|
|
|
+// CHECK:STDOUT: %p.ref: %const.44f = name_ref p, %p
|
|
|
+// CHECK:STDOUT: %.loc41: %const.d98 = converted %p.ref, <error> [concrete = <error>]
|
|
|
+// CHECK:STDOUT: %TakeConstA.call: init %empty_tuple.type = call %TakeConstA.ref(<error>)
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|