Rename template constant -> concrete constant. (#4939)

This implements a direction decided in a
[recent
discussion](https://docs.google.com/document/d/1Iut5f2TQBrtBNIduF4vJYOKfw7MbS8xH_J01_Q4e6Rk/edit?resourcekey=0-mc_vh5UzrzXfU4kO-3tOjA&tab=t.0#heading=h.mas1g68xx9ct)
to switch away from "template constant" when naming a constant that
doesn't depend on any generic parameters, because that creates confusion
with template-dependent constant values that depend on a template
parameter.
This commit is contained in:
Richard Smith
2025-02-12 21:24:51 +00:00
committed by GitHub
parent 188821ba1a
commit c6d35e1c4a
674 changed files with 35160 additions and 35160 deletions
+30 -30
View File
@@ -16,26 +16,26 @@ fn F() -> i32 {
// CHECK:STDOUT: --- address_of_deref.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [concrete]
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [concrete]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete]
// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.956 [concrete]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [concrete]
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Int = %Core.Int
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
// CHECK:STDOUT: import Core//prelude
@@ -44,17 +44,17 @@ fn F() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
// CHECK:STDOUT: }
@@ -67,16 +67,16 @@ fn F() -> i32 {
// CHECK:STDOUT: %.loc12_3.1: %i32 = var_pattern %n.patt
// CHECK:STDOUT: }
// CHECK:STDOUT: %n.var: ref %i32 = var n
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: assign %n.var, %.loc12_3.2
// CHECK:STDOUT: %.loc12_10: type = splice_block %i32.loc12 [template = constants.%i32] {
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc12_10: type = splice_block %i32.loc12 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var
// CHECK:STDOUT: %n.ref: ref %i32 = name_ref n, %n
+101 -101
View File
@@ -23,39 +23,39 @@ fn F() {
// CHECK:STDOUT: --- address_of_lvalue.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %struct_type.a.b.501: type = struct_type {.a: %i32, .b: %i32} [template]
// CHECK:STDOUT: %ptr.3ee: type = ptr_type %struct_type.a.b.501 [template]
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
// CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template]
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
// CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.70c: <specific function> = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [template]
// CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn.787: <specific function> = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [template]
// CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%int_1.5d2, %int_2.ef8) [template]
// CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [template]
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [template]
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [template]
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [template]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %struct_type.a.b.501: type = struct_type {.a: %i32, .b: %i32} [concrete]
// CHECK:STDOUT: %ptr.3ee: type = ptr_type %struct_type.a.b.501 [concrete]
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete]
// CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [concrete]
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [concrete]
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [concrete]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete]
// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
// CHECK:STDOUT: %Convert.bound.ab5: <bound method> = bound_method %int_1.5b8, %Convert.956 [concrete]
// CHECK:STDOUT: %Convert.specific_fn.70c: <specific function> = specific_function %Convert.bound.ab5, @Convert.2(%int_32) [concrete]
// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete]
// CHECK:STDOUT: %Convert.bound.ef9: <bound method> = bound_method %int_2.ecc, %Convert.956 [concrete]
// CHECK:STDOUT: %Convert.specific_fn.787: <specific function> = specific_function %Convert.bound.ef9, @Convert.2(%int_32) [concrete]
// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete]
// CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%int_1.5d2, %int_2.ef8) [concrete]
// CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete]
// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete]
// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete]
// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Int = %Core.Int
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
// CHECK:STDOUT: import Core//prelude
@@ -64,12 +64,12 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
@@ -79,32 +79,32 @@ fn F() {
// CHECK:STDOUT: %.loc12_3.1: %struct_type.a.b.501 = var_pattern %s.patt
// CHECK:STDOUT: }
// CHECK:STDOUT: %s.var: ref %struct_type.a.b.501 = var s
// CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
// CHECK:STDOUT: %int_2.loc12: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
// CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
// CHECK:STDOUT: %int_2.loc12: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
// CHECK:STDOUT: %.loc12_46.1: %struct_type.a.b.cfd = struct_literal (%int_1.loc12, %int_2.loc12)
// CHECK:STDOUT: %impl.elem0.loc12_46.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc12_46.1: <bound method> = bound_method %int_1.loc12, %impl.elem0.loc12_46.1 [template = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %specific_fn.loc12_46.1: <specific function> = specific_function %bound_method.loc12_46.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc12_46.1: init %i32 = call %specific_fn.loc12_46.1(%int_1.loc12) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc12_46.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_46.1 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc12_46.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc12_46.1: <bound method> = bound_method %int_1.loc12, %impl.elem0.loc12_46.1 [concrete = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %specific_fn.loc12_46.1: <specific function> = specific_function %bound_method.loc12_46.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc12_46.1: init %i32 = call %specific_fn.loc12_46.1(%int_1.loc12) [concrete = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc12_46.2: init %i32 = converted %int_1.loc12, %int.convert_checked.loc12_46.1 [concrete = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc12_46.3: ref %i32 = struct_access %s.var, element0
// CHECK:STDOUT: %.loc12_46.4: init %i32 = initialize_from %.loc12_46.2 to %.loc12_46.3 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc12_46.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc12_46.2: <bound method> = bound_method %int_2.loc12, %impl.elem0.loc12_46.2 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %specific_fn.loc12_46.2: <specific function> = specific_function %bound_method.loc12_46.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc12_46.2: init %i32 = call %specific_fn.loc12_46.2(%int_2.loc12) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc12_46.5: init %i32 = converted %int_2.loc12, %int.convert_checked.loc12_46.2 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc12_46.4: init %i32 = initialize_from %.loc12_46.2 to %.loc12_46.3 [concrete = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc12_46.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc12_46.2: <bound method> = bound_method %int_2.loc12, %impl.elem0.loc12_46.2 [concrete = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %specific_fn.loc12_46.2: <specific function> = specific_function %bound_method.loc12_46.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc12_46.2: init %i32 = call %specific_fn.loc12_46.2(%int_2.loc12) [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc12_46.5: init %i32 = converted %int_2.loc12, %int.convert_checked.loc12_46.2 [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc12_46.6: ref %i32 = struct_access %s.var, element1
// CHECK:STDOUT: %.loc12_46.7: init %i32 = initialize_from %.loc12_46.5 to %.loc12_46.6 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc12_46.8: init %struct_type.a.b.501 = struct_init (%.loc12_46.4, %.loc12_46.7) to %s.var [template = constants.%struct]
// CHECK:STDOUT: %.loc12_3.2: init %struct_type.a.b.501 = converted %.loc12_46.1, %.loc12_46.8 [template = constants.%struct]
// CHECK:STDOUT: %.loc12_46.7: init %i32 = initialize_from %.loc12_46.5 to %.loc12_46.6 [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc12_46.8: init %struct_type.a.b.501 = struct_init (%.loc12_46.4, %.loc12_46.7) to %s.var [concrete = constants.%struct]
// CHECK:STDOUT: %.loc12_3.2: init %struct_type.a.b.501 = converted %.loc12_46.1, %.loc12_46.8 [concrete = constants.%struct]
// CHECK:STDOUT: assign %s.var, %.loc12_3.2
// CHECK:STDOUT: %.loc12_27: type = splice_block %struct_type.a.b.loc12 [template = constants.%struct_type.a.b.501] {
// CHECK:STDOUT: %int_32.loc12_15: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc12_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %int_32.loc12_24: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc12_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %struct_type.a.b.loc12: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.501]
// CHECK:STDOUT: %.loc12_27: type = splice_block %struct_type.a.b.loc12 [concrete = constants.%struct_type.a.b.501] {
// CHECK:STDOUT: %int_32.loc12_15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc12_15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %int_32.loc12_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc12_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %struct_type.a.b.loc12: type = struct_type {.a: %i32, .b: %i32} [concrete = constants.%struct_type.a.b.501]
// CHECK:STDOUT: }
// CHECK:STDOUT: %s: ref %struct_type.a.b.501 = bind_name s, %s.var
// CHECK:STDOUT: name_binding_decl {
@@ -115,13 +115,13 @@ fn F() {
// CHECK:STDOUT: %s.ref.loc14: ref %struct_type.a.b.501 = name_ref s, %s
// CHECK:STDOUT: %addr.loc14: %ptr.3ee = addr_of %s.ref.loc14
// CHECK:STDOUT: assign %p.var, %addr.loc14
// CHECK:STDOUT: %.loc14_28: type = splice_block %ptr.loc14 [template = constants.%ptr.3ee] {
// CHECK:STDOUT: %int_32.loc14_15: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc14_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %int_32.loc14_24: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc14_24: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %struct_type.a.b.loc14: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.501]
// CHECK:STDOUT: %ptr.loc14: type = ptr_type %struct_type.a.b.501 [template = constants.%ptr.3ee]
// CHECK:STDOUT: %.loc14_28: type = splice_block %ptr.loc14 [concrete = constants.%ptr.3ee] {
// CHECK:STDOUT: %int_32.loc14_15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc14_15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %int_32.loc14_24: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc14_24: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %struct_type.a.b.loc14: type = struct_type {.a: %i32, .b: %i32} [concrete = constants.%struct_type.a.b.501]
// CHECK:STDOUT: %ptr.loc14: type = ptr_type %struct_type.a.b.501 [concrete = constants.%ptr.3ee]
// CHECK:STDOUT: }
// CHECK:STDOUT: %p: ref %ptr.3ee = bind_name p, %p.var
// CHECK:STDOUT: name_binding_decl {
@@ -133,10 +133,10 @@ fn F() {
// CHECK:STDOUT: %.loc15_19: ref %i32 = struct_access %s.ref.loc15, element0
// CHECK:STDOUT: %addr.loc15: %ptr.235 = addr_of %.loc15_19
// CHECK:STDOUT: assign %q.var, %addr.loc15
// CHECK:STDOUT: %.loc15_13: type = splice_block %ptr.loc15 [template = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %ptr.loc15: type = ptr_type %i32 [template = constants.%ptr.235]
// CHECK:STDOUT: %.loc15_13: type = splice_block %ptr.loc15 [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc15: type = ptr_type %i32 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %q: ref %ptr.235 = bind_name q, %q.var
// CHECK:STDOUT: name_binding_decl {
@@ -148,10 +148,10 @@ fn F() {
// CHECK:STDOUT: %.loc16_19: ref %i32 = struct_access %s.ref.loc16, element1
// CHECK:STDOUT: %addr.loc16: %ptr.235 = addr_of %.loc16_19
// CHECK:STDOUT: assign %r.var, %addr.loc16
// CHECK:STDOUT: %.loc16_13: type = splice_block %ptr.loc16 [template = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %ptr.loc16: type = ptr_type %i32 [template = constants.%ptr.235]
// CHECK:STDOUT: %.loc16_13: type = splice_block %ptr.loc16 [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc16: type = ptr_type %i32 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %r: ref %ptr.235 = bind_name r, %r.var
// CHECK:STDOUT: name_binding_decl {
@@ -159,33 +159,33 @@ fn F() {
// CHECK:STDOUT: %.loc18_3.1: %tuple.type.d07 = var_pattern %t.patt
// CHECK:STDOUT: }
// CHECK:STDOUT: %t.var: ref %tuple.type.d07 = var t
// CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
// CHECK:STDOUT: %int_2.loc18: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
// CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
// CHECK:STDOUT: %int_2.loc18: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
// CHECK:STDOUT: %.loc18_28.1: %tuple.type.f94 = tuple_literal (%int_1.loc18, %int_2.loc18)
// CHECK:STDOUT: %impl.elem0.loc18_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc18_28.1: <bound method> = bound_method %int_1.loc18, %impl.elem0.loc18_28.1 [template = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %specific_fn.loc18_28.1: <specific function> = specific_function %bound_method.loc18_28.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc18_28.1: init %i32 = call %specific_fn.loc18_28.1(%int_1.loc18) [template = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc18_28.2: init %i32 = converted %int_1.loc18, %int.convert_checked.loc18_28.1 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc18_28.1: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc18_28.1: <bound method> = bound_method %int_1.loc18, %impl.elem0.loc18_28.1 [concrete = constants.%Convert.bound.ab5]
// CHECK:STDOUT: %specific_fn.loc18_28.1: <specific function> = specific_function %bound_method.loc18_28.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.70c]
// CHECK:STDOUT: %int.convert_checked.loc18_28.1: init %i32 = call %specific_fn.loc18_28.1(%int_1.loc18) [concrete = constants.%int_1.5d2]
// CHECK:STDOUT: %.loc18_28.2: init %i32 = converted %int_1.loc18, %int.convert_checked.loc18_28.1 [concrete = constants.%int_1.5d2]
// CHECK:STDOUT: %tuple.elem0.loc18: ref %i32 = tuple_access %t.var, element0
// CHECK:STDOUT: %.loc18_28.3: init %i32 = initialize_from %.loc18_28.2 to %tuple.elem0.loc18 [template = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc18_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc18_28.2: <bound method> = bound_method %int_2.loc18, %impl.elem0.loc18_28.2 [template = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %specific_fn.loc18_28.2: <specific function> = specific_function %bound_method.loc18_28.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc18_28.2: init %i32 = call %specific_fn.loc18_28.2(%int_2.loc18) [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc18_28.4: init %i32 = converted %int_2.loc18, %int.convert_checked.loc18_28.2 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc18_28.3: init %i32 = initialize_from %.loc18_28.2 to %tuple.elem0.loc18 [concrete = constants.%int_1.5d2]
// CHECK:STDOUT: %impl.elem0.loc18_28.2: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956]
// CHECK:STDOUT: %bound_method.loc18_28.2: <bound method> = bound_method %int_2.loc18, %impl.elem0.loc18_28.2 [concrete = constants.%Convert.bound.ef9]
// CHECK:STDOUT: %specific_fn.loc18_28.2: <specific function> = specific_function %bound_method.loc18_28.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn.787]
// CHECK:STDOUT: %int.convert_checked.loc18_28.2: init %i32 = call %specific_fn.loc18_28.2(%int_2.loc18) [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc18_28.4: init %i32 = converted %int_2.loc18, %int.convert_checked.loc18_28.2 [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %tuple.elem1.loc18: ref %i32 = tuple_access %t.var, element1
// CHECK:STDOUT: %.loc18_28.5: init %i32 = initialize_from %.loc18_28.4 to %tuple.elem1.loc18 [template = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc18_28.6: init %tuple.type.d07 = tuple_init (%.loc18_28.3, %.loc18_28.5) to %t.var [template = constants.%tuple]
// CHECK:STDOUT: %.loc18_3.2: init %tuple.type.d07 = converted %.loc18_28.1, %.loc18_28.6 [template = constants.%tuple]
// CHECK:STDOUT: %.loc18_28.5: init %i32 = initialize_from %.loc18_28.4 to %tuple.elem1.loc18 [concrete = constants.%int_2.ef8]
// CHECK:STDOUT: %.loc18_28.6: init %tuple.type.d07 = tuple_init (%.loc18_28.3, %.loc18_28.5) to %t.var [concrete = constants.%tuple]
// CHECK:STDOUT: %.loc18_3.2: init %tuple.type.d07 = converted %.loc18_28.1, %.loc18_28.6 [concrete = constants.%tuple]
// CHECK:STDOUT: assign %t.var, %.loc18_3.2
// CHECK:STDOUT: %.loc18_19.1: type = splice_block %.loc18_19.3 [template = constants.%tuple.type.d07] {
// CHECK:STDOUT: %int_32.loc18_11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc18_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %int_32.loc18_16: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc18_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc18_19.1: type = splice_block %.loc18_19.3 [concrete = constants.%tuple.type.d07] {
// CHECK:STDOUT: %int_32.loc18_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc18_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %int_32.loc18_16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc18_16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %.loc18_19.2: %tuple.type.24b = tuple_literal (%i32.loc18_11, %i32.loc18_16)
// CHECK:STDOUT: %.loc18_19.3: type = converted %.loc18_19.2, constants.%tuple.type.d07 [template = constants.%tuple.type.d07]
// CHECK:STDOUT: %.loc18_19.3: type = converted %.loc18_19.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07]
// CHECK:STDOUT: }
// CHECK:STDOUT: %t: ref %tuple.type.d07 = bind_name t, %t.var
// CHECK:STDOUT: name_binding_decl {
@@ -194,14 +194,14 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %t0.var: ref %ptr.235 = var t0
// CHECK:STDOUT: %t.ref.loc19: ref %tuple.type.d07 = name_ref t, %t
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
// CHECK:STDOUT: %tuple.elem0.loc19: ref %i32 = tuple_access %t.ref.loc19, element0
// CHECK:STDOUT: %addr.loc19: %ptr.235 = addr_of %tuple.elem0.loc19
// CHECK:STDOUT: assign %t0.var, %addr.loc19
// CHECK:STDOUT: %.loc19_14: type = splice_block %ptr.loc19 [template = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %ptr.loc19: type = ptr_type %i32 [template = constants.%ptr.235]
// CHECK:STDOUT: %.loc19_14: type = splice_block %ptr.loc19 [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc19: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc19: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc19: type = ptr_type %i32 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %t0: ref %ptr.235 = bind_name t0, %t0.var
// CHECK:STDOUT: name_binding_decl {
@@ -210,14 +210,14 @@ fn F() {
// CHECK:STDOUT: }
// CHECK:STDOUT: %t1.var: ref %ptr.235 = var t1
// CHECK:STDOUT: %t.ref.loc20: ref %tuple.type.d07 = name_ref t, %t
// CHECK:STDOUT: %int_1.loc20: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
// CHECK:STDOUT: %int_1.loc20: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
// CHECK:STDOUT: %tuple.elem1.loc20: ref %i32 = tuple_access %t.ref.loc20, element1
// CHECK:STDOUT: %addr.loc20: %ptr.235 = addr_of %tuple.elem1.loc20
// CHECK:STDOUT: assign %t1.var, %addr.loc20
// CHECK:STDOUT: %.loc20_14: type = splice_block %ptr.loc20 [template = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %ptr.loc20: type = ptr_type %i32 [template = constants.%ptr.235]
// CHECK:STDOUT: %.loc20_14: type = splice_block %ptr.loc20 [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc20: type = ptr_type %i32 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %t1: ref %ptr.235 = bind_name t1, %t1.var
// CHECK:STDOUT: return
+27 -27
View File
@@ -26,61 +26,61 @@ fn Foo(ptr: C*) {
// CHECK:STDOUT: --- arrow.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %C: type = class_type @C [template]
// CHECK:STDOUT: %Member.type: type = fn_type @Member [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %Member: %Member.type = struct_value () [template]
// CHECK:STDOUT: %ptr.019: type = ptr_type %C [template]
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %ptr.019 [template]
// CHECK:STDOUT: %struct_type.field: type = struct_type {.field: %ptr.019} [template]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.field [template]
// CHECK:STDOUT: %Foo.type: type = fn_type @Foo [template]
// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [template]
// CHECK:STDOUT: %C: type = class_type @C [concrete]
// CHECK:STDOUT: %Member.type: type = fn_type @Member [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %Member: %Member.type = struct_value () [concrete]
// CHECK:STDOUT: %ptr.019: type = ptr_type %C [concrete]
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %ptr.019 [concrete]
// CHECK:STDOUT: %struct_type.field: type = struct_type {.field: %ptr.019} [concrete]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.field [concrete]
// CHECK:STDOUT: %Foo.type: type = fn_type @Foo [concrete]
// CHECK:STDOUT: %Foo: %Foo.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// 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: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .C = %C.decl
// CHECK:STDOUT: .Foo = %Foo.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {} {}
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [template = constants.%Foo] {
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
// CHECK:STDOUT: %Foo.decl: %Foo.type = fn_decl @Foo [concrete = constants.%Foo] {
// CHECK:STDOUT: %ptr.patt: %ptr.019 = binding_pattern ptr
// CHECK:STDOUT: %ptr.param_patt: %ptr.019 = value_param_pattern %ptr.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %ptr.param: %ptr.019 = value_param runtime_param0
// CHECK:STDOUT: %.loc16: type = splice_block %ptr.loc16_14 [template = constants.%ptr.019] {
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [template = constants.%C]
// CHECK:STDOUT: %ptr.loc16_14: type = ptr_type %C [template = constants.%ptr.019]
// CHECK:STDOUT: %.loc16: type = splice_block %ptr.loc16_14 [concrete = constants.%ptr.019] {
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
// CHECK:STDOUT: %ptr.loc16_14: type = ptr_type %C [concrete = constants.%ptr.019]
// CHECK:STDOUT: }
// CHECK:STDOUT: %ptr.loc16_8: %ptr.019 = bind_name ptr, %ptr.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: class @C {
// CHECK:STDOUT: %Member.decl: %Member.type = fn_decl @Member [template = constants.%Member] {
// CHECK:STDOUT: %Member.decl: %Member.type = fn_decl @Member [concrete = constants.%Member] {
// CHECK:STDOUT: %self.patt: %C = binding_pattern self
// CHECK:STDOUT: %self.param_patt: %C = value_param_pattern %self.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %self.param: %C = value_param runtime_param0
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [template = constants.%C]
// CHECK:STDOUT: %Self.ref: type = name_ref Self, constants.%C [concrete = constants.%C]
// CHECK:STDOUT: %self: %C = bind_name self, %self.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc13_12: %C.elem = field_decl field, element0 [template]
// CHECK:STDOUT: %.loc13_12: %C.elem = field_decl field, element0 [concrete]
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %.loc13_3: %C.elem = var_pattern %.loc13_12
// CHECK:STDOUT: }
// CHECK:STDOUT: %.var: ref %C.elem = var <none>
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.field [template = constants.%complete_type]
// CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %struct_type.field [concrete = constants.%complete_type]
// CHECK:STDOUT: complete_type_witness = %complete_type
// CHECK:STDOUT:
// CHECK:STDOUT: !members:
@@ -95,31 +95,31 @@ fn Foo(ptr: C*) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %ptr.ref.loc17: %ptr.019 = name_ref ptr, %ptr.loc16_8
// CHECK:STDOUT: %.loc17_4.1: ref %C = deref %ptr.ref.loc17
// CHECK:STDOUT: %Member.ref.loc17: %Member.type = name_ref Member, @C.%Member.decl [template = constants.%Member]
// CHECK:STDOUT: %Member.ref.loc17: %Member.type = name_ref Member, @C.%Member.decl [concrete = constants.%Member]
// CHECK:STDOUT: %Member.bound.loc17: <bound method> = bound_method %.loc17_4.1, %Member.ref.loc17
// CHECK:STDOUT: %.loc17_4.2: %C = bind_value %.loc17_4.1
// CHECK:STDOUT: %Member.call.loc17: init %empty_tuple.type = call %Member.bound.loc17(%.loc17_4.2)
// CHECK:STDOUT: %ptr.ref.loc18: %ptr.019 = name_ref ptr, %ptr.loc16_8
// CHECK:STDOUT: %.loc18_6.1: ref %C = deref %ptr.ref.loc18
// CHECK:STDOUT: %Member.ref.loc18: %Member.type = name_ref Member, @C.%Member.decl [template = constants.%Member]
// CHECK:STDOUT: %Member.ref.loc18: %Member.type = name_ref Member, @C.%Member.decl [concrete = constants.%Member]
// CHECK:STDOUT: %Member.bound.loc18: <bound method> = bound_method %.loc18_6.1, %Member.ref.loc18
// CHECK:STDOUT: %.loc18_6.2: %C = bind_value %.loc18_6.1
// CHECK:STDOUT: %Member.call.loc18: init %empty_tuple.type = call %Member.bound.loc18(%.loc18_6.2)
// CHECK:STDOUT: %ptr.ref.loc20: %ptr.019 = name_ref ptr, %ptr.loc16_8
// CHECK:STDOUT: %.loc20_4: ref %C = deref %ptr.ref.loc20
// CHECK:STDOUT: %field.ref.loc20: %C.elem = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %field.ref.loc20: %C.elem = name_ref field, @C.%.loc13_12 [concrete = @C.%.loc13_12]
// CHECK:STDOUT: %.loc20_9: ref %ptr.019 = class_element_access %.loc20_4, element0
// CHECK:STDOUT: %ptr.ref.loc21: %ptr.019 = name_ref ptr, %ptr.loc16_8
// CHECK:STDOUT: %.loc21_6.1: ref %C = deref %ptr.ref.loc21
// CHECK:STDOUT: %field.ref.loc21: %C.elem = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %field.ref.loc21: %C.elem = name_ref field, @C.%.loc13_12 [concrete = @C.%.loc13_12]
// CHECK:STDOUT: %.loc21_6.2: ref %ptr.019 = class_element_access %.loc21_6.1, element0
// CHECK:STDOUT: %ptr.ref.loc23: %ptr.019 = name_ref ptr, %ptr.loc16_8
// CHECK:STDOUT: %.loc23_6.1: ref %C = deref %ptr.ref.loc23
// CHECK:STDOUT: %field.ref.loc23_6: %C.elem = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %field.ref.loc23_6: %C.elem = name_ref field, @C.%.loc13_12 [concrete = @C.%.loc13_12]
// CHECK:STDOUT: %.loc23_6.2: ref %ptr.019 = class_element_access %.loc23_6.1, element0
// CHECK:STDOUT: %.loc23_6.3: %ptr.019 = bind_value %.loc23_6.2
// CHECK:STDOUT: %.loc23_13.1: ref %C = deref %.loc23_6.3
// CHECK:STDOUT: %field.ref.loc23_13: %C.elem = name_ref field, @C.%.loc13_12 [template = @C.%.loc13_12]
// CHECK:STDOUT: %field.ref.loc23_13: %C.elem = name_ref field, @C.%.loc13_12 [concrete = @C.%.loc13_12]
// CHECK:STDOUT: %.loc23_13.2: ref %ptr.019 = class_element_access %.loc23_13.1, element0
// CHECK:STDOUT: return
// CHECK:STDOUT: }
+34 -34
View File
@@ -18,26 +18,26 @@ fn F() -> i32 {
// CHECK:STDOUT: --- basic.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [concrete]
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [concrete]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete]
// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.956 [concrete]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [concrete]
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Int = %Core.Int
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
// CHECK:STDOUT: import Core//prelude
@@ -46,17 +46,17 @@ fn F() -> i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param0
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
// CHECK:STDOUT: }
@@ -69,16 +69,16 @@ fn F() -> i32 {
// CHECK:STDOUT: %.loc12_3.1: %i32 = var_pattern %n.patt
// CHECK:STDOUT: }
// CHECK:STDOUT: %n.var: ref %i32 = var n
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc12_3.2: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: assign %n.var, %.loc12_3.2
// CHECK:STDOUT: %.loc12_10: type = splice_block %i32.loc12 [template = constants.%i32] {
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc12_10: type = splice_block %i32.loc12 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %n: ref %i32 = bind_name n, %n.var
// CHECK:STDOUT: name_binding_decl {
@@ -89,10 +89,10 @@ fn F() -> i32 {
// CHECK:STDOUT: %n.ref: ref %i32 = name_ref n, %n
// CHECK:STDOUT: %addr: %ptr = addr_of %n.ref
// CHECK:STDOUT: assign %p.var, %addr
// CHECK:STDOUT: %.loc13_13: type = splice_block %ptr [template = constants.%ptr] {
// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr]
// CHECK:STDOUT: %.loc13_13: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %p: ref %ptr = bind_name p, %p.var
// CHECK:STDOUT: %p.ref: ref %ptr = name_ref p, %p
+10 -10
View File
@@ -28,33 +28,33 @@ fn Test() {
// CHECK:STDOUT: --- fail_address_of_error.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Test.type: type = fn_type @Test [template]
// CHECK:STDOUT: %Test: %Test.type = struct_value () [template]
// CHECK:STDOUT: %Test.type: type = fn_type @Test [concrete]
// CHECK:STDOUT: %Test: %Test.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// 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: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .Test = %Test.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] {} {}
// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [concrete = constants.%Test] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Test() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %undeclared.ref.loc16: <error> = name_ref undeclared, <error> [template = <error>]
// CHECK:STDOUT: %addr.loc16: <error> = addr_of %undeclared.ref.loc16 [template = <error>]
// CHECK:STDOUT: %undeclared.ref.loc25: <error> = name_ref undeclared, <error> [template = <error>]
// CHECK:STDOUT: %addr.loc25_5: <error> = addr_of %undeclared.ref.loc25 [template = <error>]
// CHECK:STDOUT: %addr.loc25_3: <error> = addr_of <error> [template = <error>]
// CHECK:STDOUT: %undeclared.ref.loc16: <error> = name_ref undeclared, <error> [concrete = <error>]
// CHECK:STDOUT: %addr.loc16: <error> = addr_of %undeclared.ref.loc16 [concrete = <error>]
// CHECK:STDOUT: %undeclared.ref.loc25: <error> = name_ref undeclared, <error> [concrete = <error>]
// CHECK:STDOUT: %addr.loc25_5: <error> = addr_of %undeclared.ref.loc25 [concrete = <error>]
// CHECK:STDOUT: %addr.loc25_3: <error> = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
+103 -103
View File
@@ -103,50 +103,50 @@ fn AddressOfParam(param: i32) {
// CHECK:STDOUT: --- fail_address_of_value.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %G.type: type = fn_type @G [template]
// CHECK:STDOUT: %G: %G.type = struct_value () [template]
// CHECK:STDOUT: %struct_type.a.ba9: type = struct_type {.a: %i32} [template]
// CHECK:STDOUT: %H.type: type = fn_type @H [template]
// CHECK:STDOUT: %H: %H.type = struct_value () [template]
// CHECK:STDOUT: %AddressOfLiteral.type: type = fn_type @AddressOfLiteral [template]
// CHECK:STDOUT: %AddressOfLiteral: %AddressOfLiteral.type = struct_value () [template]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template]
// CHECK:STDOUT: %ptr.1d1: type = ptr_type Core.IntLiteral [template]
// CHECK:STDOUT: %true: bool = bool_literal true [template]
// CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [template]
// CHECK:STDOUT: %float: f64 = float_literal 1 [template]
// CHECK:STDOUT: %ptr.ef1: type = ptr_type f64 [template]
// CHECK:STDOUT: %ptr.a45: type = ptr_type String [template]
// CHECK:STDOUT: %str: String = string_literal "Hello" [template]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template]
// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [template]
// CHECK:STDOUT: %ptr.b50: type = ptr_type %tuple.type [template]
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template]
// CHECK:STDOUT: %struct_type.a.a6c: type = struct_type {.a: Core.IntLiteral} [template]
// CHECK:STDOUT: %ptr.4e0: type = ptr_type %struct_type.a.a6c [template]
// CHECK:STDOUT: %AddressOfOperator.type: type = fn_type @AddressOfOperator [template]
// CHECK:STDOUT: %AddressOfOperator: %AddressOfOperator.type = struct_value () [template]
// CHECK:STDOUT: %false: bool = bool_literal false [template]
// CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [template]
// CHECK:STDOUT: %AddressOfCall.type: type = fn_type @AddressOfCall [template]
// CHECK:STDOUT: %AddressOfCall: %AddressOfCall.type = struct_value () [template]
// CHECK:STDOUT: %AddressOfType.type: type = fn_type @AddressOfType [template]
// CHECK:STDOUT: %AddressOfType: %AddressOfType.type = struct_value () [template]
// CHECK:STDOUT: %ptr.db7: type = ptr_type type [template]
// CHECK:STDOUT: %const: type = const_type %i32 [template]
// CHECK:STDOUT: %ptr.36b: type = ptr_type %const [template]
// CHECK:STDOUT: %AddressOfTupleElementValue.type: type = fn_type @AddressOfTupleElementValue [template]
// CHECK:STDOUT: %AddressOfTupleElementValue: %AddressOfTupleElementValue.type = struct_value () [template]
// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%int_1, %int_2) [template]
// CHECK:STDOUT: %AddressOfParam.type: type = fn_type @AddressOfParam [template]
// CHECK:STDOUT: %AddressOfParam: %AddressOfParam.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
// CHECK:STDOUT: %struct_type.a.ba9: type = struct_type {.a: %i32} [concrete]
// CHECK:STDOUT: %H.type: type = fn_type @H [concrete]
// CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
// CHECK:STDOUT: %AddressOfLiteral.type: type = fn_type @AddressOfLiteral [concrete]
// CHECK:STDOUT: %AddressOfLiteral: %AddressOfLiteral.type = struct_value () [concrete]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete]
// CHECK:STDOUT: %ptr.1d1: type = ptr_type Core.IntLiteral [concrete]
// CHECK:STDOUT: %true: bool = bool_literal true [concrete]
// CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
// CHECK:STDOUT: %float: f64 = float_literal 1 [concrete]
// CHECK:STDOUT: %ptr.ef1: type = ptr_type f64 [concrete]
// CHECK:STDOUT: %ptr.a45: type = ptr_type String [concrete]
// CHECK:STDOUT: %str: String = string_literal "Hello" [concrete]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
// CHECK:STDOUT: %tuple.type: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete]
// CHECK:STDOUT: %ptr.b50: type = ptr_type %tuple.type [concrete]
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete]
// CHECK:STDOUT: %struct_type.a.a6c: type = struct_type {.a: Core.IntLiteral} [concrete]
// CHECK:STDOUT: %ptr.4e0: type = ptr_type %struct_type.a.a6c [concrete]
// CHECK:STDOUT: %AddressOfOperator.type: type = fn_type @AddressOfOperator [concrete]
// CHECK:STDOUT: %AddressOfOperator: %AddressOfOperator.type = struct_value () [concrete]
// CHECK:STDOUT: %false: bool = bool_literal false [concrete]
// CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete]
// CHECK:STDOUT: %AddressOfCall.type: type = fn_type @AddressOfCall [concrete]
// CHECK:STDOUT: %AddressOfCall: %AddressOfCall.type = struct_value () [concrete]
// CHECK:STDOUT: %AddressOfType.type: type = fn_type @AddressOfType [concrete]
// CHECK:STDOUT: %AddressOfType: %AddressOfType.type = struct_value () [concrete]
// CHECK:STDOUT: %ptr.db7: type = ptr_type type [concrete]
// CHECK:STDOUT: %const: type = const_type %i32 [concrete]
// CHECK:STDOUT: %ptr.36b: type = ptr_type %const [concrete]
// CHECK:STDOUT: %AddressOfTupleElementValue.type: type = fn_type @AddressOfTupleElementValue [concrete]
// CHECK:STDOUT: %AddressOfTupleElementValue: %AddressOfTupleElementValue.type = struct_value () [concrete]
// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%int_1, %int_2) [concrete]
// CHECK:STDOUT: %AddressOfParam.type: type = fn_type @AddressOfParam [concrete]
// CHECK:STDOUT: %AddressOfParam: %AddressOfParam.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Int = %Core.Int
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
@@ -154,7 +154,7 @@ fn AddressOfParam(param: i32) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: .H = %H.decl
@@ -166,38 +166,38 @@ fn AddressOfParam(param: i32) {
// CHECK:STDOUT: .AddressOfParam = %AddressOfParam.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param0
// 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: %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: %return.param: ref %i32 = out_param runtime_param0
// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [template = constants.%H] {
// CHECK:STDOUT: %H.decl: %H.type = fn_decl @H [concrete = constants.%H] {
// CHECK:STDOUT: %return.patt: %struct_type.a.ba9 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %struct_type.a.ba9 = out_param_pattern %return.patt, runtime_param0
// 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: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.ba9]
// 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: %struct_type.a: type = struct_type {.a: %i32} [concrete = constants.%struct_type.a.ba9]
// CHECK:STDOUT: %return.param: ref %struct_type.a.ba9 = out_param runtime_param0
// CHECK:STDOUT: %return: ref %struct_type.a.ba9 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %AddressOfLiteral.decl: %AddressOfLiteral.type = fn_decl @AddressOfLiteral [template = constants.%AddressOfLiteral] {} {}
// CHECK:STDOUT: %AddressOfOperator.decl: %AddressOfOperator.type = fn_decl @AddressOfOperator [template = constants.%AddressOfOperator] {} {}
// CHECK:STDOUT: %AddressOfCall.decl: %AddressOfCall.type = fn_decl @AddressOfCall [template = constants.%AddressOfCall] {} {}
// CHECK:STDOUT: %AddressOfType.decl: %AddressOfType.type = fn_decl @AddressOfType [template = constants.%AddressOfType] {} {}
// CHECK:STDOUT: %AddressOfTupleElementValue.decl: %AddressOfTupleElementValue.type = fn_decl @AddressOfTupleElementValue [template = constants.%AddressOfTupleElementValue] {} {}
// CHECK:STDOUT: %AddressOfParam.decl: %AddressOfParam.type = fn_decl @AddressOfParam [template = constants.%AddressOfParam] {
// CHECK:STDOUT: %AddressOfLiteral.decl: %AddressOfLiteral.type = fn_decl @AddressOfLiteral [concrete = constants.%AddressOfLiteral] {} {}
// CHECK:STDOUT: %AddressOfOperator.decl: %AddressOfOperator.type = fn_decl @AddressOfOperator [concrete = constants.%AddressOfOperator] {} {}
// CHECK:STDOUT: %AddressOfCall.decl: %AddressOfCall.type = fn_decl @AddressOfCall [concrete = constants.%AddressOfCall] {} {}
// CHECK:STDOUT: %AddressOfType.decl: %AddressOfType.type = fn_decl @AddressOfType [concrete = constants.%AddressOfType] {} {}
// CHECK:STDOUT: %AddressOfTupleElementValue.decl: %AddressOfTupleElementValue.type = fn_decl @AddressOfTupleElementValue [concrete = constants.%AddressOfTupleElementValue] {} {}
// CHECK:STDOUT: %AddressOfParam.decl: %AddressOfParam.type = fn_decl @AddressOfParam [concrete = constants.%AddressOfParam] {
// CHECK:STDOUT: %param.patt: %i32 = binding_pattern param
// CHECK:STDOUT: %param.param_patt: %i32 = value_param_pattern %param.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %param.param: %i32 = value_param runtime_param0
// CHECK:STDOUT: %.loc95: type = splice_block %i32.loc95 [template = constants.%i32] {
// CHECK:STDOUT: %int_32.loc95: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc95: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc95: type = splice_block %i32.loc95 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc95: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc95: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %param: %i32 = bind_name param, %param.param
// CHECK:STDOUT: }
@@ -209,80 +209,80 @@ fn AddressOfParam(param: i32) {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AddressOfLiteral() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0]
// CHECK:STDOUT: %addr.loc20: %ptr.1d1 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true]
// CHECK:STDOUT: %addr.loc25: %ptr.bb2 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %float: f64 = float_literal 1 [template = constants.%float]
// CHECK:STDOUT: %addr.loc30: %ptr.ef1 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %str: String = string_literal "Hello" [template = constants.%str]
// CHECK:STDOUT: %addr.loc35: %ptr.a45 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
// CHECK:STDOUT: %addr.loc20: %ptr.1d1 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: %addr.loc25: %ptr.bb2 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: %float: f64 = float_literal 1 [concrete = constants.%float]
// CHECK:STDOUT: %addr.loc30: %ptr.ef1 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: %str: String = string_literal "Hello" [concrete = constants.%str]
// CHECK:STDOUT: %addr.loc35: %ptr.a45 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
// CHECK:STDOUT: %.loc40: %tuple.type = tuple_literal (%int_1, %int_2)
// CHECK:STDOUT: %addr.loc40: %ptr.b50 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [template = constants.%int_5]
// CHECK:STDOUT: %addr.loc40: %ptr.b50 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5]
// CHECK:STDOUT: %.loc45: %struct_type.a.a6c = struct_literal (%int_5)
// CHECK:STDOUT: %addr.loc45: %ptr.4e0 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %addr.loc45: %ptr.4e0 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AddressOfOperator() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %true.loc53: bool = bool_literal true [template = constants.%true]
// CHECK:STDOUT: %false.loc53_10: bool = bool_literal false [template = constants.%false]
// CHECK:STDOUT: %true.loc53: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: %false.loc53_10: bool = bool_literal false [concrete = constants.%false]
// CHECK:STDOUT: if %true.loc53 br !and.rhs else br !and.result(%false.loc53_10)
// CHECK:STDOUT:
// CHECK:STDOUT: !and.rhs:
// CHECK:STDOUT: %false.loc53_14: bool = bool_literal false [template = constants.%false]
// CHECK:STDOUT: %false.loc53_14: bool = bool_literal false [concrete = constants.%false]
// CHECK:STDOUT: br !and.result(%false.loc53_14)
// CHECK:STDOUT:
// CHECK:STDOUT: !and.result:
// CHECK:STDOUT: %.loc53: bool = block_arg !and.result [template = constants.%false]
// CHECK:STDOUT: %addr.loc53: %ptr.bb2 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %H.ref: %H.type = name_ref H, file.%H.decl [template = constants.%H]
// CHECK:STDOUT: %.loc53: bool = block_arg !and.result [concrete = constants.%false]
// CHECK:STDOUT: %addr.loc53: %ptr.bb2 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: %H.ref: %H.type = name_ref H, file.%H.decl [concrete = constants.%H]
// CHECK:STDOUT: %H.call: init %struct_type.a.ba9 = call %H.ref()
// CHECK:STDOUT: %.loc58_6.1: ref %struct_type.a.ba9 = temporary_storage
// CHECK:STDOUT: %.loc58_6.2: ref %struct_type.a.ba9 = temporary %.loc58_6.1, %H.call
// CHECK:STDOUT: %.loc58_7: ref %i32 = struct_access %.loc58_6.2, element0
// CHECK:STDOUT: %addr.loc58: %ptr.235 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %true.loc63: bool = bool_literal true [template = constants.%true]
// CHECK:STDOUT: %.loc63: bool = not %true.loc63 [template = constants.%false]
// CHECK:STDOUT: %addr.loc63: %ptr.bb2 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %addr.loc58: %ptr.235 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: %true.loc63: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: %.loc63: bool = not %true.loc63 [concrete = constants.%false]
// CHECK:STDOUT: %addr.loc63: %ptr.bb2 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AddressOfCall() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [template = constants.%G]
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
// CHECK:STDOUT: %G.call: init %i32 = call %G.ref()
// CHECK:STDOUT: %addr: %ptr.235 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %addr: %ptr.235 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AddressOfType() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int_32.loc79: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc79: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %addr.loc79: %ptr.db7 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %int_32.loc84: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc84: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %const: type = const_type %i32 [template = constants.%const]
// CHECK:STDOUT: %ptr: type = ptr_type %const [template = constants.%ptr.36b]
// CHECK:STDOUT: %addr.loc84: %ptr.db7 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %int_32.loc79: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc79: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %addr.loc79: %ptr.db7 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: %int_32.loc84: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc84: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %const: type = const_type %i32 [concrete = constants.%const]
// CHECK:STDOUT: %ptr: type = ptr_type %const [concrete = constants.%ptr.36b]
// CHECK:STDOUT: %addr.loc84: %ptr.db7 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @AddressOfTupleElementValue() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2]
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
// CHECK:STDOUT: %.loc92_10.1: %tuple.type = tuple_literal (%int_1, %int_2)
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0]
// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%int_1, %int_2) [template = constants.%tuple]
// CHECK:STDOUT: %.loc92_10.2: %tuple.type = converted %.loc92_10.1, %tuple [template = constants.%tuple]
// CHECK:STDOUT: %tuple.elem0: Core.IntLiteral = tuple_access %.loc92_10.2, element0 [template = constants.%int_1]
// CHECK:STDOUT: %addr: %ptr.1d1 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0]
// CHECK:STDOUT: %tuple: %tuple.type = tuple_value (%int_1, %int_2) [concrete = constants.%tuple]
// CHECK:STDOUT: %.loc92_10.2: %tuple.type = converted %.loc92_10.1, %tuple [concrete = constants.%tuple]
// CHECK:STDOUT: %tuple.elem0: Core.IntLiteral = tuple_access %.loc92_10.2, element0 [concrete = constants.%int_1]
// CHECK:STDOUT: %addr: %ptr.1d1 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -294,12 +294,12 @@ fn AddressOfParam(param: i32) {
// CHECK:STDOUT: }
// CHECK:STDOUT: %param_addr.var: ref %ptr.235 = var param_addr
// CHECK:STDOUT: %param.ref: %i32 = name_ref param, %param
// CHECK:STDOUT: %addr: %ptr.235 = addr_of <error> [template = <error>]
// CHECK:STDOUT: %addr: %ptr.235 = addr_of <error> [concrete = <error>]
// CHECK:STDOUT: assign %param_addr.var, %addr
// CHECK:STDOUT: %.loc100_22: type = splice_block %ptr [template = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc100: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc100: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr.235]
// CHECK:STDOUT: %.loc100_22: type = splice_block %ptr [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc100: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc100: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %param_addr: ref %ptr.235 = bind_name param_addr, %param_addr.var
// CHECK:STDOUT: return
+13 -13
View File
@@ -22,12 +22,12 @@ let n2: i32 = undeclared->foo;
// CHECK:STDOUT: --- fail_deref_error.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Int = %Core.Int
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
@@ -35,7 +35,7 @@ let n2: i32 = undeclared->foo;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .n = %n
// CHECK:STDOUT: .n2 = %n2
@@ -44,28 +44,28 @@ let n2: i32 = undeclared->foo;
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc15: type = splice_block %i32.loc15 [template = constants.%i32] {
// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc15: type = splice_block %i32.loc15 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %n: %i32 = bind_name n, <error>
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %n2.patt: %i32 = binding_pattern n2
// CHECK:STDOUT: }
// CHECK:STDOUT: %.loc20: type = splice_block %i32.loc20 [template = constants.%i32] {
// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc20: type = splice_block %i32.loc20 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc20: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc20: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %n2: %i32 = bind_name n2, <error>
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %undeclared.ref.loc15: <error> = name_ref undeclared, <error> [template = <error>]
// CHECK:STDOUT: %undeclared.ref.loc15: <error> = name_ref undeclared, <error> [concrete = <error>]
// CHECK:STDOUT: %.loc15: ref <error> = deref <error>
// CHECK:STDOUT: %undeclared.ref.loc20: <error> = name_ref undeclared, <error> [template = <error>]
// CHECK:STDOUT: %undeclared.ref.loc20: <error> = name_ref undeclared, <error> [concrete = <error>]
// CHECK:STDOUT: %.loc20: ref <error> = deref <error>
// CHECK:STDOUT: %foo.ref: <error> = name_ref foo, <error> [template = <error>]
// CHECK:STDOUT: %foo.ref: <error> = name_ref foo, <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -24,33 +24,33 @@ fn A() {
// CHECK:STDOUT: --- fail_deref_function.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %A.type: type = fn_type @A [template]
// CHECK:STDOUT: %A: %A.type = struct_value () [template]
// CHECK:STDOUT: %A.type: type = fn_type @A [concrete]
// CHECK:STDOUT: %A: %A.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// 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: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .A = %A.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [template = constants.%A] {} {}
// CHECK:STDOUT: %A.decl: %A.type = fn_decl @A [concrete = constants.%A] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @A() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref.loc16: %A.type = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %A.ref.loc16: %A.type = name_ref A, file.%A.decl [concrete = constants.%A]
// CHECK:STDOUT: %.loc16: ref <error> = deref <error>
// CHECK:STDOUT: %A.ref.loc21: %A.type = name_ref A, file.%A.decl [template = constants.%A]
// CHECK:STDOUT: %A.ref.loc21: %A.type = name_ref A, file.%A.decl [concrete = constants.%A]
// CHECK:STDOUT: %.loc21: ref <error> = deref <error>
// CHECK:STDOUT: %foo.ref: <error> = name_ref foo, <error> [template = <error>]
// CHECK:STDOUT: %foo.ref: <error> = name_ref foo, <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -26,35 +26,35 @@ fn F() {
// CHECK:STDOUT: --- fail_deref_namespace.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// 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: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// 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: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .A = %A
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %A: <namespace> = namespace [template] {}
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
// CHECK:STDOUT: %A: <namespace> = namespace [concrete] {}
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %A.ref.loc18: <namespace> = name_ref A, file.%A [template = file.%A]
// CHECK:STDOUT: %A.ref.loc18: <namespace> = name_ref A, file.%A [concrete = file.%A]
// CHECK:STDOUT: %.loc18: ref <error> = deref <error>
// CHECK:STDOUT: %A.ref.loc23: <namespace> = name_ref A, file.%A [template = file.%A]
// CHECK:STDOUT: %A.ref.loc23: <namespace> = name_ref A, file.%A [concrete = file.%A]
// CHECK:STDOUT: %.loc23: ref <error> = deref <error>
// CHECK:STDOUT: %foo.ref: <error> = name_ref foo, <error> [template = <error>]
// CHECK:STDOUT: %foo.ref: <error> = name_ref foo, <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
@@ -44,18 +44,18 @@ fn Deref(n: i32) {
// CHECK:STDOUT: --- fail_deref_not_pointer.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %Deref.type: type = fn_type @Deref [template]
// CHECK:STDOUT: %Deref: %Deref.type = struct_value () [template]
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %Deref.type: type = fn_type @Deref [concrete]
// CHECK:STDOUT: %Deref: %Deref.type = struct_value () [concrete]
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Int = %Core.Int
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
@@ -63,19 +63,19 @@ fn Deref(n: i32) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .Deref = %Deref.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Deref.decl: %Deref.type = fn_decl @Deref [template = constants.%Deref] {
// CHECK:STDOUT: %Deref.decl: %Deref.type = fn_decl @Deref [concrete = constants.%Deref] {
// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n
// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0
// CHECK:STDOUT: } {
// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0
// CHECK:STDOUT: %.loc11: type = splice_block %i32 [template = constants.%i32] {
// 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: %.loc11: type = splice_block %i32 [concrete = constants.%i32] {
// 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: }
// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param
// CHECK:STDOUT: }
@@ -87,25 +87,25 @@ fn Deref(n: i32) {
// CHECK:STDOUT: %.loc16: ref <error> = deref %n.ref.loc16
// CHECK:STDOUT: %n.ref.loc21: %i32 = name_ref n, %n
// CHECK:STDOUT: %.loc21: ref <error> = deref %n.ref.loc21
// CHECK:STDOUT: %foo.ref.loc21: <error> = name_ref foo, <error> [template = <error>]
// CHECK:STDOUT: %foo.ref.loc21: <error> = name_ref foo, <error> [concrete = <error>]
// CHECK:STDOUT: %.loc26_5.1: %empty_tuple.type = tuple_literal ()
// CHECK:STDOUT: %empty_tuple.loc26: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_5.2: %empty_tuple.type = converted %.loc26_5.1, %empty_tuple.loc26 [template = constants.%empty_tuple]
// CHECK:STDOUT: %empty_tuple.loc26: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_5.2: %empty_tuple.type = converted %.loc26_5.1, %empty_tuple.loc26 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_3: ref <error> = deref %.loc26_5.2
// CHECK:STDOUT: %.loc31_4.1: %empty_tuple.type = tuple_literal ()
// CHECK:STDOUT: %empty_tuple.loc31: %empty_tuple.type = tuple_value () [template = constants.%empty_tuple]
// CHECK:STDOUT: %.loc31_4.2: %empty_tuple.type = converted %.loc31_4.1, %empty_tuple.loc31 [template = constants.%empty_tuple]
// CHECK:STDOUT: %empty_tuple.loc31: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc31_4.2: %empty_tuple.type = converted %.loc31_4.1, %empty_tuple.loc31 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc31_5: ref <error> = deref %.loc31_4.2
// CHECK:STDOUT: %foo.ref.loc31: <error> = name_ref foo, <error> [template = <error>]
// CHECK:STDOUT: %foo.ref.loc31: <error> = name_ref foo, <error> [concrete = <error>]
// CHECK:STDOUT: %.loc36_5.1: %empty_struct_type = struct_literal ()
// CHECK:STDOUT: %empty_struct.loc36: %empty_struct_type = struct_value () [template = constants.%empty_struct]
// CHECK:STDOUT: %.loc36_5.2: %empty_struct_type = converted %.loc36_5.1, %empty_struct.loc36 [template = constants.%empty_struct]
// CHECK:STDOUT: %empty_struct.loc36: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc36_5.2: %empty_struct_type = converted %.loc36_5.1, %empty_struct.loc36 [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc36_3: ref <error> = deref %.loc36_5.2
// CHECK:STDOUT: %.loc41_4.1: %empty_struct_type = struct_literal ()
// CHECK:STDOUT: %empty_struct.loc41: %empty_struct_type = struct_value () [template = constants.%empty_struct]
// CHECK:STDOUT: %.loc41_4.2: %empty_struct_type = converted %.loc41_4.1, %empty_struct.loc41 [template = constants.%empty_struct]
// CHECK:STDOUT: %empty_struct.loc41: %empty_struct_type = struct_value () [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc41_4.2: %empty_struct_type = converted %.loc41_4.1, %empty_struct.loc41 [concrete = constants.%empty_struct]
// CHECK:STDOUT: %.loc41_5: ref <error> = deref %.loc41_4.2
// CHECK:STDOUT: %foo.ref.loc41: <error> = name_ref foo, <error> [template = <error>]
// CHECK:STDOUT: %foo.ref.loc41: <error> = name_ref foo, <error> [concrete = <error>]
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
+11 -11
View File
@@ -25,12 +25,12 @@ var p2: i32->foo;
// CHECK:STDOUT: --- fail_deref_type.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Int = %Core.Int
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
@@ -38,7 +38,7 @@ var p2: i32->foo;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .p = %p
// CHECK:STDOUT: .p2 = %p2
@@ -49,9 +49,9 @@ var p2: i32->foo;
// CHECK:STDOUT: %.loc18_1: <error> = var_pattern %p.patt
// CHECK:STDOUT: }
// CHECK:STDOUT: %p.var: ref <error> = var p
// CHECK:STDOUT: %.1: <error> = splice_block <error> [template = <error>] {
// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.1: <error> = splice_block <error> [concrete = <error>] {
// CHECK:STDOUT: %int_32.loc18: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc18: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %.loc18_8: ref <error> = deref %i32.loc18
// CHECK:STDOUT: }
// CHECK:STDOUT: %p: <error> = bind_name p, <error>
@@ -60,11 +60,11 @@ var p2: i32->foo;
// CHECK:STDOUT: %.loc23_1: <error> = var_pattern %p2.patt
// CHECK:STDOUT: }
// CHECK:STDOUT: %p2.var: ref <error> = var p2
// CHECK:STDOUT: %.2: <error> = splice_block <error> [template = <error>] {
// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.2: <error> = splice_block <error> [concrete = <error>] {
// CHECK:STDOUT: %int_32.loc23: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc23: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %.loc23_12: ref <error> = deref %i32.loc23
// CHECK:STDOUT: %foo.ref: <error> = name_ref foo, <error> [template = <error>]
// CHECK:STDOUT: %foo.ref: <error> = name_ref foo, <error> [concrete = <error>]
// CHECK:STDOUT: }
// CHECK:STDOUT: %p2: <error> = bind_name p2, <error>
// CHECK:STDOUT: }
+18 -18
View File
@@ -22,17 +22,17 @@ fn ConstMismatch(p: const {}*) -> const ({}*) {
// CHECK:STDOUT: --- fail_type_mismatch.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template]
// CHECK:STDOUT: %const.c48: type = const_type %empty_struct_type [template]
// CHECK:STDOUT: %ptr.bf9: type = ptr_type %const.c48 [template]
// CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [template]
// CHECK:STDOUT: %const.987: type = const_type %ptr.c28 [template]
// CHECK:STDOUT: %ConstMismatch.type: type = fn_type @ConstMismatch [template]
// CHECK:STDOUT: %ConstMismatch: %ConstMismatch.type = struct_value () [template]
// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
// CHECK:STDOUT: %const.c48: type = const_type %empty_struct_type [concrete]
// CHECK:STDOUT: %ptr.bf9: type = ptr_type %const.c48 [concrete]
// CHECK:STDOUT: %ptr.c28: type = ptr_type %empty_struct_type [concrete]
// CHECK:STDOUT: %const.987: type = const_type %ptr.c28 [concrete]
// CHECK:STDOUT: %ConstMismatch.type: type = fn_type @ConstMismatch [concrete]
// CHECK:STDOUT: %ConstMismatch: %ConstMismatch.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
@@ -40,27 +40,27 @@ fn ConstMismatch(p: const {}*) -> const ({}*) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .ConstMismatch = %ConstMismatch.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %ConstMismatch.decl: %ConstMismatch.type = fn_decl @ConstMismatch [template = constants.%ConstMismatch] {
// CHECK:STDOUT: %ConstMismatch.decl: %ConstMismatch.type = fn_decl @ConstMismatch [concrete = constants.%ConstMismatch] {
// CHECK:STDOUT: %p.patt: %ptr.bf9 = binding_pattern p
// CHECK:STDOUT: %p.param_patt: %ptr.bf9 = value_param_pattern %p.patt, runtime_param0
// CHECK:STDOUT: %return.patt: %const.987 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %const.987 = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %.loc11_43: %empty_struct_type = struct_literal ()
// CHECK:STDOUT: %.loc11_44: type = converted %.loc11_43, constants.%empty_struct_type [template = constants.%empty_struct_type]
// CHECK:STDOUT: %ptr.loc11_44: type = ptr_type %empty_struct_type [template = constants.%ptr.c28]
// CHECK:STDOUT: %const.loc11_35: type = const_type %ptr.c28 [template = constants.%const.987]
// CHECK:STDOUT: %.loc11_44: type = converted %.loc11_43, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT: %ptr.loc11_44: type = ptr_type %empty_struct_type [concrete = constants.%ptr.c28]
// CHECK:STDOUT: %const.loc11_35: type = const_type %ptr.c28 [concrete = constants.%const.987]
// CHECK:STDOUT: %p.param: %ptr.bf9 = value_param runtime_param0
// CHECK:STDOUT: %.loc11_29: type = splice_block %ptr.loc11_29 [template = constants.%ptr.bf9] {
// CHECK:STDOUT: %.loc11_29: type = splice_block %ptr.loc11_29 [concrete = constants.%ptr.bf9] {
// CHECK:STDOUT: %.loc11_28: %empty_struct_type = struct_literal ()
// CHECK:STDOUT: %.loc11_21: type = converted %.loc11_28, constants.%empty_struct_type [template = constants.%empty_struct_type]
// CHECK:STDOUT: %const.loc11_21: type = const_type %empty_struct_type [template = constants.%const.c48]
// CHECK:STDOUT: %ptr.loc11_29: type = ptr_type %const.c48 [template = constants.%ptr.bf9]
// CHECK:STDOUT: %.loc11_21: type = converted %.loc11_28, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
// CHECK:STDOUT: %const.loc11_21: type = const_type %empty_struct_type [concrete = constants.%const.c48]
// CHECK:STDOUT: %ptr.loc11_29: type = ptr_type %const.c48 [concrete = constants.%ptr.bf9]
// CHECK:STDOUT: }
// CHECK:STDOUT: %p: %ptr.bf9 = bind_name p, %p.param
// CHECK:STDOUT: %return.param: ref %const.987 = out_param runtime_param1
@@ -71,7 +71,7 @@ fn ConstMismatch(p: const {}*) -> const ({}*) {
// CHECK:STDOUT: fn @ConstMismatch(%p.param_patt: %ptr.bf9) -> %const.987 {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %p.ref: %ptr.bf9 = name_ref p, %p
// CHECK:STDOUT: %.loc19: %const.987 = converted %p.ref, <error> [template = <error>]
// CHECK:STDOUT: %.loc19: %const.987 = converted %p.ref, <error> [concrete = <error>]
// CHECK:STDOUT: return <error>
// CHECK:STDOUT: }
// CHECK:STDOUT:
+38 -38
View File
@@ -24,24 +24,24 @@ var a: i32* = a_ref;
// CHECK:STDOUT: --- implicit.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [template]
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [template]
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [template]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [template]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [template]
// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [template]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.956 [template]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [template]
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete]
// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
// CHECK:STDOUT: %impl_witness.d39: <witness> = impl_witness (imports.%Core.import_ref.a5b), @impl.1(%int_32) [concrete]
// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.1(%int_32) [concrete]
// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete]
// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, %impl_witness.d39 [concrete]
// CHECK:STDOUT: %.a0b: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete]
// CHECK:STDOUT: %Convert.bound: <bound method> = bound_method %int_0.5c6, %Convert.956 [concrete]
// CHECK:STDOUT: %Convert.specific_fn: <specific function> = specific_function %Convert.bound, @Convert.2(%int_32) [concrete]
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Int = %Core.Int
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
// CHECK:STDOUT: import Core//prelude
@@ -50,7 +50,7 @@ var a: i32* = a_ref;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .a_orig = %a_orig
// CHECK:STDOUT: .a_ref = %a_ref
@@ -61,9 +61,9 @@ var a: i32* = a_ref;
// CHECK:STDOUT: %.loc4_1: %i32 = var_pattern %a_orig.patt
// CHECK:STDOUT: }
// CHECK:STDOUT: %a_orig.var: ref %i32 = var a_orig
// CHECK:STDOUT: %.loc4_13: type = splice_block %i32.loc4 [template = constants.%i32] {
// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %.loc4_13: type = splice_block %i32.loc4 [concrete = constants.%i32] {
// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: }
// CHECK:STDOUT: %a_orig: ref %i32 = bind_name a_orig, %a_orig.var
// CHECK:STDOUT: name_binding_decl {
@@ -71,22 +71,22 @@ var a: i32* = a_ref;
// CHECK:STDOUT: %.loc5_1: %ptr = var_pattern %a_ref.patt
// CHECK:STDOUT: }
// CHECK:STDOUT: %a_ref.var: ref %ptr = var a_ref
// CHECK:STDOUT: %.loc5_15: type = splice_block %ptr [template = constants.%ptr] {
// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template = constants.%ptr]
// CHECK:STDOUT: %.loc5_15: type = splice_block %ptr [concrete = constants.%ptr] {
// CHECK:STDOUT: %int_32.loc5: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc5: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %a_ref: ref %ptr = bind_name a_ref, %a_ref.var
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @__global_init() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [template = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %int.convert_checked [template = constants.%int_0.6a9]
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
// CHECK:STDOUT: %impl.elem0: %.a0b = impl_witness_access constants.%impl_witness.d39, element0 [concrete = constants.%Convert.956]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Convert.bound]
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %bound_method, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %specific_fn(%int_0) [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: %.loc4: init %i32 = converted %int_0, %int.convert_checked [concrete = constants.%int_0.6a9]
// CHECK:STDOUT: assign file.%a_orig.var, %.loc4
// CHECK:STDOUT: %a_orig.ref: ref %i32 = name_ref a_orig, file.%a_orig
// CHECK:STDOUT: %addr: %ptr = addr_of %a_orig.ref
@@ -97,15 +97,15 @@ var a: i32* = a_ref;
// CHECK:STDOUT: --- implicit.impl.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %ptr: type = ptr_type %i32 [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Implicit.a_orig = import_ref Implicit//default, a_orig, unloaded
// CHECK:STDOUT: %Implicit.a_ref: ref %ptr = import_ref Implicit//default, a_ref, loaded
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Int = %Core.Int
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
@@ -113,7 +113,7 @@ var a: i32* = a_ref;
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .a_orig = imports.%Implicit.a_orig
// CHECK:STDOUT: .a_ref = imports.%Implicit.a_ref
// CHECK:STDOUT: .Core = imports.%Core
@@ -127,10 +127,10 @@ var a: i32* = a_ref;
// CHECK:STDOUT: %.loc4_1: %ptr = var_pattern %a.patt
// CHECK:STDOUT: }
// CHECK:STDOUT: %a.var: ref %ptr = var a
// CHECK:STDOUT: %.loc4_11: type = splice_block %ptr [template = constants.%ptr] {
// 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: %ptr: type = ptr_type %i32 [template = constants.%ptr]
// CHECK:STDOUT: %.loc4_11: type = splice_block %ptr [concrete = constants.%ptr] {
// 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: %ptr: type = ptr_type %i32 [concrete = constants.%ptr]
// CHECK:STDOUT: }
// CHECK:STDOUT: %a: ref %ptr = bind_name a, %a.var
// CHECK:STDOUT: }
+23 -23
View File
@@ -16,19 +16,19 @@ fn F(p: const (const (const i32*)*)) -> const i32 {
// CHECK:STDOUT: --- nested_const.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %const.20a: type = const_type %i32 [template]
// CHECK:STDOUT: %ptr.36b: type = ptr_type %const.20a [template]
// CHECK:STDOUT: %const.58f: type = const_type %ptr.36b [template]
// CHECK:STDOUT: %ptr.6e8: type = ptr_type %const.58f [template]
// CHECK:STDOUT: %const.fa2: type = const_type %ptr.6e8 [template]
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %const.20a: type = const_type %i32 [concrete]
// CHECK:STDOUT: %ptr.36b: type = ptr_type %const.20a [concrete]
// CHECK:STDOUT: %const.58f: type = const_type %ptr.36b [concrete]
// CHECK:STDOUT: %ptr.6e8: type = ptr_type %const.58f [concrete]
// CHECK:STDOUT: %const.fa2: type = const_type %ptr.6e8 [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: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Int = %Core.Int
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
@@ -36,29 +36,29 @@ fn F(p: const (const (const i32*)*)) -> const i32 {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %p.patt: %const.fa2 = binding_pattern p
// CHECK:STDOUT: %p.param_patt: %const.fa2 = value_param_pattern %p.patt, runtime_param0
// CHECK:STDOUT: %return.patt: %const.20a = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %const.20a = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc12_47: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc12_47: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %const.loc12_41: type = const_type %i32 [template = constants.%const.20a]
// CHECK:STDOUT: %int_32.loc12_47: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc12_47: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %const.loc12_41: type = const_type %i32 [concrete = constants.%const.20a]
// CHECK:STDOUT: %p.param: %const.fa2 = value_param runtime_param0
// CHECK:STDOUT: %.loc12: type = splice_block %const.loc12_9 [template = constants.%const.fa2] {
// CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc12_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %const.loc12_23: type = const_type %i32 [template = constants.%const.20a]
// CHECK:STDOUT: %ptr.loc12_32: type = ptr_type %const.20a [template = constants.%ptr.36b]
// CHECK:STDOUT: %const.loc12_16: type = const_type %ptr.36b [template = constants.%const.58f]
// CHECK:STDOUT: %ptr.loc12_34: type = ptr_type %const.58f [template = constants.%ptr.6e8]
// CHECK:STDOUT: %const.loc12_9: type = const_type %ptr.6e8 [template = constants.%const.fa2]
// CHECK:STDOUT: %.loc12: type = splice_block %const.loc12_9 [concrete = constants.%const.fa2] {
// CHECK:STDOUT: %int_32.loc12_29: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc12_29: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %const.loc12_23: type = const_type %i32 [concrete = constants.%const.20a]
// CHECK:STDOUT: %ptr.loc12_32: type = ptr_type %const.20a [concrete = constants.%ptr.36b]
// CHECK:STDOUT: %const.loc12_16: type = const_type %ptr.36b [concrete = constants.%const.58f]
// CHECK:STDOUT: %ptr.loc12_34: type = ptr_type %const.58f [concrete = constants.%ptr.6e8]
// CHECK:STDOUT: %const.loc12_9: type = const_type %ptr.6e8 [concrete = constants.%const.fa2]
// CHECK:STDOUT: }
// CHECK:STDOUT: %p: %const.fa2 = bind_name p, %p.param
// CHECK:STDOUT: %return.param: ref %const.20a = out_param runtime_param1
+29 -29
View File
@@ -19,19 +19,19 @@ fn ConstPtr(p: const i32*) -> (const i32)* {
// CHECK:STDOUT: --- types.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
// CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [template]
// CHECK:STDOUT: %Ptr.type: type = fn_type @Ptr [template]
// CHECK:STDOUT: %Ptr: %Ptr.type = struct_value () [template]
// CHECK:STDOUT: %const: type = const_type %i32 [template]
// CHECK:STDOUT: %ptr.36b: type = ptr_type %const [template]
// CHECK:STDOUT: %ConstPtr.type: type = fn_type @ConstPtr [template]
// CHECK:STDOUT: %ConstPtr: %ConstPtr.type = struct_value () [template]
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
// CHECK:STDOUT: %ptr.235: type = ptr_type %i32 [concrete]
// CHECK:STDOUT: %Ptr.type: type = fn_type @Ptr [concrete]
// CHECK:STDOUT: %Ptr: %Ptr.type = struct_value () [concrete]
// CHECK:STDOUT: %const: type = const_type %i32 [concrete]
// CHECK:STDOUT: %ptr.36b: type = ptr_type %const [concrete]
// CHECK:STDOUT: %ConstPtr.type: type = fn_type @ConstPtr [concrete]
// CHECK:STDOUT: %ConstPtr: %ConstPtr.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Int = %Core.Int
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
@@ -39,47 +39,47 @@ fn ConstPtr(p: const i32*) -> (const i32)* {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [template] {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .Ptr = %Ptr.decl
// CHECK:STDOUT: .ConstPtr = %ConstPtr.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %Ptr.decl: %Ptr.type = fn_decl @Ptr [template = constants.%Ptr] {
// CHECK:STDOUT: %Ptr.decl: %Ptr.type = fn_decl @Ptr [concrete = constants.%Ptr] {
// CHECK:STDOUT: %p.patt: %ptr.235 = binding_pattern p
// CHECK:STDOUT: %p.param_patt: %ptr.235 = value_param_pattern %p.patt, runtime_param0
// CHECK:STDOUT: %return.patt: %ptr.235 = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %ptr.235 = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc11_20: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc11_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %ptr.loc11_23: type = ptr_type %i32 [template = constants.%ptr.235]
// CHECK:STDOUT: %int_32.loc11_20: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc11_20: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc11_23: type = ptr_type %i32 [concrete = constants.%ptr.235]
// CHECK:STDOUT: %p.param: %ptr.235 = value_param runtime_param0
// CHECK:STDOUT: %.loc11: type = splice_block %ptr.loc11_14 [template = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %ptr.loc11_14: type = ptr_type %i32 [template = constants.%ptr.235]
// CHECK:STDOUT: %.loc11: type = splice_block %ptr.loc11_14 [concrete = constants.%ptr.235] {
// CHECK:STDOUT: %int_32.loc11_11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc11_11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %ptr.loc11_14: type = ptr_type %i32 [concrete = constants.%ptr.235]
// CHECK:STDOUT: }
// CHECK:STDOUT: %p: %ptr.235 = bind_name p, %p.param
// CHECK:STDOUT: %return.param: ref %ptr.235 = out_param runtime_param1
// CHECK:STDOUT: %return: ref %ptr.235 = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %ConstPtr.decl: %ConstPtr.type = fn_decl @ConstPtr [template = constants.%ConstPtr] {
// CHECK:STDOUT: %ConstPtr.decl: %ConstPtr.type = fn_decl @ConstPtr [concrete = constants.%ConstPtr] {
// CHECK:STDOUT: %p.patt: %ptr.36b = binding_pattern p
// CHECK:STDOUT: %p.param_patt: %ptr.36b = value_param_pattern %p.patt, runtime_param0
// CHECK:STDOUT: %return.patt: %ptr.36b = return_slot_pattern
// CHECK:STDOUT: %return.param_patt: %ptr.36b = out_param_pattern %return.patt, runtime_param1
// CHECK:STDOUT: } {
// CHECK:STDOUT: %int_32.loc15_38: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc15_38: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %const.loc15_32: type = const_type %i32 [template = constants.%const]
// CHECK:STDOUT: %ptr.loc15_42: type = ptr_type %const [template = constants.%ptr.36b]
// CHECK:STDOUT: %int_32.loc15_38: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc15_38: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %const.loc15_32: type = const_type %i32 [concrete = constants.%const]
// CHECK:STDOUT: %ptr.loc15_42: type = ptr_type %const [concrete = constants.%ptr.36b]
// CHECK:STDOUT: %p.param: %ptr.36b = value_param runtime_param0
// CHECK:STDOUT: %.loc15: type = splice_block %ptr.loc15_25 [template = constants.%ptr.36b] {
// CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
// CHECK:STDOUT: %const.loc15_16: type = const_type %i32 [template = constants.%const]
// CHECK:STDOUT: %ptr.loc15_25: type = ptr_type %const [template = constants.%ptr.36b]
// CHECK:STDOUT: %.loc15: type = splice_block %ptr.loc15_25 [concrete = constants.%ptr.36b] {
// CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
// CHECK:STDOUT: %const.loc15_16: type = const_type %i32 [concrete = constants.%const]
// CHECK:STDOUT: %ptr.loc15_25: type = ptr_type %const [concrete = constants.%ptr.36b]
// CHECK:STDOUT: }
// CHECK:STDOUT: %p: %ptr.36b = bind_name p, %p.param
// CHECK:STDOUT: %return.param: ref %ptr.36b = out_param runtime_param1