| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358 |
- // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- // Exceptions. See /LICENSE for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- // AUTOUPDATE
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/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 [template]
- // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
- // CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template]
- // CHECK:STDOUT: %F.type: type = fn_type @F [template]
- // CHECK:STDOUT: %F: %F.type = struct_value () [template]
- // CHECK:STDOUT: %true: bool = bool_literal true [template]
- // CHECK:STDOUT: %G.type: type = fn_type @G [template]
- // CHECK:STDOUT: %G: %G.type = struct_value () [template]
- // CHECK:STDOUT: %Or.type: type = fn_type @Or [template]
- // CHECK:STDOUT: %Or: %Or.type = struct_value () [template]
- // CHECK:STDOUT: %Constant.type: type = fn_type @Constant [template]
- // CHECK:STDOUT: %Constant: %Constant.type = struct_value () [template]
- // CHECK:STDOUT: %false: bool = bool_literal false [template]
- // CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [template]
- // CHECK:STDOUT: %PartialConstant.type: type = fn_type @PartialConstant [template]
- // CHECK:STDOUT: %PartialConstant: %PartialConstant.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: imports {
- // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
- // CHECK:STDOUT: .Bool = %Core.Bool
- // CHECK:STDOUT: import Core//prelude
- // CHECK:STDOUT: import Core//prelude/...
- // CHECK:STDOUT: }
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = imports.%Core
- // CHECK:STDOUT: .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 [template = constants.%F] {
- // CHECK:STDOUT: %return.patt: bool = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
- // CHECK:STDOUT: %.loc11_11.1: type = value_of_initializer %bool.make_type [template = bool]
- // CHECK:STDOUT: %.loc11_11.2: type = converted %bool.make_type, %.loc11_11.1 [template = bool]
- // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param0
- // CHECK:STDOUT: %return: ref bool = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] {
- // CHECK:STDOUT: %return.patt: bool = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
- // CHECK:STDOUT: %.loc12_11.1: type = value_of_initializer %bool.make_type [template = bool]
- // CHECK:STDOUT: %.loc12_11.2: type = converted %bool.make_type, %.loc12_11.1 [template = bool]
- // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param0
- // CHECK:STDOUT: %return: ref bool = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Or.decl: %Or.type = fn_decl @Or [template = constants.%Or] {
- // CHECK:STDOUT: %return.patt: bool = return_slot_pattern
- // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool]
- // CHECK:STDOUT: %.loc14_12.1: type = value_of_initializer %bool.make_type [template = bool]
- // CHECK:STDOUT: %.loc14_12.2: type = converted %bool.make_type, %.loc14_12.1 [template = bool]
- // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param0
- // CHECK:STDOUT: %return: ref bool = return_slot %return.param
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Constant.decl: %Constant.type = fn_decl @Constant [template = constants.%Constant] {} {}
- // CHECK:STDOUT: %PartialConstant.decl: %PartialConstant.type = fn_decl @PartialConstant [template = constants.%PartialConstant] {
- // CHECK:STDOUT: %x.patt: bool = binding_pattern x
- // CHECK:STDOUT: %x.param_patt: bool = value_param_pattern %x.patt, runtime_param0
- // CHECK:STDOUT: } {
- // CHECK:STDOUT: %x.param: bool = value_param runtime_param0
- // CHECK:STDOUT: %.loc25_23.1: type = splice_block %.loc25_23.3 [template = bool] {
- // CHECK:STDOUT: %bool.make_type.loc25: init type = call constants.%Bool() [template = bool]
- // CHECK:STDOUT: %.loc25_23.2: type = value_of_initializer %bool.make_type.loc25 [template = bool]
- // CHECK:STDOUT: %.loc25_23.3: type = converted %bool.make_type.loc25, %.loc25_23.2 [template = 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 [template = 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 [template = 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 [template = constants.%F]
- // CHECK:STDOUT: %F.call: init bool = call %F.ref()
- // CHECK:STDOUT: %.loc15_14.1: bool = value_of_initializer %F.call
- // CHECK:STDOUT: %.loc15_14.2: bool = converted %F.call, %.loc15_14.1
- // CHECK:STDOUT: %.loc15_14.3: bool = not %.loc15_14.2
- // CHECK:STDOUT: %true: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: if %.loc15_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 [template = constants.%G]
- // CHECK:STDOUT: %G.call: init bool = call %G.ref()
- // CHECK:STDOUT: %.loc15_14.4: bool = value_of_initializer %G.call
- // CHECK:STDOUT: %.loc15_14.5: bool = converted %G.call, %.loc15_14.4
- // CHECK:STDOUT: br !or.result(%.loc15_14.5)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !or.result:
- // CHECK:STDOUT: %.loc15_14.6: bool = block_arg !or.result
- // CHECK:STDOUT: return %.loc15_14.6
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Constant() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %a.patt: bool = binding_pattern a
- // CHECK:STDOUT: %.loc19_3: bool = var_pattern %a.patt
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a.var: ref bool = var a
- // CHECK:STDOUT: %true.loc19_46: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: assign %a.var, %true.loc19_46
- // CHECK:STDOUT: br !.loc19_13
- // CHECK:STDOUT:
- // CHECK:STDOUT: !.loc19_13:
- // CHECK:STDOUT: %true.loc19_13: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: %.loc19_18.1: bool = not %true.loc19_13 [template = constants.%false]
- // CHECK:STDOUT: %true.loc19_18: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: if %.loc19_18.1 br !or.rhs.loc19 else br !or.result.loc19(%true.loc19_18)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !or.rhs.loc19:
- // CHECK:STDOUT: %true.loc19_21: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: br !or.result.loc19(%true.loc19_21)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !or.result.loc19:
- // CHECK:STDOUT: %.loc19_18.2: bool = block_arg !or.result.loc19 [template = constants.%true]
- // CHECK:STDOUT: if %.loc19_18.2 br !if.expr.then.loc19 else br !if.expr.else.loc19
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.then.loc19:
- // CHECK:STDOUT: %bool.make_type.loc19: init type = call constants.%Bool() [template = bool]
- // CHECK:STDOUT: %.loc19_31.1: type = value_of_initializer %bool.make_type.loc19 [template = bool]
- // CHECK:STDOUT: %.loc19_31.2: type = converted %bool.make_type.loc19, %.loc19_31.1 [template = bool]
- // CHECK:STDOUT: br !if.expr.result.loc19(%.loc19_31.2)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.else.loc19:
- // CHECK:STDOUT: %.loc19_42: %empty_tuple.type = tuple_literal ()
- // CHECK:STDOUT: %.loc19_36: type = converted %.loc19_42, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
- // CHECK:STDOUT: br !if.expr.result.loc19(%.loc19_36)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.result.loc19:
- // CHECK:STDOUT: %.loc19_10: type = block_arg !if.expr.result.loc19 [template = bool]
- // CHECK:STDOUT: br !.loc19_7
- // CHECK:STDOUT:
- // CHECK:STDOUT: !.loc19_7:
- // CHECK:STDOUT: %a: ref bool = bind_name a, %a.var
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %b.patt: bool = binding_pattern b
- // CHECK:STDOUT: %.loc20_3: bool = var_pattern %b.patt
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %b.var: ref bool = var b
- // CHECK:STDOUT: %true.loc20_47: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: assign %b.var, %true.loc20_47
- // CHECK:STDOUT: br !.loc20_13
- // CHECK:STDOUT:
- // CHECK:STDOUT: !.loc20_13:
- // CHECK:STDOUT: %true.loc20_13: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: %.loc20_18.1: bool = not %true.loc20_13 [template = constants.%false]
- // CHECK:STDOUT: %true.loc20_18: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: if %.loc20_18.1 br !or.rhs.loc20 else br !or.result.loc20(%true.loc20_18)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !or.rhs.loc20:
- // CHECK:STDOUT: %false.loc20: bool = bool_literal false [template = constants.%false]
- // CHECK:STDOUT: br !or.result.loc20(%false.loc20)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !or.result.loc20:
- // CHECK:STDOUT: %.loc20_18.2: bool = block_arg !or.result.loc20 [template = constants.%true]
- // CHECK:STDOUT: if %.loc20_18.2 br !if.expr.then.loc20 else br !if.expr.else.loc20
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.then.loc20:
- // CHECK:STDOUT: %bool.make_type.loc20: init type = call constants.%Bool() [template = bool]
- // CHECK:STDOUT: %.loc20_32.1: type = value_of_initializer %bool.make_type.loc20 [template = bool]
- // CHECK:STDOUT: %.loc20_32.2: type = converted %bool.make_type.loc20, %.loc20_32.1 [template = bool]
- // CHECK:STDOUT: br !if.expr.result.loc20(%.loc20_32.2)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.else.loc20:
- // CHECK:STDOUT: %.loc20_43: %empty_tuple.type = tuple_literal ()
- // CHECK:STDOUT: %.loc20_37: type = converted %.loc20_43, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
- // CHECK:STDOUT: br !if.expr.result.loc20(%.loc20_37)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.result.loc20:
- // CHECK:STDOUT: %.loc20_10: type = block_arg !if.expr.result.loc20 [template = bool]
- // CHECK:STDOUT: br !.loc20_7
- // CHECK:STDOUT:
- // CHECK:STDOUT: !.loc20_7:
- // CHECK:STDOUT: %b: ref bool = bind_name b, %b.var
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %c.patt: bool = binding_pattern c
- // CHECK:STDOUT: %.loc21_3: bool = var_pattern %c.patt
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %c.var: ref bool = var c
- // CHECK:STDOUT: %true.loc21_47: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: assign %c.var, %true.loc21_47
- // CHECK:STDOUT: br !.loc21_13
- // CHECK:STDOUT:
- // CHECK:STDOUT: !.loc21_13:
- // CHECK:STDOUT: %false.loc21: bool = bool_literal false [template = constants.%false]
- // CHECK:STDOUT: %.loc21_19.1: bool = not %false.loc21 [template = constants.%true]
- // CHECK:STDOUT: %true.loc21_19: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: if %.loc21_19.1 br !or.rhs.loc21 else br !or.result.loc21(%true.loc21_19)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !or.rhs.loc21:
- // CHECK:STDOUT: %true.loc21_22: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: br !or.result.loc21(%true.loc21_22)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !or.result.loc21:
- // CHECK:STDOUT: %.loc21_19.2: bool = block_arg !or.result.loc21 [template = constants.%true]
- // CHECK:STDOUT: if %.loc21_19.2 br !if.expr.then.loc21 else br !if.expr.else.loc21
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.then.loc21:
- // CHECK:STDOUT: %bool.make_type.loc21: init type = call constants.%Bool() [template = bool]
- // CHECK:STDOUT: %.loc21_32.1: type = value_of_initializer %bool.make_type.loc21 [template = bool]
- // CHECK:STDOUT: %.loc21_32.2: type = converted %bool.make_type.loc21, %.loc21_32.1 [template = bool]
- // CHECK:STDOUT: br !if.expr.result.loc21(%.loc21_32.2)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.else.loc21:
- // CHECK:STDOUT: %.loc21_43: %empty_tuple.type = tuple_literal ()
- // CHECK:STDOUT: %.loc21_37: type = converted %.loc21_43, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
- // CHECK:STDOUT: br !if.expr.result.loc21(%.loc21_37)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.result.loc21:
- // CHECK:STDOUT: %.loc21_10: type = block_arg !if.expr.result.loc21 [template = bool]
- // CHECK:STDOUT: br !.loc21_7
- // CHECK:STDOUT:
- // CHECK:STDOUT: !.loc21_7:
- // CHECK:STDOUT: %c: ref bool = bind_name c, %c.var
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %d.patt: %empty_tuple.type = binding_pattern d
- // CHECK:STDOUT: %.loc22_3.1: %empty_tuple.type = var_pattern %d.patt
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %d.var: ref %empty_tuple.type = var d
- // CHECK:STDOUT: %.loc22_49.1: %empty_tuple.type = tuple_literal ()
- // CHECK:STDOUT: %.loc22_49.2: init %empty_tuple.type = tuple_init () to %d.var [template = constants.%empty_tuple]
- // CHECK:STDOUT: %.loc22_3.2: init %empty_tuple.type = converted %.loc22_49.1, %.loc22_49.2 [template = constants.%empty_tuple]
- // CHECK:STDOUT: assign %d.var, %.loc22_3.2
- // CHECK:STDOUT: br !.loc22_13
- // CHECK:STDOUT:
- // CHECK:STDOUT: !.loc22_13:
- // CHECK:STDOUT: %false.loc22_13: bool = bool_literal false [template = constants.%false]
- // CHECK:STDOUT: %.loc22_19.1: bool = not %false.loc22_13 [template = constants.%true]
- // CHECK:STDOUT: %true.loc22: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: if %.loc22_19.1 br !or.rhs.loc22 else br !or.result.loc22(%true.loc22)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !or.rhs.loc22:
- // CHECK:STDOUT: %false.loc22_22: bool = bool_literal false [template = constants.%false]
- // CHECK:STDOUT: br !or.result.loc22(%false.loc22_22)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !or.result.loc22:
- // CHECK:STDOUT: %.loc22_19.2: bool = block_arg !or.result.loc22 [template = constants.%false]
- // CHECK:STDOUT: if %.loc22_19.2 br !if.expr.then.loc22 else br !if.expr.else.loc22
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.then.loc22:
- // CHECK:STDOUT: %bool.make_type.loc22: init type = call constants.%Bool() [template = bool]
- // CHECK:STDOUT: %.loc22_33.1: type = value_of_initializer %bool.make_type.loc22 [template = bool]
- // CHECK:STDOUT: %.loc22_33.2: type = converted %bool.make_type.loc22, %.loc22_33.1 [template = bool]
- // CHECK:STDOUT: br !if.expr.result.loc22(%.loc22_33.2)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.else.loc22:
- // CHECK:STDOUT: %.loc22_44: %empty_tuple.type = tuple_literal ()
- // CHECK:STDOUT: %.loc22_38: type = converted %.loc22_44, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
- // CHECK:STDOUT: br !if.expr.result.loc22(%.loc22_38)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.result.loc22:
- // CHECK:STDOUT: %.loc22_10: type = block_arg !if.expr.result.loc22 [template = constants.%empty_tuple.type]
- // CHECK:STDOUT: br !.loc22_7
- // CHECK:STDOUT:
- // CHECK:STDOUT: !.loc22_7:
- // CHECK:STDOUT: %d: ref %empty_tuple.type = bind_name d, %d.var
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @PartialConstant(%x.param_patt: bool) {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: name_binding_decl {
- // CHECK:STDOUT: %a.patt: bool = binding_pattern a
- // CHECK:STDOUT: %.loc26_3: bool = var_pattern %a.patt
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %a.var: ref bool = var a
- // CHECK:STDOUT: %true.loc26_43: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: assign %a.var, %true.loc26_43
- // CHECK:STDOUT: br !.loc26_13
- // CHECK:STDOUT:
- // CHECK:STDOUT: !.loc26_13:
- // CHECK:STDOUT: %true.loc26_13: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: %.loc26_18.1: bool = not %true.loc26_13 [template = constants.%false]
- // CHECK:STDOUT: %true.loc26_18: bool = bool_literal true [template = constants.%true]
- // CHECK:STDOUT: if %.loc26_18.1 br !or.rhs else br !or.result(%true.loc26_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: %.loc26_18.2: bool = block_arg !or.result [template = constants.%true]
- // CHECK:STDOUT: if %.loc26_18.2 br !if.expr.then else br !if.expr.else
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.then:
- // CHECK:STDOUT: %bool.make_type.loc26: init type = call constants.%Bool() [template = bool]
- // CHECK:STDOUT: %.loc26_28.1: type = value_of_initializer %bool.make_type.loc26 [template = bool]
- // CHECK:STDOUT: %.loc26_28.2: type = converted %bool.make_type.loc26, %.loc26_28.1 [template = bool]
- // CHECK:STDOUT: br !if.expr.result(%.loc26_28.2)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.else:
- // CHECK:STDOUT: %.loc26_39: %empty_tuple.type = tuple_literal ()
- // CHECK:STDOUT: %.loc26_33: type = converted %.loc26_39, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
- // CHECK:STDOUT: br !if.expr.result(%.loc26_33)
- // CHECK:STDOUT:
- // CHECK:STDOUT: !if.expr.result:
- // CHECK:STDOUT: %.loc26_10: type = block_arg !if.expr.result [template = bool]
- // CHECK:STDOUT: br !.loc26_7
- // CHECK:STDOUT:
- // CHECK:STDOUT: !.loc26_7:
- // CHECK:STDOUT: %a: ref bool = bind_name a, %a.var
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|