Files
carbon-lang/toolchain/check/testdata/operators/builtin/or.carbon
T
Richard Smith e3a366f1c3 Add prelude impl of Iterate for array types. (#5895)
Iterate over arrays by producing their elements in the obvious way. We
use `i32` as the cursor type because that's the type that check converts
array indexes to. This may need revisiting if we support arrays with
more than 2Bi elements.

Also includes a fix for an import crash bug that's triggered by this
change, borrowed from #5873.
2025-08-01 16:13:22 +00:00

402 lines
24 KiB
Plaintext

// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/bool.carbon
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
// EXTRA-ARGS: --dump-sem-ir-ranges=if-present
//
// AUTOUPDATE
// TIP: To test this file alone, run:
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/operators/builtin/or.carbon
// TIP: To dump output, run:
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/builtin/or.carbon
fn F() -> bool { return true; }
fn G() -> bool { return true; }
fn Or() -> bool {
return F() or G();
}
fn Constant() {
var a: if true or true then bool else () = true;
var b: if true or false then bool else () = true;
var c: if false or true then bool else () = true;
var d: if false or false then bool else () = ();
}
fn PartialConstant(x: bool) {
var a: if true or x then bool else () = true;
}
// CHECK:STDOUT: --- or.carbon
// CHECK:STDOUT:
// CHECK:STDOUT: constants {
// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete]
// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete]
// CHECK:STDOUT: %pattern_type.831: type = pattern_type bool [concrete]
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
// CHECK:STDOUT: %true: bool = bool_literal true [concrete]
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
// CHECK:STDOUT: %Or.type: type = fn_type @Or [concrete]
// CHECK:STDOUT: %Or: %Or.type = struct_value () [concrete]
// CHECK:STDOUT: %Constant.type: type = fn_type @Constant [concrete]
// CHECK:STDOUT: %Constant: %Constant.type = struct_value () [concrete]
// CHECK:STDOUT: %false: bool = bool_literal false [concrete]
// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete]
// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
// CHECK:STDOUT: %T.as.Destroy.impl.Op.type.a63: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(%empty_tuple.type) [concrete]
// CHECK:STDOUT: %T.as.Destroy.impl.Op.ea3: %T.as.Destroy.impl.Op.type.a63 = struct_value () [concrete]
// CHECK:STDOUT: %ptr.843: type = ptr_type %empty_tuple.type [concrete]
// CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.393: <specific function> = specific_function %T.as.Destroy.impl.Op.ea3, @T.as.Destroy.impl.Op(%empty_tuple.type) [concrete]
// CHECK:STDOUT: %T.as.Destroy.impl.Op.type.655: type = fn_type @T.as.Destroy.impl.Op, @T.as.Destroy.impl(bool) [concrete]
// CHECK:STDOUT: %T.as.Destroy.impl.Op.8b7: %T.as.Destroy.impl.Op.type.655 = struct_value () [concrete]
// CHECK:STDOUT: %ptr.bb2: type = ptr_type bool [concrete]
// CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.c3f: <specific function> = specific_function %T.as.Destroy.impl.Op.8b7, @T.as.Destroy.impl.Op(bool) [concrete]
// CHECK:STDOUT: %PartialConstant.type: type = fn_type @PartialConstant [concrete]
// CHECK:STDOUT: %PartialConstant: %PartialConstant.type = struct_value () [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: imports {
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
// CHECK:STDOUT: .Bool = %Core.Bool
// CHECK:STDOUT: .Destroy = %Core.Destroy
// CHECK:STDOUT: import Core//prelude
// CHECK:STDOUT: import Core//prelude/...
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/parts/bool, Bool, loaded [concrete = constants.%Bool]
// CHECK:STDOUT: %Core.Destroy: type = import_ref Core//prelude/parts/destroy, Destroy, loaded [concrete = constants.%Destroy.type]
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: file {
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
// CHECK:STDOUT: .Core = imports.%Core
// CHECK:STDOUT: .F = %F.decl
// CHECK:STDOUT: .G = %G.decl
// CHECK:STDOUT: .Or = %Or.decl
// CHECK:STDOUT: .Constant = %Constant.decl
// CHECK:STDOUT: .PartialConstant = %PartialConstant.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: %Core.import = import Core
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
// CHECK:STDOUT: %.loc15_11.1: type = value_of_initializer %Bool.call [concrete = bool]
// CHECK:STDOUT: %.loc15_11.2: type = converted %Bool.call, %.loc15_11.1 [concrete = bool]
// CHECK:STDOUT: %return.param: ref bool = out_param call_param0
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
// CHECK:STDOUT: %.loc16_11.1: type = value_of_initializer %Bool.call [concrete = bool]
// CHECK:STDOUT: %.loc16_11.2: type = converted %Bool.call, %.loc16_11.1 [concrete = bool]
// CHECK:STDOUT: %return.param: ref bool = out_param call_param0
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Or.decl: %Or.type = fn_decl @Or [concrete = constants.%Or] {
// CHECK:STDOUT: %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
// CHECK:STDOUT: %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %Bool.call: init type = call constants.%Bool() [concrete = bool]
// CHECK:STDOUT: %.loc18_12.1: type = value_of_initializer %Bool.call [concrete = bool]
// CHECK:STDOUT: %.loc18_12.2: type = converted %Bool.call, %.loc18_12.1 [concrete = bool]
// CHECK:STDOUT: %return.param: ref bool = out_param call_param0
// CHECK:STDOUT: %return: ref bool = return_slot %return.param
// CHECK:STDOUT: }
// CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [concrete = constants.%Constant] {} {}
// CHECK:STDOUT: %PartialConstant.decl: %PartialConstant.type = fn_decl @PartialConstant [concrete = constants.%PartialConstant] {
// CHECK:STDOUT: %x.patt: %pattern_type.831 = binding_pattern x [concrete]
// CHECK:STDOUT: %x.param_patt: %pattern_type.831 = value_param_pattern %x.patt, call_param0 [concrete]
// CHECK:STDOUT: } {
// CHECK:STDOUT: %x.param: bool = value_param call_param0
// CHECK:STDOUT: %.loc29_23.1: type = splice_block %.loc29_23.3 [concrete = bool] {
// CHECK:STDOUT: %Bool.call.loc29: init type = call constants.%Bool() [concrete = bool]
// CHECK:STDOUT: %.loc29_23.2: type = value_of_initializer %Bool.call.loc29 [concrete = bool]
// CHECK:STDOUT: %.loc29_23.3: type = converted %Bool.call.loc29, %.loc29_23.2 [concrete = bool]
// CHECK:STDOUT: }
// CHECK:STDOUT: %x: bool = bind_name x, %x.param
// CHECK:STDOUT: }
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @F() -> bool {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: return %true
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @G() -> bool {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: return %true
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Or() -> bool {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
// CHECK:STDOUT: %F.call: init bool = call %F.ref()
// CHECK:STDOUT: %.loc19_14.1: bool = value_of_initializer %F.call
// CHECK:STDOUT: %.loc19_14.2: bool = converted %F.call, %.loc19_14.1
// CHECK:STDOUT: %.loc19_14.3: bool = not %.loc19_14.2
// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: if %.loc19_14.3 br !or.rhs else br !or.result(%true)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.rhs:
// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
// CHECK:STDOUT: %G.call: init bool = call %G.ref()
// CHECK:STDOUT: %.loc19_14.4: bool = value_of_initializer %G.call
// CHECK:STDOUT: %.loc19_14.5: bool = converted %G.call, %.loc19_14.4
// CHECK:STDOUT: br !or.result(%.loc19_14.5)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.result:
// CHECK:STDOUT: %.loc19_14.6: bool = block_arg !or.result
// CHECK:STDOUT: return %.loc19_14.6
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @Constant() {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %a.patt: %pattern_type.831 = binding_pattern a [concrete]
// CHECK:STDOUT: %a.var_patt: %pattern_type.831 = var_pattern %a.patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %a.var: ref bool = var %a.var_patt
// CHECK:STDOUT: %true.loc23_46: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: assign %a.var, %true.loc23_46
// CHECK:STDOUT: br !.loc23_13
// CHECK:STDOUT:
// CHECK:STDOUT: !.loc23_13:
// CHECK:STDOUT: %true.loc23_13: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: %.loc23_18.1: bool = not %true.loc23_13 [concrete = constants.%false]
// CHECK:STDOUT: %true.loc23_18: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: if %.loc23_18.1 br !or.rhs.loc23 else br !or.result.loc23(%true.loc23_18)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.rhs.loc23:
// CHECK:STDOUT: %true.loc23_21: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: br !or.result.loc23(%true.loc23_21)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.result.loc23:
// CHECK:STDOUT: %.loc23_18.2: bool = block_arg !or.result.loc23 [concrete = constants.%true]
// CHECK:STDOUT: if %.loc23_18.2 br !if.expr.then.loc23 else br !if.expr.else.loc23
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.then.loc23:
// CHECK:STDOUT: %Bool.call.loc23: init type = call constants.%Bool() [concrete = bool]
// CHECK:STDOUT: %.loc23_31.1: type = value_of_initializer %Bool.call.loc23 [concrete = bool]
// CHECK:STDOUT: %.loc23_31.2: type = converted %Bool.call.loc23, %.loc23_31.1 [concrete = bool]
// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_31.2)
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.else.loc23:
// CHECK:STDOUT: %.loc23_42: %empty_tuple.type = tuple_literal ()
// CHECK:STDOUT: %.loc23_36: type = converted %.loc23_42, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: br !if.expr.result.loc23(%.loc23_36)
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.result.loc23:
// CHECK:STDOUT: %.loc23_10: type = block_arg !if.expr.result.loc23 [concrete = bool]
// CHECK:STDOUT: br !.loc23_7
// CHECK:STDOUT:
// CHECK:STDOUT: !.loc23_7:
// CHECK:STDOUT: %a: ref bool = bind_name a, %a.var
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %b.patt: %pattern_type.831 = binding_pattern b [concrete]
// CHECK:STDOUT: %b.var_patt: %pattern_type.831 = var_pattern %b.patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %b.var: ref bool = var %b.var_patt
// CHECK:STDOUT: %true.loc24_47: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: assign %b.var, %true.loc24_47
// CHECK:STDOUT: br !.loc24_13
// CHECK:STDOUT:
// CHECK:STDOUT: !.loc24_13:
// CHECK:STDOUT: %true.loc24_13: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: %.loc24_18.1: bool = not %true.loc24_13 [concrete = constants.%false]
// CHECK:STDOUT: %true.loc24_18: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: if %.loc24_18.1 br !or.rhs.loc24 else br !or.result.loc24(%true.loc24_18)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.rhs.loc24:
// CHECK:STDOUT: %false.loc24: bool = bool_literal false [concrete = constants.%false]
// CHECK:STDOUT: br !or.result.loc24(%false.loc24)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.result.loc24:
// CHECK:STDOUT: %.loc24_18.2: bool = block_arg !or.result.loc24 [concrete = constants.%true]
// CHECK:STDOUT: if %.loc24_18.2 br !if.expr.then.loc24 else br !if.expr.else.loc24
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.then.loc24:
// CHECK:STDOUT: %Bool.call.loc24: init type = call constants.%Bool() [concrete = bool]
// CHECK:STDOUT: %.loc24_32.1: type = value_of_initializer %Bool.call.loc24 [concrete = bool]
// CHECK:STDOUT: %.loc24_32.2: type = converted %Bool.call.loc24, %.loc24_32.1 [concrete = bool]
// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_32.2)
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.else.loc24:
// CHECK:STDOUT: %.loc24_43: %empty_tuple.type = tuple_literal ()
// CHECK:STDOUT: %.loc24_37: type = converted %.loc24_43, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: br !if.expr.result.loc24(%.loc24_37)
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.result.loc24:
// CHECK:STDOUT: %.loc24_10: type = block_arg !if.expr.result.loc24 [concrete = bool]
// CHECK:STDOUT: br !.loc24_7
// CHECK:STDOUT:
// CHECK:STDOUT: !.loc24_7:
// CHECK:STDOUT: %b: ref bool = bind_name b, %b.var
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %c.patt: %pattern_type.831 = binding_pattern c [concrete]
// CHECK:STDOUT: %c.var_patt: %pattern_type.831 = var_pattern %c.patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %c.var: ref bool = var %c.var_patt
// CHECK:STDOUT: %true.loc25_47: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: assign %c.var, %true.loc25_47
// CHECK:STDOUT: br !.loc25_13
// CHECK:STDOUT:
// CHECK:STDOUT: !.loc25_13:
// CHECK:STDOUT: %false.loc25: bool = bool_literal false [concrete = constants.%false]
// CHECK:STDOUT: %.loc25_19.1: bool = not %false.loc25 [concrete = constants.%true]
// CHECK:STDOUT: %true.loc25_19: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: if %.loc25_19.1 br !or.rhs.loc25 else br !or.result.loc25(%true.loc25_19)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.rhs.loc25:
// CHECK:STDOUT: %true.loc25_22: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: br !or.result.loc25(%true.loc25_22)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.result.loc25:
// CHECK:STDOUT: %.loc25_19.2: bool = block_arg !or.result.loc25 [concrete = constants.%true]
// CHECK:STDOUT: if %.loc25_19.2 br !if.expr.then.loc25 else br !if.expr.else.loc25
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.then.loc25:
// CHECK:STDOUT: %Bool.call.loc25: init type = call constants.%Bool() [concrete = bool]
// CHECK:STDOUT: %.loc25_32.1: type = value_of_initializer %Bool.call.loc25 [concrete = bool]
// CHECK:STDOUT: %.loc25_32.2: type = converted %Bool.call.loc25, %.loc25_32.1 [concrete = bool]
// CHECK:STDOUT: br !if.expr.result.loc25(%.loc25_32.2)
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.else.loc25:
// CHECK:STDOUT: %.loc25_43: %empty_tuple.type = tuple_literal ()
// CHECK:STDOUT: %.loc25_37: type = converted %.loc25_43, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: br !if.expr.result.loc25(%.loc25_37)
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.result.loc25:
// CHECK:STDOUT: %.loc25_10: type = block_arg !if.expr.result.loc25 [concrete = bool]
// CHECK:STDOUT: br !.loc25_7
// CHECK:STDOUT:
// CHECK:STDOUT: !.loc25_7:
// CHECK:STDOUT: %c: ref bool = bind_name c, %c.var
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %d.patt: %pattern_type.cb1 = binding_pattern d [concrete]
// CHECK:STDOUT: %d.var_patt: %pattern_type.cb1 = var_pattern %d.patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %d.var: ref %empty_tuple.type = var %d.var_patt
// CHECK:STDOUT: %.loc26_49.1: %empty_tuple.type = tuple_literal ()
// CHECK:STDOUT: %.loc26_49.2: init %empty_tuple.type = tuple_init () to %d.var [concrete = constants.%empty_tuple]
// CHECK:STDOUT: %.loc26_3: init %empty_tuple.type = converted %.loc26_49.1, %.loc26_49.2 [concrete = constants.%empty_tuple]
// CHECK:STDOUT: assign %d.var, %.loc26_3
// CHECK:STDOUT: br !.loc26_13
// CHECK:STDOUT:
// CHECK:STDOUT: !.loc26_13:
// CHECK:STDOUT: %false.loc26_13: bool = bool_literal false [concrete = constants.%false]
// CHECK:STDOUT: %.loc26_19.1: bool = not %false.loc26_13 [concrete = constants.%true]
// CHECK:STDOUT: %true.loc26: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: if %.loc26_19.1 br !or.rhs.loc26 else br !or.result.loc26(%true.loc26)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.rhs.loc26:
// CHECK:STDOUT: %false.loc26_22: bool = bool_literal false [concrete = constants.%false]
// CHECK:STDOUT: br !or.result.loc26(%false.loc26_22)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.result.loc26:
// CHECK:STDOUT: %.loc26_19.2: bool = block_arg !or.result.loc26 [concrete = constants.%false]
// CHECK:STDOUT: if %.loc26_19.2 br !if.expr.then.loc26 else br !if.expr.else.loc26
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.then.loc26:
// CHECK:STDOUT: %Bool.call.loc26: init type = call constants.%Bool() [concrete = bool]
// CHECK:STDOUT: %.loc26_33.1: type = value_of_initializer %Bool.call.loc26 [concrete = bool]
// CHECK:STDOUT: %.loc26_33.2: type = converted %Bool.call.loc26, %.loc26_33.1 [concrete = bool]
// CHECK:STDOUT: br !if.expr.result.loc26(%.loc26_33.2)
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.else.loc26:
// CHECK:STDOUT: %.loc26_44: %empty_tuple.type = tuple_literal ()
// CHECK:STDOUT: %.loc26_38: type = converted %.loc26_44, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: br !if.expr.result.loc26(%.loc26_38)
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.result.loc26:
// CHECK:STDOUT: %.loc26_10: type = block_arg !if.expr.result.loc26 [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: br !.loc26_7
// CHECK:STDOUT:
// CHECK:STDOUT: !.loc26_7:
// CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc26: <bound method> = bound_method %d.var, constants.%T.as.Destroy.impl.Op.ea3
// CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.1: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.ea3, @T.as.Destroy.impl.Op(constants.%empty_tuple.type) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.393]
// CHECK:STDOUT: %bound_method.loc26: <bound method> = bound_method %d.var, %T.as.Destroy.impl.Op.specific_fn.1
// CHECK:STDOUT: %addr.loc26: %ptr.843 = addr_of %d.var
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc26: init %empty_tuple.type = call %bound_method.loc26(%addr.loc26)
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc25: <bound method> = bound_method %c.var, constants.%T.as.Destroy.impl.Op.8b7
// CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.2: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.8b7, @T.as.Destroy.impl.Op(bool) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.c3f]
// CHECK:STDOUT: %bound_method.loc25: <bound method> = bound_method %c.var, %T.as.Destroy.impl.Op.specific_fn.2
// CHECK:STDOUT: %addr.loc25: %ptr.bb2 = addr_of %c.var
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc25: init %empty_tuple.type = call %bound_method.loc25(%addr.loc25)
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc24: <bound method> = bound_method %b.var, constants.%T.as.Destroy.impl.Op.8b7
// CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.3: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.8b7, @T.as.Destroy.impl.Op(bool) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.c3f]
// CHECK:STDOUT: %bound_method.loc24: <bound method> = bound_method %b.var, %T.as.Destroy.impl.Op.specific_fn.3
// CHECK:STDOUT: %addr.loc24: %ptr.bb2 = addr_of %b.var
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc24: init %empty_tuple.type = call %bound_method.loc24(%addr.loc24)
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound.loc23: <bound method> = bound_method %a.var, constants.%T.as.Destroy.impl.Op.8b7
// CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn.4: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.8b7, @T.as.Destroy.impl.Op(bool) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.c3f]
// CHECK:STDOUT: %bound_method.loc23: <bound method> = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn.4
// CHECK:STDOUT: %addr.loc23: %ptr.bb2 = addr_of %a.var
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call.loc23: init %empty_tuple.type = call %bound_method.loc23(%addr.loc23)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: fn @PartialConstant(%x.param: bool) {
// CHECK:STDOUT: !entry:
// CHECK:STDOUT: name_binding_decl {
// CHECK:STDOUT: %a.patt: %pattern_type.831 = binding_pattern a [concrete]
// CHECK:STDOUT: %a.var_patt: %pattern_type.831 = var_pattern %a.patt [concrete]
// CHECK:STDOUT: }
// CHECK:STDOUT: %a.var: ref bool = var %a.var_patt
// CHECK:STDOUT: %true.loc30_43: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: assign %a.var, %true.loc30_43
// CHECK:STDOUT: br !.loc30_13
// CHECK:STDOUT:
// CHECK:STDOUT: !.loc30_13:
// CHECK:STDOUT: %true.loc30_13: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: %.loc30_18.1: bool = not %true.loc30_13 [concrete = constants.%false]
// CHECK:STDOUT: %true.loc30_18: bool = bool_literal true [concrete = constants.%true]
// CHECK:STDOUT: if %.loc30_18.1 br !or.rhs else br !or.result(%true.loc30_18)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.rhs:
// CHECK:STDOUT: %x.ref: bool = name_ref x, %x
// CHECK:STDOUT: br !or.result(%x.ref)
// CHECK:STDOUT:
// CHECK:STDOUT: !or.result:
// CHECK:STDOUT: %.loc30_18.2: bool = block_arg !or.result [concrete = constants.%true]
// CHECK:STDOUT: if %.loc30_18.2 br !if.expr.then else br !if.expr.else
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.then:
// CHECK:STDOUT: %Bool.call.loc30: init type = call constants.%Bool() [concrete = bool]
// CHECK:STDOUT: %.loc30_28.1: type = value_of_initializer %Bool.call.loc30 [concrete = bool]
// CHECK:STDOUT: %.loc30_28.2: type = converted %Bool.call.loc30, %.loc30_28.1 [concrete = bool]
// CHECK:STDOUT: br !if.expr.result(%.loc30_28.2)
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.else:
// CHECK:STDOUT: %.loc30_39: %empty_tuple.type = tuple_literal ()
// CHECK:STDOUT: %.loc30_33: type = converted %.loc30_39, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
// CHECK:STDOUT: br !if.expr.result(%.loc30_33)
// CHECK:STDOUT:
// CHECK:STDOUT: !if.expr.result:
// CHECK:STDOUT: %.loc30_10: type = block_arg !if.expr.result [concrete = bool]
// CHECK:STDOUT: br !.loc30_7
// CHECK:STDOUT:
// CHECK:STDOUT: !.loc30_7:
// CHECK:STDOUT: %a: ref bool = bind_name a, %a.var
// CHECK:STDOUT: %T.as.Destroy.impl.Op.bound: <bound method> = bound_method %a.var, constants.%T.as.Destroy.impl.Op.8b7
// CHECK:STDOUT: %T.as.Destroy.impl.Op.specific_fn: <specific function> = specific_function constants.%T.as.Destroy.impl.Op.8b7, @T.as.Destroy.impl.Op(bool) [concrete = constants.%T.as.Destroy.impl.Op.specific_fn.c3f]
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %a.var, %T.as.Destroy.impl.Op.specific_fn
// CHECK:STDOUT: %addr: %ptr.bb2 = addr_of %a.var
// CHECK:STDOUT: %T.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
// CHECK:STDOUT: return
// CHECK:STDOUT: }
// CHECK:STDOUT: