From d41668350b1315f7680aaa3ced081b5aeb9f54a6 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 30 Dec 2024 16:35:39 -0800 Subject: [PATCH] Suppress testing SemIR in int builtin tests. (#4748) Add `EXTRA-ARGS:` support to file_test, to add arguments without overriding the default arguments. Use `EXTRA-ARGS: --no-dump-sem-ir` to turn off SemIR dumping and thus SemIR testing in the int builtin tests, which validate correct behavior through diagnostics instead. This doesn't get us any closer to supporting more targeted SemIR dumping / testing, but this seems to be a generally useful feature anyway. Most existing tests using `ARGS` have been switched over to using `EXTRA-ARGS`. Requested in review of #4716. --- testing/file_test/README.md | 10 + testing/file_test/file_test_base.cpp | 23 +- testing/file_test/file_test_base.h | 4 + .../basics/no_prelude/raw_identifier.carbon | 34 +- .../check/testdata/builtins/float/add.carbon | 156 +- .../check/testdata/builtins/float/div.carbon | 156 +- .../check/testdata/builtins/float/eq.carbon | 36 +- .../testdata/builtins/float/greater.carbon | 36 +- .../testdata/builtins/float/greater_eq.carbon | 36 +- .../check/testdata/builtins/float/less.carbon | 36 +- .../testdata/builtins/float/less_eq.carbon | 36 +- .../check/testdata/builtins/float/mul.carbon | 156 +- .../testdata/builtins/float/negate.carbon | 156 +- .../check/testdata/builtins/float/neq.carbon | 36 +- .../check/testdata/builtins/float/sub.carbon | 156 +- .../check/testdata/builtins/int/and.carbon | 112 +- .../testdata/builtins/int/complement.carbon | 125 +- .../builtins/int/convert_checked.carbon | 2723 +---------------- .../check/testdata/builtins/int/eq.carbon | 275 +- .../testdata/builtins/int/greater.carbon | 351 +-- .../testdata/builtins/int/greater_eq.carbon | 351 +-- .../testdata/builtins/int/left_shift.carbon | 385 +-- .../check/testdata/builtins/int/less.carbon | 351 +-- .../testdata/builtins/int/less_eq.carbon | 351 +-- .../builtins/int/make_type_signed.carbon | 528 +--- .../builtins/int/make_type_unsigned.carbon | 336 +- .../check/testdata/builtins/int/neq.carbon | 223 +- .../check/testdata/builtins/int/or.carbon | 112 +- .../testdata/builtins/int/right_shift.carbon | 397 +-- .../check/testdata/builtins/int/sadd.carbon | 510 +-- .../check/testdata/builtins/int/sdiv.carbon | 449 +-- .../check/testdata/builtins/int/smod.carbon | 450 +-- .../check/testdata/builtins/int/smul.carbon | 228 +- .../testdata/builtins/int/snegate.carbon | 506 +-- .../check/testdata/builtins/int/ssub.carbon | 274 +- .../check/testdata/builtins/int/uadd.carbon | 510 +-- .../check/testdata/builtins/int/udiv.carbon | 450 +-- .../check/testdata/builtins/int/umod.carbon | 450 +-- .../check/testdata/builtins/int/umul.carbon | 228 +- .../testdata/builtins/int/unegate.carbon | 694 +---- .../check/testdata/builtins/int/usub.carbon | 274 +- .../check/testdata/builtins/int/xor.carbon | 112 +- .../builtins/int_literal/make_type.carbon | 63 +- .../testdata/function/builtin/call.carbon | 43 + .../multifile_raw_and_textual_ir.carbon | 4 +- .../testdata/compile}/multifile_raw_ir.carbon | 4 +- .../compile}/raw_and_textual_ir.carbon | 4 +- .../testdata/compile}/raw_ir.carbon | 4 +- .../testdata/compile}/textual_ir.carbon | 4 +- toolchain/lex/testdata/basic_syntax.carbon | 2 +- 50 files changed, 689 insertions(+), 12261 deletions(-) rename toolchain/{check/testdata/basics/no_prelude => driver/testdata/compile}/multifile_raw_and_textual_ir.carbon (98%) rename toolchain/{check/testdata/basics/no_prelude => driver/testdata/compile}/multifile_raw_ir.carbon (98%) rename toolchain/{check/testdata/basics/no_prelude => driver/testdata/compile}/raw_and_textual_ir.carbon (98%) rename toolchain/{check/testdata/basics/no_prelude => driver/testdata/compile}/raw_ir.carbon (99%) rename toolchain/{check/testdata/basics/no_prelude => driver/testdata/compile}/textual_ir.carbon (96%) diff --git a/testing/file_test/README.md b/testing/file_test/README.md index 497c9389b526c..fe9219c7fae47 100644 --- a/testing/file_test/README.md +++ b/testing/file_test/README.md @@ -152,6 +152,16 @@ Supported comment markers are: ARGS can be specified at most once. If not provided, the FileTestBase child is responsible for providing default arguments. +- ``` + // EXTRA-ARGS: + ``` + + Same as `ARGS`, including substitution behavior, but appends to the default + argument list instead of replacing it. + + `EXTRA-ARGS` can be specified at most once, and a test cannot specify both + `ARGS` and `EXTRA-ARGS`. + - ``` // SET-CAPTURE-CONSOLE-OUTPUT ``` diff --git a/testing/file_test/file_test_base.cpp b/testing/file_test/file_test_base.cpp index ef34bd1c7cbe2..d5886ef6a76cd 100644 --- a/testing/file_test/file_test_base.cpp +++ b/testing/file_test/file_test_base.cpp @@ -292,6 +292,7 @@ auto FileTestBase::ProcessTestFileAndRun(TestContext& context) // Process arguments. if (context.test_args.empty()) { context.test_args = GetDefaultArgs(); + context.test_args.append(context.extra_args); } CARBON_RETURN_IF_ERROR( DoArgReplacements(context.test_args, context.test_files)); @@ -767,16 +768,23 @@ static auto TryConsumeCheck( return true; } -// Processes ARGS lines when found. Returns true if the line is consumed. +// Processes ARGS and EXTRA-ARGS lines when found. Returns true if the line is +// consumed. static auto TryConsumeArgs(llvm::StringRef line, llvm::StringRef line_trimmed, - llvm::SmallVector* args) + llvm::SmallVector* args, + llvm::SmallVector* extra_args) -> ErrorOr { - if (!line_trimmed.consume_front("// ARGS: ")) { + llvm::SmallVector* arg_list = nullptr; + if (line_trimmed.consume_front("// ARGS: ")) { + arg_list = args; + } else if (line_trimmed.consume_front("// EXTRA-ARGS: ")) { + arg_list = extra_args; + } else { return false; } - if (!args->empty()) { - return ErrorBuilder() << "ARGS was specified multiple times: " + if (!args->empty() || !extra_args->empty()) { + return ErrorBuilder() << "ARGS / EXTRA-ARGS specified multiple times: " << line.str(); } @@ -784,7 +792,7 @@ static auto TryConsumeArgs(llvm::StringRef line, llvm::StringRef line_trimmed, std::pair cursor = llvm::getToken(line_trimmed); while (!cursor.first.empty()) { - args->push_back(std::string(cursor.first)); + arg_list->push_back(std::string(cursor.first)); cursor = llvm::getToken(cursor.second); } @@ -884,7 +892,8 @@ auto FileTestBase::ProcessTestFile(TestContext& context) -> ErrorOr { FileTestLine(split.file_index, line_index, line)); CARBON_ASSIGN_OR_RETURN( - is_consumed, TryConsumeArgs(line, line_trimmed, &context.test_args)); + is_consumed, TryConsumeArgs(line, line_trimmed, &context.test_args, + &context.extra_args)); if (is_consumed) { continue; } diff --git a/testing/file_test/file_test_base.h b/testing/file_test/file_test_base.h index f13e0444f2223..2419bd70c4f44 100644 --- a/testing/file_test/file_test_base.h +++ b/testing/file_test/file_test_base.h @@ -145,6 +145,10 @@ class FileTestBase : public testing::Test { // Arguments for the test, generated from ARGS. llvm::SmallVector test_args; + // Extra arguments for the test, generated from EXTRA-ARGS. Unlike ARGS, + // setting EXTRA-ARGS does not suppress the default arguments. + llvm::SmallVector extra_args; + // Files in the test, generated by content and splits. llvm::SmallVector test_files; diff --git a/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon b/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon index a4b6bfabd3e22..42a0129abcdb9 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon +++ b/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon @@ -2,10 +2,6 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// ARGS: compile --no-prelude-import --phase=check --dump-sem-ir %s -// -// Check that the command-line flag to dump textual IR works. -// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon @@ -48,12 +44,12 @@ fn C(r#if: ()) -> () { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc15_17.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_17.2: type = converted %.loc15_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc11_17.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc11_17.2: type = converted %.loc11_17.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %n.param: %empty_tuple.type = value_param runtime_param0 -// CHECK:STDOUT: %.loc15_10.1: type = splice_block %.loc15_10.3 [template = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc15_10.2: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc15_10.3: type = converted %.loc15_10.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc11_10.1: type = splice_block %.loc11_10.3 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc11_10.2: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc11_10.3: type = converted %.loc11_10.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %n: %empty_tuple.type = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param1 @@ -65,12 +61,12 @@ fn C(r#if: ()) -> () { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc19_19.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc19_19.2: type = converted %.loc19_19.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc15_19.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc15_19.2: type = converted %.loc15_19.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %n.param: %empty_tuple.type = value_param runtime_param0 -// CHECK:STDOUT: %.loc19_12.1: type = splice_block %.loc19_12.3 [template = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc19_12.2: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc19_12.3: type = converted %.loc19_12.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc15_12.1: type = splice_block %.loc15_12.3 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc15_12.2: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc15_12.3: type = converted %.loc15_12.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %n: %empty_tuple.type = bind_name n, %n.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param1 @@ -82,12 +78,12 @@ fn C(r#if: ()) -> () { // CHECK:STDOUT: %return.patt: %empty_tuple.type = return_slot_pattern // CHECK:STDOUT: %return.param_patt: %empty_tuple.type = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc23_20.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc23_20.2: type = converted %.loc23_20.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc19_20.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc19_20.2: type = converted %.loc19_20.1, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: %if.param: %empty_tuple.type = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_13.1: type = splice_block %.loc23_13.3 [template = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc23_13.2: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc23_13.3: type = converted %.loc23_13.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc19_13.1: type = splice_block %.loc19_13.3 [template = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc19_13.2: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc19_13.3: type = converted %.loc19_13.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type] // CHECK:STDOUT: } // CHECK:STDOUT: %if: %empty_tuple.type = bind_name r#if, %if.param // CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param runtime_param1 diff --git a/toolchain/check/testdata/builtins/float/add.carbon b/toolchain/check/testdata/builtins/float/add.carbon index 794e1fd90c17b..ad666ec1684a7 100644 --- a/toolchain/check/testdata/builtins/float/add.carbon +++ b/toolchain/check/testdata/builtins/float/add.carbon @@ -12,7 +12,7 @@ fn Add(a: f64, b: f64) -> f64 = "float.add"; -fn RuntimeCall(a: f64, b: f64) -> f64 { +fn RuntimeCallIsValid(a: f64, b: f64) -> f64 { return Add(a, b); } @@ -38,15 +38,15 @@ fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.add"; fn BadReturnType(a: f64, b: f64) -> bool = "float.add"; fn JustRight(a: f64, b: f64) -> f64 = "float.add"; -fn RuntimeCallTooFew(a: f64) -> f64 { +fn RuntimeCallIsValidTooFew(a: f64) -> f64 { return TooFew(a); } -fn RuntimeCallTooMany(a: f64, b: f64, c: f64) -> f64 { +fn RuntimeCallIsValidTooMany(a: f64, b: f64, c: f64) -> f64 { return TooMany(a, b, c); } -fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { +fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { return BadReturnType(a, b); } @@ -58,8 +58,8 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %Add.type: type = fn_type @Add [template] // CHECK:STDOUT: %Add: %Add.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [template] +// CHECK:STDOUT: %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [template] // CHECK:STDOUT: %float.1: f64 = float_literal 2.2000000000000002 [template] // CHECK:STDOUT: %float.2: f64 = float_literal 2.3000000000000003 [template] // CHECK:STDOUT: %float.3: f64 = float_literal 4.5 [template] @@ -77,7 +77,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .RuntimeCallIsValid = %RuntimeCallIsValid.decl // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core @@ -112,7 +112,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [template = constants.%RuntimeCallIsValid] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -120,24 +120,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc4_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%int_64.loc4_35) [template = f64] -// CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %float.make_type.loc4_35 [template = f64] -// CHECK:STDOUT: %.loc4_35.2: type = converted %float.make_type.loc4_35, %.loc4_35.1 [template = f64] +// CHECK:STDOUT: %int_64.loc4_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_42: init type = call constants.%Float(%int_64.loc4_42) [template = f64] +// CHECK:STDOUT: %.loc4_42.1: type = value_of_initializer %float.make_type.loc4_42 [template = f64] +// CHECK:STDOUT: %.loc4_42.2: type = converted %float.make_type.loc4_42, %.loc4_42.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_19.1: type = splice_block %.loc4_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] -// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %float.make_type.loc4_19 [template = f64] -// CHECK:STDOUT: %.loc4_19.3: type = converted %float.make_type.loc4_19, %.loc4_19.2 [template = f64] +// CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_26: init type = call constants.%Float(%int_64.loc4_26) [template = f64] +// CHECK:STDOUT: %.loc4_26.2: type = value_of_initializer %float.make_type.loc4_26 [template = f64] +// CHECK:STDOUT: %.loc4_26.3: type = converted %float.make_type.loc4_26, %.loc4_26.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_27.1: type = splice_block %.loc4_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] -// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %float.make_type.loc4_27 [template = f64] -// CHECK:STDOUT: %.loc4_27.3: type = converted %float.make_type.loc4_27, %.loc4_27.2 [template = f64] +// CHECK:STDOUT: %.loc4_34.1: type = splice_block %.loc4_34.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_34: init type = call constants.%Float(%int_64.loc4_34) [template = f64] +// CHECK:STDOUT: %.loc4_34.2: type = value_of_initializer %float.make_type.loc4_34 [template = f64] +// CHECK:STDOUT: %.loc4_34.3: type = converted %float.make_type.loc4_34, %.loc4_34.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 @@ -149,7 +149,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Add(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.add"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param_patt: f64, %b.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Add.ref: %Add.type = name_ref Add, file.%Add.decl [template = constants.%Add] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -186,12 +186,12 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] -// CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] -// CHECK:STDOUT: %RuntimeCallTooMany: %RuntimeCallTooMany.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType.type: type = fn_type @RuntimeCallBadReturnType [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooFew.type: type = fn_type @RuntimeCallIsValidTooFew [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooFew: %RuntimeCallIsValidTooFew.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooMany.type: type = fn_type @RuntimeCallIsValidTooMany [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooMany: %RuntimeCallIsValidTooMany.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType.type: type = fn_type @RuntimeCallIsValidBadReturnType [template] +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType: %RuntimeCallIsValidBadReturnType.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -210,9 +210,9 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl // CHECK:STDOUT: .JustRight = %JustRight.decl -// CHECK:STDOUT: .RuntimeCallTooFew = %RuntimeCallTooFew.decl -// CHECK:STDOUT: .RuntimeCallTooMany = %RuntimeCallTooMany.decl -// CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl +// CHECK:STDOUT: .RuntimeCallIsValidTooFew = %RuntimeCallIsValidTooFew.decl +// CHECK:STDOUT: .RuntimeCallIsValidTooMany = %RuntimeCallIsValidTooMany.decl +// CHECK:STDOUT: .RuntimeCallIsValidBadReturnType = %RuntimeCallIsValidBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { @@ -338,28 +338,28 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { +// CHECK:STDOUT: %RuntimeCallIsValidTooFew.decl: %RuntimeCallIsValidTooFew.type = fn_decl @RuntimeCallIsValidTooFew [template = constants.%RuntimeCallIsValidTooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%int_64.loc20_33) [template = f64] -// CHECK:STDOUT: %.loc20_33.1: type = value_of_initializer %float.make_type.loc20_33 [template = f64] -// CHECK:STDOUT: %.loc20_33.2: type = converted %float.make_type.loc20_33, %.loc20_33.1 [template = f64] +// CHECK:STDOUT: %int_64.loc20_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_40: init type = call constants.%Float(%int_64.loc20_40) [template = f64] +// CHECK:STDOUT: %.loc20_40.1: type = value_of_initializer %float.make_type.loc20_40 [template = f64] +// CHECK:STDOUT: %.loc20_40.2: type = converted %float.make_type.loc20_40, %.loc20_40.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc20_25.1: type = splice_block %.loc20_25.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] -// CHECK:STDOUT: %.loc20_25.2: type = value_of_initializer %float.make_type.loc20_25 [template = f64] -// CHECK:STDOUT: %.loc20_25.3: type = converted %float.make_type.loc20_25, %.loc20_25.2 [template = f64] +// CHECK:STDOUT: %.loc20_32.1: type = splice_block %.loc20_32.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc20_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_32: init type = call constants.%Float(%int_64.loc20_32) [template = f64] +// CHECK:STDOUT: %.loc20_32.2: type = value_of_initializer %float.make_type.loc20_32 [template = f64] +// CHECK:STDOUT: %.loc20_32.3: type = converted %float.make_type.loc20_32, %.loc20_32.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %RuntimeCallIsValidTooMany.decl: %RuntimeCallIsValidTooMany.type = fn_decl @RuntimeCallIsValidTooMany [template = constants.%RuntimeCallIsValidTooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -369,38 +369,38 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_50: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%int_64.loc24_50) [template = f64] -// CHECK:STDOUT: %.loc24_50.1: type = value_of_initializer %float.make_type.loc24_50 [template = f64] -// CHECK:STDOUT: %.loc24_50.2: type = converted %float.make_type.loc24_50, %.loc24_50.1 [template = f64] +// CHECK:STDOUT: %int_64.loc24_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_57: init type = call constants.%Float(%int_64.loc24_57) [template = f64] +// CHECK:STDOUT: %.loc24_57.1: type = value_of_initializer %float.make_type.loc24_57 [template = f64] +// CHECK:STDOUT: %.loc24_57.2: type = converted %float.make_type.loc24_57, %.loc24_57.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc24_26.1: type = splice_block %.loc24_26.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] -// CHECK:STDOUT: %.loc24_26.2: type = value_of_initializer %float.make_type.loc24_26 [template = f64] -// CHECK:STDOUT: %.loc24_26.3: type = converted %float.make_type.loc24_26, %.loc24_26.2 [template = f64] +// CHECK:STDOUT: %.loc24_33.1: type = splice_block %.loc24_33.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_33: init type = call constants.%Float(%int_64.loc24_33) [template = f64] +// CHECK:STDOUT: %.loc24_33.2: type = value_of_initializer %float.make_type.loc24_33 [template = f64] +// CHECK:STDOUT: %.loc24_33.3: type = converted %float.make_type.loc24_33, %.loc24_33.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc24_34.1: type = splice_block %.loc24_34.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] -// CHECK:STDOUT: %.loc24_34.2: type = value_of_initializer %float.make_type.loc24_34 [template = f64] -// CHECK:STDOUT: %.loc24_34.3: type = converted %float.make_type.loc24_34, %.loc24_34.2 [template = f64] +// CHECK:STDOUT: %.loc24_41.1: type = splice_block %.loc24_41.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_41: init type = call constants.%Float(%int_64.loc24_41) [template = f64] +// CHECK:STDOUT: %.loc24_41.2: type = value_of_initializer %float.make_type.loc24_41 [template = f64] +// CHECK:STDOUT: %.loc24_41.3: type = converted %float.make_type.loc24_41, %.loc24_41.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 -// CHECK:STDOUT: %.loc24_42.1: type = splice_block %.loc24_42.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] -// CHECK:STDOUT: %.loc24_42.2: type = value_of_initializer %float.make_type.loc24_42 [template = f64] -// CHECK:STDOUT: %.loc24_42.3: type = converted %float.make_type.loc24_42, %.loc24_42.2 [template = f64] +// CHECK:STDOUT: %.loc24_49.1: type = splice_block %.loc24_49.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_49: init type = call constants.%Float(%int_64.loc24_49) [template = f64] +// CHECK:STDOUT: %.loc24_49.2: type = value_of_initializer %float.make_type.loc24_49 [template = f64] +// CHECK:STDOUT: %.loc24_49.3: type = converted %float.make_type.loc24_49, %.loc24_49.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType.decl: %RuntimeCallIsValidBadReturnType.type = fn_decl @RuntimeCallIsValidBadReturnType [template = constants.%RuntimeCallIsValidBadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -409,22 +409,22 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] +// CHECK:STDOUT: %.loc28_55.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc28_55.2: type = converted %bool.make_type, %.loc28_55.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc28_32.1: type = splice_block %.loc28_32.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] -// CHECK:STDOUT: %.loc28_32.2: type = value_of_initializer %float.make_type.loc28_32 [template = f64] -// CHECK:STDOUT: %.loc28_32.3: type = converted %float.make_type.loc28_32, %.loc28_32.2 [template = f64] +// CHECK:STDOUT: %.loc28_39.1: type = splice_block %.loc28_39.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_39: init type = call constants.%Float(%int_64.loc28_39) [template = f64] +// CHECK:STDOUT: %.loc28_39.2: type = value_of_initializer %float.make_type.loc28_39 [template = f64] +// CHECK:STDOUT: %.loc28_39.3: type = converted %float.make_type.loc28_39, %.loc28_39.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc28_40.1: type = splice_block %.loc28_40.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] -// CHECK:STDOUT: %.loc28_40.2: type = value_of_initializer %float.make_type.loc28_40 [template = f64] -// CHECK:STDOUT: %.loc28_40.3: type = converted %float.make_type.loc28_40, %.loc28_40.2 [template = f64] +// CHECK:STDOUT: %.loc28_47.1: type = splice_block %.loc28_47.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_47: init type = call constants.%Float(%int_64.loc28_47) [template = f64] +// CHECK:STDOUT: %.loc28_47.2: type = value_of_initializer %float.make_type.loc28_47 [template = f64] +// CHECK:STDOUT: %.loc28_47.3: type = converted %float.make_type.loc28_47, %.loc28_47.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -440,7 +440,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @JustRight(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.add"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValidTooFew(%a.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -450,7 +450,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc21_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -462,7 +462,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc25_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/div.carbon b/toolchain/check/testdata/builtins/float/div.carbon index b0689dad6808d..791c9a610dd16 100644 --- a/toolchain/check/testdata/builtins/float/div.carbon +++ b/toolchain/check/testdata/builtins/float/div.carbon @@ -12,7 +12,7 @@ fn Div(a: f64, b: f64) -> f64 = "float.div"; -fn RuntimeCall(a: f64, b: f64) -> f64 { +fn RuntimeCallIsValid(a: f64, b: f64) -> f64 { return Div(a, b); } @@ -40,15 +40,15 @@ fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.div"; fn BadReturnType(a: f64, b: f64) -> bool = "float.div"; fn JustRight(a: f64, b: f64) -> f64 = "float.div"; -fn RuntimeCallTooFew(a: f64) -> f64 { +fn RuntimeCallIsValidTooFew(a: f64) -> f64 { return TooFew(a); } -fn RuntimeCallTooMany(a: f64, b: f64, c: f64) -> f64 { +fn RuntimeCallIsValidTooMany(a: f64, b: f64, c: f64) -> f64 { return TooMany(a, b, c); } -fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { +fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { return BadReturnType(a, b); } @@ -60,8 +60,8 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %Div.type: type = fn_type @Div [template] // CHECK:STDOUT: %Div: %Div.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [template] +// CHECK:STDOUT: %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [template] // CHECK:STDOUT: %float.1: f64 = float_literal 10 [template] // CHECK:STDOUT: %float.2: f64 = float_literal 2.5 [template] // CHECK:STDOUT: %float.3: f64 = float_literal 4 [template] @@ -83,7 +83,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .RuntimeCallIsValid = %RuntimeCallIsValid.decl // CHECK:STDOUT: .a = %a // CHECK:STDOUT: .b = @__global_init.%b // CHECK:STDOUT: .c = @__global_init.%c @@ -120,7 +120,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [template = constants.%RuntimeCallIsValid] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -128,24 +128,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc4_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%int_64.loc4_35) [template = f64] -// CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %float.make_type.loc4_35 [template = f64] -// CHECK:STDOUT: %.loc4_35.2: type = converted %float.make_type.loc4_35, %.loc4_35.1 [template = f64] +// CHECK:STDOUT: %int_64.loc4_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_42: init type = call constants.%Float(%int_64.loc4_42) [template = f64] +// CHECK:STDOUT: %.loc4_42.1: type = value_of_initializer %float.make_type.loc4_42 [template = f64] +// CHECK:STDOUT: %.loc4_42.2: type = converted %float.make_type.loc4_42, %.loc4_42.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_19.1: type = splice_block %.loc4_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] -// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %float.make_type.loc4_19 [template = f64] -// CHECK:STDOUT: %.loc4_19.3: type = converted %float.make_type.loc4_19, %.loc4_19.2 [template = f64] +// CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_26: init type = call constants.%Float(%int_64.loc4_26) [template = f64] +// CHECK:STDOUT: %.loc4_26.2: type = value_of_initializer %float.make_type.loc4_26 [template = f64] +// CHECK:STDOUT: %.loc4_26.3: type = converted %float.make_type.loc4_26, %.loc4_26.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_27.1: type = splice_block %.loc4_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] -// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %float.make_type.loc4_27 [template = f64] -// CHECK:STDOUT: %.loc4_27.3: type = converted %float.make_type.loc4_27, %.loc4_27.2 [template = f64] +// CHECK:STDOUT: %.loc4_34.1: type = splice_block %.loc4_34.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_34: init type = call constants.%Float(%int_64.loc4_34) [template = f64] +// CHECK:STDOUT: %.loc4_34.2: type = value_of_initializer %float.make_type.loc4_34 [template = f64] +// CHECK:STDOUT: %.loc4_34.3: type = converted %float.make_type.loc4_34, %.loc4_34.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 @@ -157,7 +157,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Div(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.div"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param_patt: f64, %b.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Div.ref: %Div.type = name_ref Div, file.%Div.decl [template = constants.%Div] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -208,12 +208,12 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] -// CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] -// CHECK:STDOUT: %RuntimeCallTooMany: %RuntimeCallTooMany.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType.type: type = fn_type @RuntimeCallBadReturnType [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooFew.type: type = fn_type @RuntimeCallIsValidTooFew [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooFew: %RuntimeCallIsValidTooFew.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooMany.type: type = fn_type @RuntimeCallIsValidTooMany [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooMany: %RuntimeCallIsValidTooMany.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType.type: type = fn_type @RuntimeCallIsValidBadReturnType [template] +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType: %RuntimeCallIsValidBadReturnType.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -232,9 +232,9 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl // CHECK:STDOUT: .JustRight = %JustRight.decl -// CHECK:STDOUT: .RuntimeCallTooFew = %RuntimeCallTooFew.decl -// CHECK:STDOUT: .RuntimeCallTooMany = %RuntimeCallTooMany.decl -// CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl +// CHECK:STDOUT: .RuntimeCallIsValidTooFew = %RuntimeCallIsValidTooFew.decl +// CHECK:STDOUT: .RuntimeCallIsValidTooMany = %RuntimeCallIsValidTooMany.decl +// CHECK:STDOUT: .RuntimeCallIsValidBadReturnType = %RuntimeCallIsValidBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { @@ -360,28 +360,28 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { +// CHECK:STDOUT: %RuntimeCallIsValidTooFew.decl: %RuntimeCallIsValidTooFew.type = fn_decl @RuntimeCallIsValidTooFew [template = constants.%RuntimeCallIsValidTooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%int_64.loc20_33) [template = f64] -// CHECK:STDOUT: %.loc20_33.1: type = value_of_initializer %float.make_type.loc20_33 [template = f64] -// CHECK:STDOUT: %.loc20_33.2: type = converted %float.make_type.loc20_33, %.loc20_33.1 [template = f64] +// CHECK:STDOUT: %int_64.loc20_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_40: init type = call constants.%Float(%int_64.loc20_40) [template = f64] +// CHECK:STDOUT: %.loc20_40.1: type = value_of_initializer %float.make_type.loc20_40 [template = f64] +// CHECK:STDOUT: %.loc20_40.2: type = converted %float.make_type.loc20_40, %.loc20_40.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc20_25.1: type = splice_block %.loc20_25.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] -// CHECK:STDOUT: %.loc20_25.2: type = value_of_initializer %float.make_type.loc20_25 [template = f64] -// CHECK:STDOUT: %.loc20_25.3: type = converted %float.make_type.loc20_25, %.loc20_25.2 [template = f64] +// CHECK:STDOUT: %.loc20_32.1: type = splice_block %.loc20_32.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc20_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_32: init type = call constants.%Float(%int_64.loc20_32) [template = f64] +// CHECK:STDOUT: %.loc20_32.2: type = value_of_initializer %float.make_type.loc20_32 [template = f64] +// CHECK:STDOUT: %.loc20_32.3: type = converted %float.make_type.loc20_32, %.loc20_32.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %RuntimeCallIsValidTooMany.decl: %RuntimeCallIsValidTooMany.type = fn_decl @RuntimeCallIsValidTooMany [template = constants.%RuntimeCallIsValidTooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -391,38 +391,38 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_50: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%int_64.loc24_50) [template = f64] -// CHECK:STDOUT: %.loc24_50.1: type = value_of_initializer %float.make_type.loc24_50 [template = f64] -// CHECK:STDOUT: %.loc24_50.2: type = converted %float.make_type.loc24_50, %.loc24_50.1 [template = f64] +// CHECK:STDOUT: %int_64.loc24_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_57: init type = call constants.%Float(%int_64.loc24_57) [template = f64] +// CHECK:STDOUT: %.loc24_57.1: type = value_of_initializer %float.make_type.loc24_57 [template = f64] +// CHECK:STDOUT: %.loc24_57.2: type = converted %float.make_type.loc24_57, %.loc24_57.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc24_26.1: type = splice_block %.loc24_26.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] -// CHECK:STDOUT: %.loc24_26.2: type = value_of_initializer %float.make_type.loc24_26 [template = f64] -// CHECK:STDOUT: %.loc24_26.3: type = converted %float.make_type.loc24_26, %.loc24_26.2 [template = f64] +// CHECK:STDOUT: %.loc24_33.1: type = splice_block %.loc24_33.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_33: init type = call constants.%Float(%int_64.loc24_33) [template = f64] +// CHECK:STDOUT: %.loc24_33.2: type = value_of_initializer %float.make_type.loc24_33 [template = f64] +// CHECK:STDOUT: %.loc24_33.3: type = converted %float.make_type.loc24_33, %.loc24_33.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc24_34.1: type = splice_block %.loc24_34.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] -// CHECK:STDOUT: %.loc24_34.2: type = value_of_initializer %float.make_type.loc24_34 [template = f64] -// CHECK:STDOUT: %.loc24_34.3: type = converted %float.make_type.loc24_34, %.loc24_34.2 [template = f64] +// CHECK:STDOUT: %.loc24_41.1: type = splice_block %.loc24_41.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_41: init type = call constants.%Float(%int_64.loc24_41) [template = f64] +// CHECK:STDOUT: %.loc24_41.2: type = value_of_initializer %float.make_type.loc24_41 [template = f64] +// CHECK:STDOUT: %.loc24_41.3: type = converted %float.make_type.loc24_41, %.loc24_41.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 -// CHECK:STDOUT: %.loc24_42.1: type = splice_block %.loc24_42.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] -// CHECK:STDOUT: %.loc24_42.2: type = value_of_initializer %float.make_type.loc24_42 [template = f64] -// CHECK:STDOUT: %.loc24_42.3: type = converted %float.make_type.loc24_42, %.loc24_42.2 [template = f64] +// CHECK:STDOUT: %.loc24_49.1: type = splice_block %.loc24_49.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_49: init type = call constants.%Float(%int_64.loc24_49) [template = f64] +// CHECK:STDOUT: %.loc24_49.2: type = value_of_initializer %float.make_type.loc24_49 [template = f64] +// CHECK:STDOUT: %.loc24_49.3: type = converted %float.make_type.loc24_49, %.loc24_49.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType.decl: %RuntimeCallIsValidBadReturnType.type = fn_decl @RuntimeCallIsValidBadReturnType [template = constants.%RuntimeCallIsValidBadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -431,22 +431,22 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] +// CHECK:STDOUT: %.loc28_55.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc28_55.2: type = converted %bool.make_type, %.loc28_55.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc28_32.1: type = splice_block %.loc28_32.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] -// CHECK:STDOUT: %.loc28_32.2: type = value_of_initializer %float.make_type.loc28_32 [template = f64] -// CHECK:STDOUT: %.loc28_32.3: type = converted %float.make_type.loc28_32, %.loc28_32.2 [template = f64] +// CHECK:STDOUT: %.loc28_39.1: type = splice_block %.loc28_39.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_39: init type = call constants.%Float(%int_64.loc28_39) [template = f64] +// CHECK:STDOUT: %.loc28_39.2: type = value_of_initializer %float.make_type.loc28_39 [template = f64] +// CHECK:STDOUT: %.loc28_39.3: type = converted %float.make_type.loc28_39, %.loc28_39.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc28_40.1: type = splice_block %.loc28_40.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] -// CHECK:STDOUT: %.loc28_40.2: type = value_of_initializer %float.make_type.loc28_40 [template = f64] -// CHECK:STDOUT: %.loc28_40.3: type = converted %float.make_type.loc28_40, %.loc28_40.2 [template = f64] +// CHECK:STDOUT: %.loc28_47.1: type = splice_block %.loc28_47.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_47: init type = call constants.%Float(%int_64.loc28_47) [template = f64] +// CHECK:STDOUT: %.loc28_47.2: type = value_of_initializer %float.make_type.loc28_47 [template = f64] +// CHECK:STDOUT: %.loc28_47.3: type = converted %float.make_type.loc28_47, %.loc28_47.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -462,7 +462,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @JustRight(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.div"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValidTooFew(%a.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -472,7 +472,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc21_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -484,7 +484,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc25_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/eq.carbon b/toolchain/check/testdata/builtins/float/eq.carbon index be58640e98c5c..bc8ab7a3a0b03 100644 --- a/toolchain/check/testdata/builtins/float/eq.carbon +++ b/toolchain/check/testdata/builtins/float/eq.carbon @@ -20,7 +20,7 @@ fn F(true_: True, false_: False) { false_ as (if Eq(1.0, 2.0) then True else False); } -fn RuntimeCall(a: f64, b: f64) -> bool { +fn RuntimeCallIsValid(a: f64, b: f64) -> bool { return Eq(a, b); } @@ -53,8 +53,8 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %float.2: f64 = float_literal 2 [template] // CHECK:STDOUT: %false: bool = bool_literal false [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [template] +// CHECK:STDOUT: %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,7 +73,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: .True = %True.decl // CHECK:STDOUT: .False = %False.decl // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .RuntimeCallIsValid = %RuntimeCallIsValid.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Eq.decl: %Eq.type = fn_decl @Eq [template = constants.%Eq] { @@ -121,7 +121,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [template = constants.%RuntimeCallIsValid] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -130,22 +130,22 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] +// CHECK:STDOUT: %.loc12_42.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc12_42.2: type = converted %bool.make_type, %.loc12_42.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc12_19.1: type = splice_block %.loc12_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc12_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc12_19: init type = call constants.%Float(%int_64.loc12_19) [template = f64] -// CHECK:STDOUT: %.loc12_19.2: type = value_of_initializer %float.make_type.loc12_19 [template = f64] -// CHECK:STDOUT: %.loc12_19.3: type = converted %float.make_type.loc12_19, %.loc12_19.2 [template = f64] +// CHECK:STDOUT: %.loc12_26.1: type = splice_block %.loc12_26.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc12_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc12_26: init type = call constants.%Float(%int_64.loc12_26) [template = f64] +// CHECK:STDOUT: %.loc12_26.2: type = value_of_initializer %float.make_type.loc12_26 [template = f64] +// CHECK:STDOUT: %.loc12_26.3: type = converted %float.make_type.loc12_26, %.loc12_26.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc12_27.1: type = splice_block %.loc12_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc12_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc12_27: init type = call constants.%Float(%int_64.loc12_27) [template = f64] -// CHECK:STDOUT: %.loc12_27.2: type = value_of_initializer %float.make_type.loc12_27 [template = f64] -// CHECK:STDOUT: %.loc12_27.3: type = converted %float.make_type.loc12_27, %.loc12_27.2 [template = f64] +// CHECK:STDOUT: %.loc12_34.1: type = splice_block %.loc12_34.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc12_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc12_34: init type = call constants.%Float(%int_64.loc12_34) [template = f64] +// CHECK:STDOUT: %.loc12_34.2: type = value_of_initializer %float.make_type.loc12_34 [template = f64] +// CHECK:STDOUT: %.loc12_34.3: type = converted %float.make_type.loc12_34, %.loc12_34.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -214,7 +214,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq"; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Eq.ref: %Eq.type = name_ref Eq, file.%Eq.decl [template = constants.%Eq] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/greater.carbon b/toolchain/check/testdata/builtins/float/greater.carbon index 320082ce15665..c1eb849504c6c 100644 --- a/toolchain/check/testdata/builtins/float/greater.carbon +++ b/toolchain/check/testdata/builtins/float/greater.carbon @@ -24,7 +24,7 @@ fn F(true_: True, false_: False) { true_ as (if Greater(0.0, Negate(1.0)) then True else False); } -fn RuntimeCall(a: f64, b: f64) -> bool { +fn RuntimeCallIsValid(a: f64, b: f64) -> bool { return Greater(a, b); } @@ -52,8 +52,8 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %float.3: f64 = float_literal 0 [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %float.4: f64 = float_literal -1 [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [template] +// CHECK:STDOUT: %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,7 +73,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: .True = %True.decl // CHECK:STDOUT: .False = %False.decl // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .RuntimeCallIsValid = %RuntimeCallIsValid.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Greater.decl: %Greater.type = fn_decl @Greater [template = constants.%Greater] { @@ -142,7 +142,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [template = constants.%RuntimeCallIsValid] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -151,22 +151,22 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] +// CHECK:STDOUT: %.loc16_42.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc16_42.2: type = converted %bool.make_type, %.loc16_42.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc16_19.1: type = splice_block %.loc16_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] -// CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %float.make_type.loc16_19 [template = f64] -// CHECK:STDOUT: %.loc16_19.3: type = converted %float.make_type.loc16_19, %.loc16_19.2 [template = f64] +// CHECK:STDOUT: %.loc16_26.1: type = splice_block %.loc16_26.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_26: init type = call constants.%Float(%int_64.loc16_26) [template = f64] +// CHECK:STDOUT: %.loc16_26.2: type = value_of_initializer %float.make_type.loc16_26 [template = f64] +// CHECK:STDOUT: %.loc16_26.3: type = converted %float.make_type.loc16_26, %.loc16_26.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc16_27.1: type = splice_block %.loc16_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] -// CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %float.make_type.loc16_27 [template = f64] -// CHECK:STDOUT: %.loc16_27.3: type = converted %float.make_type.loc16_27, %.loc16_27.2 [template = f64] +// CHECK:STDOUT: %.loc16_34.1: type = splice_block %.loc16_34.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_34: init type = call constants.%Float(%int_64.loc16_34) [template = f64] +// CHECK:STDOUT: %.loc16_34.2: type = value_of_initializer %float.make_type.loc16_34 [template = f64] +// CHECK:STDOUT: %.loc16_34.3: type = converted %float.make_type.loc16_34, %.loc16_34.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -302,7 +302,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Greater.ref: %Greater.type = name_ref Greater, file.%Greater.decl [template = constants.%Greater] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/greater_eq.carbon b/toolchain/check/testdata/builtins/float/greater_eq.carbon index 9217e14d2669a..948627bfdb417 100644 --- a/toolchain/check/testdata/builtins/float/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/float/greater_eq.carbon @@ -24,7 +24,7 @@ fn F(true_: True, false_: False) { true_ as (if GreaterEq(0.0, Negate(1.0)) then True else False); } -fn RuntimeCall(a: f64, b: f64) -> bool { +fn RuntimeCallIsValid(a: f64, b: f64) -> bool { return GreaterEq(a, b); } @@ -52,8 +52,8 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %float.3: f64 = float_literal 0 [template] // CHECK:STDOUT: %float.4: f64 = float_literal -1 [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [template] +// CHECK:STDOUT: %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,7 +73,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: .True = %True.decl // CHECK:STDOUT: .False = %False.decl // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .RuntimeCallIsValid = %RuntimeCallIsValid.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %GreaterEq.decl: %GreaterEq.type = fn_decl @GreaterEq [template = constants.%GreaterEq] { @@ -142,7 +142,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [template = constants.%RuntimeCallIsValid] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -151,22 +151,22 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] +// CHECK:STDOUT: %.loc16_42.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc16_42.2: type = converted %bool.make_type, %.loc16_42.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc16_19.1: type = splice_block %.loc16_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] -// CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %float.make_type.loc16_19 [template = f64] -// CHECK:STDOUT: %.loc16_19.3: type = converted %float.make_type.loc16_19, %.loc16_19.2 [template = f64] +// CHECK:STDOUT: %.loc16_26.1: type = splice_block %.loc16_26.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_26: init type = call constants.%Float(%int_64.loc16_26) [template = f64] +// CHECK:STDOUT: %.loc16_26.2: type = value_of_initializer %float.make_type.loc16_26 [template = f64] +// CHECK:STDOUT: %.loc16_26.3: type = converted %float.make_type.loc16_26, %.loc16_26.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc16_27.1: type = splice_block %.loc16_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] -// CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %float.make_type.loc16_27 [template = f64] -// CHECK:STDOUT: %.loc16_27.3: type = converted %float.make_type.loc16_27, %.loc16_27.2 [template = f64] +// CHECK:STDOUT: %.loc16_34.1: type = splice_block %.loc16_34.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_34: init type = call constants.%Float(%int_64.loc16_34) [template = f64] +// CHECK:STDOUT: %.loc16_34.2: type = value_of_initializer %float.make_type.loc16_34 [template = f64] +// CHECK:STDOUT: %.loc16_34.3: type = converted %float.make_type.loc16_34, %.loc16_34.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -302,7 +302,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %GreaterEq.ref: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/less.carbon b/toolchain/check/testdata/builtins/float/less.carbon index 4c01a6cca77ae..413596f128107 100644 --- a/toolchain/check/testdata/builtins/float/less.carbon +++ b/toolchain/check/testdata/builtins/float/less.carbon @@ -24,7 +24,7 @@ fn F(true_: True, false_: False) { false_ as (if Less(0.0, Negate(1.0)) then True else False); } -fn RuntimeCall(a: f64, b: f64) -> bool { +fn RuntimeCallIsValid(a: f64, b: f64) -> bool { return Less(a, b); } @@ -52,8 +52,8 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: %float.3: f64 = float_literal 0 [template] // CHECK:STDOUT: %float.4: f64 = float_literal -1 [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [template] +// CHECK:STDOUT: %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,7 +73,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: .True = %True.decl // CHECK:STDOUT: .False = %False.decl // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .RuntimeCallIsValid = %RuntimeCallIsValid.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Less.decl: %Less.type = fn_decl @Less [template = constants.%Less] { @@ -142,7 +142,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [template = constants.%RuntimeCallIsValid] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -151,22 +151,22 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] +// CHECK:STDOUT: %.loc16_42.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc16_42.2: type = converted %bool.make_type, %.loc16_42.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc16_19.1: type = splice_block %.loc16_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] -// CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %float.make_type.loc16_19 [template = f64] -// CHECK:STDOUT: %.loc16_19.3: type = converted %float.make_type.loc16_19, %.loc16_19.2 [template = f64] +// CHECK:STDOUT: %.loc16_26.1: type = splice_block %.loc16_26.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_26: init type = call constants.%Float(%int_64.loc16_26) [template = f64] +// CHECK:STDOUT: %.loc16_26.2: type = value_of_initializer %float.make_type.loc16_26 [template = f64] +// CHECK:STDOUT: %.loc16_26.3: type = converted %float.make_type.loc16_26, %.loc16_26.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc16_27.1: type = splice_block %.loc16_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] -// CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %float.make_type.loc16_27 [template = f64] -// CHECK:STDOUT: %.loc16_27.3: type = converted %float.make_type.loc16_27, %.loc16_27.2 [template = f64] +// CHECK:STDOUT: %.loc16_34.1: type = splice_block %.loc16_34.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_34: init type = call constants.%Float(%int_64.loc16_34) [template = f64] +// CHECK:STDOUT: %.loc16_34.2: type = value_of_initializer %float.make_type.loc16_34 [template = f64] +// CHECK:STDOUT: %.loc16_34.3: type = converted %float.make_type.loc16_34, %.loc16_34.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -302,7 +302,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Less.ref: %Less.type = name_ref Less, file.%Less.decl [template = constants.%Less] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/less_eq.carbon b/toolchain/check/testdata/builtins/float/less_eq.carbon index bfc6829dfc7b6..fbfa262c3da8c 100644 --- a/toolchain/check/testdata/builtins/float/less_eq.carbon +++ b/toolchain/check/testdata/builtins/float/less_eq.carbon @@ -24,7 +24,7 @@ fn F(true_: True, false_: False) { false_ as (if LessEq(0.0, Negate(1.0)) then True else False); } -fn RuntimeCall(a: f64, b: f64) -> bool { +fn RuntimeCallIsValid(a: f64, b: f64) -> bool { return LessEq(a, b); } @@ -52,8 +52,8 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %float.3: f64 = float_literal 0 [template] // CHECK:STDOUT: %false: bool = bool_literal false [template] // CHECK:STDOUT: %float.4: f64 = float_literal -1 [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [template] +// CHECK:STDOUT: %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,7 +73,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: .True = %True.decl // CHECK:STDOUT: .False = %False.decl // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .RuntimeCallIsValid = %RuntimeCallIsValid.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %LessEq.decl: %LessEq.type = fn_decl @LessEq [template = constants.%LessEq] { @@ -142,7 +142,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [template = constants.%RuntimeCallIsValid] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -151,22 +151,22 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] +// CHECK:STDOUT: %.loc16_42.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc16_42.2: type = converted %bool.make_type, %.loc16_42.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc16_19.1: type = splice_block %.loc16_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc16_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_19: init type = call constants.%Float(%int_64.loc16_19) [template = f64] -// CHECK:STDOUT: %.loc16_19.2: type = value_of_initializer %float.make_type.loc16_19 [template = f64] -// CHECK:STDOUT: %.loc16_19.3: type = converted %float.make_type.loc16_19, %.loc16_19.2 [template = f64] +// CHECK:STDOUT: %.loc16_26.1: type = splice_block %.loc16_26.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_26: init type = call constants.%Float(%int_64.loc16_26) [template = f64] +// CHECK:STDOUT: %.loc16_26.2: type = value_of_initializer %float.make_type.loc16_26 [template = f64] +// CHECK:STDOUT: %.loc16_26.3: type = converted %float.make_type.loc16_26, %.loc16_26.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc16_27.1: type = splice_block %.loc16_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc16_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc16_27: init type = call constants.%Float(%int_64.loc16_27) [template = f64] -// CHECK:STDOUT: %.loc16_27.2: type = value_of_initializer %float.make_type.loc16_27 [template = f64] -// CHECK:STDOUT: %.loc16_27.3: type = converted %float.make_type.loc16_27, %.loc16_27.2 [template = f64] +// CHECK:STDOUT: %.loc16_34.1: type = splice_block %.loc16_34.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc16_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc16_34: init type = call constants.%Float(%int_64.loc16_34) [template = f64] +// CHECK:STDOUT: %.loc16_34.2: type = value_of_initializer %float.make_type.loc16_34 [template = f64] +// CHECK:STDOUT: %.loc16_34.3: type = converted %float.make_type.loc16_34, %.loc16_34.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -302,7 +302,7 @@ fn RuntimeCall(a: f64, b: f64) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %LessEq.ref: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/mul.carbon b/toolchain/check/testdata/builtins/float/mul.carbon index 03dc958966f7c..d1a42c514827c 100644 --- a/toolchain/check/testdata/builtins/float/mul.carbon +++ b/toolchain/check/testdata/builtins/float/mul.carbon @@ -12,7 +12,7 @@ fn Mul(a: f64, b: f64) -> f64 = "float.mul"; -fn RuntimeCall(a: f64, b: f64) -> f64 { +fn RuntimeCallIsValid(a: f64, b: f64) -> f64 { return Mul(a, b); } @@ -38,15 +38,15 @@ fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.mul"; fn BadReturnType(a: f64, b: f64) -> bool = "float.mul"; fn JustRight(a: f64, b: f64) -> f64 = "float.mul"; -fn RuntimeCallTooFew(a: f64) -> f64 { +fn RuntimeCallIsValidTooFew(a: f64) -> f64 { return TooFew(a); } -fn RuntimeCallTooMany(a: f64, b: f64, c: f64) -> f64 { +fn RuntimeCallIsValidTooMany(a: f64, b: f64, c: f64) -> f64 { return TooMany(a, b, c); } -fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { +fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { return BadReturnType(a, b); } @@ -58,8 +58,8 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %Mul.type: type = fn_type @Mul [template] // CHECK:STDOUT: %Mul: %Mul.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [template] +// CHECK:STDOUT: %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [template] // CHECK:STDOUT: %float.1: f64 = float_literal 2 [template] // CHECK:STDOUT: %float.2: f64 = float_literal 0.5 [template] // CHECK:STDOUT: %float.3: f64 = float_literal 1 [template] @@ -77,7 +77,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Mul = %Mul.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .RuntimeCallIsValid = %RuntimeCallIsValid.decl // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core @@ -112,7 +112,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [template = constants.%RuntimeCallIsValid] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -120,24 +120,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc4_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%int_64.loc4_35) [template = f64] -// CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %float.make_type.loc4_35 [template = f64] -// CHECK:STDOUT: %.loc4_35.2: type = converted %float.make_type.loc4_35, %.loc4_35.1 [template = f64] +// CHECK:STDOUT: %int_64.loc4_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_42: init type = call constants.%Float(%int_64.loc4_42) [template = f64] +// CHECK:STDOUT: %.loc4_42.1: type = value_of_initializer %float.make_type.loc4_42 [template = f64] +// CHECK:STDOUT: %.loc4_42.2: type = converted %float.make_type.loc4_42, %.loc4_42.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_19.1: type = splice_block %.loc4_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] -// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %float.make_type.loc4_19 [template = f64] -// CHECK:STDOUT: %.loc4_19.3: type = converted %float.make_type.loc4_19, %.loc4_19.2 [template = f64] +// CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_26: init type = call constants.%Float(%int_64.loc4_26) [template = f64] +// CHECK:STDOUT: %.loc4_26.2: type = value_of_initializer %float.make_type.loc4_26 [template = f64] +// CHECK:STDOUT: %.loc4_26.3: type = converted %float.make_type.loc4_26, %.loc4_26.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_27.1: type = splice_block %.loc4_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] -// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %float.make_type.loc4_27 [template = f64] -// CHECK:STDOUT: %.loc4_27.3: type = converted %float.make_type.loc4_27, %.loc4_27.2 [template = f64] +// CHECK:STDOUT: %.loc4_34.1: type = splice_block %.loc4_34.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_34: init type = call constants.%Float(%int_64.loc4_34) [template = f64] +// CHECK:STDOUT: %.loc4_34.2: type = value_of_initializer %float.make_type.loc4_34 [template = f64] +// CHECK:STDOUT: %.loc4_34.3: type = converted %float.make_type.loc4_34, %.loc4_34.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 @@ -149,7 +149,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Mul(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.mul"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param_patt: f64, %b.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [template = constants.%Mul] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -186,12 +186,12 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] -// CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] -// CHECK:STDOUT: %RuntimeCallTooMany: %RuntimeCallTooMany.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType.type: type = fn_type @RuntimeCallBadReturnType [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooFew.type: type = fn_type @RuntimeCallIsValidTooFew [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooFew: %RuntimeCallIsValidTooFew.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooMany.type: type = fn_type @RuntimeCallIsValidTooMany [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooMany: %RuntimeCallIsValidTooMany.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType.type: type = fn_type @RuntimeCallIsValidBadReturnType [template] +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType: %RuntimeCallIsValidBadReturnType.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -210,9 +210,9 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl // CHECK:STDOUT: .JustRight = %JustRight.decl -// CHECK:STDOUT: .RuntimeCallTooFew = %RuntimeCallTooFew.decl -// CHECK:STDOUT: .RuntimeCallTooMany = %RuntimeCallTooMany.decl -// CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl +// CHECK:STDOUT: .RuntimeCallIsValidTooFew = %RuntimeCallIsValidTooFew.decl +// CHECK:STDOUT: .RuntimeCallIsValidTooMany = %RuntimeCallIsValidTooMany.decl +// CHECK:STDOUT: .RuntimeCallIsValidBadReturnType = %RuntimeCallIsValidBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { @@ -338,28 +338,28 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { +// CHECK:STDOUT: %RuntimeCallIsValidTooFew.decl: %RuntimeCallIsValidTooFew.type = fn_decl @RuntimeCallIsValidTooFew [template = constants.%RuntimeCallIsValidTooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%int_64.loc20_33) [template = f64] -// CHECK:STDOUT: %.loc20_33.1: type = value_of_initializer %float.make_type.loc20_33 [template = f64] -// CHECK:STDOUT: %.loc20_33.2: type = converted %float.make_type.loc20_33, %.loc20_33.1 [template = f64] +// CHECK:STDOUT: %int_64.loc20_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_40: init type = call constants.%Float(%int_64.loc20_40) [template = f64] +// CHECK:STDOUT: %.loc20_40.1: type = value_of_initializer %float.make_type.loc20_40 [template = f64] +// CHECK:STDOUT: %.loc20_40.2: type = converted %float.make_type.loc20_40, %.loc20_40.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc20_25.1: type = splice_block %.loc20_25.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] -// CHECK:STDOUT: %.loc20_25.2: type = value_of_initializer %float.make_type.loc20_25 [template = f64] -// CHECK:STDOUT: %.loc20_25.3: type = converted %float.make_type.loc20_25, %.loc20_25.2 [template = f64] +// CHECK:STDOUT: %.loc20_32.1: type = splice_block %.loc20_32.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc20_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_32: init type = call constants.%Float(%int_64.loc20_32) [template = f64] +// CHECK:STDOUT: %.loc20_32.2: type = value_of_initializer %float.make_type.loc20_32 [template = f64] +// CHECK:STDOUT: %.loc20_32.3: type = converted %float.make_type.loc20_32, %.loc20_32.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %RuntimeCallIsValidTooMany.decl: %RuntimeCallIsValidTooMany.type = fn_decl @RuntimeCallIsValidTooMany [template = constants.%RuntimeCallIsValidTooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -369,38 +369,38 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_50: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%int_64.loc24_50) [template = f64] -// CHECK:STDOUT: %.loc24_50.1: type = value_of_initializer %float.make_type.loc24_50 [template = f64] -// CHECK:STDOUT: %.loc24_50.2: type = converted %float.make_type.loc24_50, %.loc24_50.1 [template = f64] +// CHECK:STDOUT: %int_64.loc24_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_57: init type = call constants.%Float(%int_64.loc24_57) [template = f64] +// CHECK:STDOUT: %.loc24_57.1: type = value_of_initializer %float.make_type.loc24_57 [template = f64] +// CHECK:STDOUT: %.loc24_57.2: type = converted %float.make_type.loc24_57, %.loc24_57.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc24_26.1: type = splice_block %.loc24_26.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] -// CHECK:STDOUT: %.loc24_26.2: type = value_of_initializer %float.make_type.loc24_26 [template = f64] -// CHECK:STDOUT: %.loc24_26.3: type = converted %float.make_type.loc24_26, %.loc24_26.2 [template = f64] +// CHECK:STDOUT: %.loc24_33.1: type = splice_block %.loc24_33.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_33: init type = call constants.%Float(%int_64.loc24_33) [template = f64] +// CHECK:STDOUT: %.loc24_33.2: type = value_of_initializer %float.make_type.loc24_33 [template = f64] +// CHECK:STDOUT: %.loc24_33.3: type = converted %float.make_type.loc24_33, %.loc24_33.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc24_34.1: type = splice_block %.loc24_34.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] -// CHECK:STDOUT: %.loc24_34.2: type = value_of_initializer %float.make_type.loc24_34 [template = f64] -// CHECK:STDOUT: %.loc24_34.3: type = converted %float.make_type.loc24_34, %.loc24_34.2 [template = f64] +// CHECK:STDOUT: %.loc24_41.1: type = splice_block %.loc24_41.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_41: init type = call constants.%Float(%int_64.loc24_41) [template = f64] +// CHECK:STDOUT: %.loc24_41.2: type = value_of_initializer %float.make_type.loc24_41 [template = f64] +// CHECK:STDOUT: %.loc24_41.3: type = converted %float.make_type.loc24_41, %.loc24_41.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 -// CHECK:STDOUT: %.loc24_42.1: type = splice_block %.loc24_42.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] -// CHECK:STDOUT: %.loc24_42.2: type = value_of_initializer %float.make_type.loc24_42 [template = f64] -// CHECK:STDOUT: %.loc24_42.3: type = converted %float.make_type.loc24_42, %.loc24_42.2 [template = f64] +// CHECK:STDOUT: %.loc24_49.1: type = splice_block %.loc24_49.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_49: init type = call constants.%Float(%int_64.loc24_49) [template = f64] +// CHECK:STDOUT: %.loc24_49.2: type = value_of_initializer %float.make_type.loc24_49 [template = f64] +// CHECK:STDOUT: %.loc24_49.3: type = converted %float.make_type.loc24_49, %.loc24_49.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType.decl: %RuntimeCallIsValidBadReturnType.type = fn_decl @RuntimeCallIsValidBadReturnType [template = constants.%RuntimeCallIsValidBadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -409,22 +409,22 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] +// CHECK:STDOUT: %.loc28_55.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc28_55.2: type = converted %bool.make_type, %.loc28_55.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc28_32.1: type = splice_block %.loc28_32.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] -// CHECK:STDOUT: %.loc28_32.2: type = value_of_initializer %float.make_type.loc28_32 [template = f64] -// CHECK:STDOUT: %.loc28_32.3: type = converted %float.make_type.loc28_32, %.loc28_32.2 [template = f64] +// CHECK:STDOUT: %.loc28_39.1: type = splice_block %.loc28_39.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_39: init type = call constants.%Float(%int_64.loc28_39) [template = f64] +// CHECK:STDOUT: %.loc28_39.2: type = value_of_initializer %float.make_type.loc28_39 [template = f64] +// CHECK:STDOUT: %.loc28_39.3: type = converted %float.make_type.loc28_39, %.loc28_39.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc28_40.1: type = splice_block %.loc28_40.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] -// CHECK:STDOUT: %.loc28_40.2: type = value_of_initializer %float.make_type.loc28_40 [template = f64] -// CHECK:STDOUT: %.loc28_40.3: type = converted %float.make_type.loc28_40, %.loc28_40.2 [template = f64] +// CHECK:STDOUT: %.loc28_47.1: type = splice_block %.loc28_47.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_47: init type = call constants.%Float(%int_64.loc28_47) [template = f64] +// CHECK:STDOUT: %.loc28_47.2: type = value_of_initializer %float.make_type.loc28_47 [template = f64] +// CHECK:STDOUT: %.loc28_47.3: type = converted %float.make_type.loc28_47, %.loc28_47.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -440,7 +440,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @JustRight(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.mul"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValidTooFew(%a.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -450,7 +450,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc21_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -462,7 +462,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc25_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/negate.carbon b/toolchain/check/testdata/builtins/float/negate.carbon index 65db87190d176..3d48c413aacce 100644 --- a/toolchain/check/testdata/builtins/float/negate.carbon +++ b/toolchain/check/testdata/builtins/float/negate.carbon @@ -12,7 +12,7 @@ fn Negate(a: f64) -> f64 = "float.negate"; -fn RuntimeCall(a: f64, b: f64) -> f64 { +fn RuntimeCallIsValid(a: f64, b: f64) -> f64 { return Negate(a); } @@ -39,7 +39,7 @@ fn TooMany(a: f64, b: f64) -> f64 = "float.negate"; fn BadReturnType(a: f64) -> bool = "float.negate"; fn JustRight(a: f64) -> f64 = "float.negate"; -fn RuntimeCallTooFew(a: f64) -> f64 { +fn RuntimeCallIsValidTooFew(a: f64) -> f64 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch] // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~~~ @@ -50,7 +50,7 @@ fn RuntimeCallTooFew(a: f64) -> f64 { return TooFew(a); } -fn RuntimeCallTooMany(a: f64, b: f64, c: f64) -> f64 { +fn RuntimeCallIsValidTooMany(a: f64, b: f64, c: f64) -> f64 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 arguments passed to function expecting 2 arguments [CallArgCountMismatch] // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ @@ -61,7 +61,7 @@ fn RuntimeCallTooMany(a: f64, b: f64, c: f64) -> f64 { return TooMany(a, b, c); } -fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { +fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ @@ -79,8 +79,8 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %Negate.type: type = fn_type @Negate [template] // CHECK:STDOUT: %Negate: %Negate.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [template] +// CHECK:STDOUT: %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [template] // CHECK:STDOUT: %float.1: f64 = float_literal 1.5 [template] // CHECK:STDOUT: %float.2: f64 = float_literal -1.5 [template] // CHECK:STDOUT: } @@ -97,7 +97,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .RuntimeCallIsValid = %RuntimeCallIsValid.decl // CHECK:STDOUT: .a = @__global_init.%a // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core @@ -122,7 +122,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [template = constants.%RuntimeCallIsValid] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -130,24 +130,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc4_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%int_64.loc4_35) [template = f64] -// CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %float.make_type.loc4_35 [template = f64] -// CHECK:STDOUT: %.loc4_35.2: type = converted %float.make_type.loc4_35, %.loc4_35.1 [template = f64] +// CHECK:STDOUT: %int_64.loc4_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_42: init type = call constants.%Float(%int_64.loc4_42) [template = f64] +// CHECK:STDOUT: %.loc4_42.1: type = value_of_initializer %float.make_type.loc4_42 [template = f64] +// CHECK:STDOUT: %.loc4_42.2: type = converted %float.make_type.loc4_42, %.loc4_42.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_19.1: type = splice_block %.loc4_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] -// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %float.make_type.loc4_19 [template = f64] -// CHECK:STDOUT: %.loc4_19.3: type = converted %float.make_type.loc4_19, %.loc4_19.2 [template = f64] +// CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_26: init type = call constants.%Float(%int_64.loc4_26) [template = f64] +// CHECK:STDOUT: %.loc4_26.2: type = value_of_initializer %float.make_type.loc4_26 [template = f64] +// CHECK:STDOUT: %.loc4_26.3: type = converted %float.make_type.loc4_26, %.loc4_26.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_27.1: type = splice_block %.loc4_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] -// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %float.make_type.loc4_27 [template = f64] -// CHECK:STDOUT: %.loc4_27.3: type = converted %float.make_type.loc4_27, %.loc4_27.2 [template = f64] +// CHECK:STDOUT: %.loc4_34.1: type = splice_block %.loc4_34.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_34: init type = call constants.%Float(%int_64.loc4_34) [template = f64] +// CHECK:STDOUT: %.loc4_34.2: type = value_of_initializer %float.make_type.loc4_34 [template = f64] +// CHECK:STDOUT: %.loc4_34.3: type = converted %float.make_type.loc4_34, %.loc4_34.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 @@ -157,7 +157,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Negate(%a.param_patt: f64) -> f64 = "float.negate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param_patt: f64, %b.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [template = constants.%Negate] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -194,12 +194,12 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] -// CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] -// CHECK:STDOUT: %RuntimeCallTooMany: %RuntimeCallTooMany.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType.type: type = fn_type @RuntimeCallBadReturnType [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooFew.type: type = fn_type @RuntimeCallIsValidTooFew [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooFew: %RuntimeCallIsValidTooFew.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooMany.type: type = fn_type @RuntimeCallIsValidTooMany [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooMany: %RuntimeCallIsValidTooMany.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType.type: type = fn_type @RuntimeCallIsValidBadReturnType [template] +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType: %RuntimeCallIsValidBadReturnType.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -218,9 +218,9 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl // CHECK:STDOUT: .JustRight = %JustRight.decl -// CHECK:STDOUT: .RuntimeCallTooFew = %RuntimeCallTooFew.decl -// CHECK:STDOUT: .RuntimeCallTooMany = %RuntimeCallTooMany.decl -// CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl +// CHECK:STDOUT: .RuntimeCallIsValidTooFew = %RuntimeCallIsValidTooFew.decl +// CHECK:STDOUT: .RuntimeCallIsValidTooMany = %RuntimeCallIsValidTooMany.decl +// CHECK:STDOUT: .RuntimeCallIsValidBadReturnType = %RuntimeCallIsValidBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { @@ -306,28 +306,28 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { +// CHECK:STDOUT: %RuntimeCallIsValidTooFew.decl: %RuntimeCallIsValidTooFew.type = fn_decl @RuntimeCallIsValidTooFew [template = constants.%RuntimeCallIsValidTooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc21_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc21_33: init type = call constants.%Float(%int_64.loc21_33) [template = f64] -// CHECK:STDOUT: %.loc21_33.1: type = value_of_initializer %float.make_type.loc21_33 [template = f64] -// CHECK:STDOUT: %.loc21_33.2: type = converted %float.make_type.loc21_33, %.loc21_33.1 [template = f64] +// CHECK:STDOUT: %int_64.loc21_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc21_40: init type = call constants.%Float(%int_64.loc21_40) [template = f64] +// CHECK:STDOUT: %.loc21_40.1: type = value_of_initializer %float.make_type.loc21_40 [template = f64] +// CHECK:STDOUT: %.loc21_40.2: type = converted %float.make_type.loc21_40, %.loc21_40.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc21_25.1: type = splice_block %.loc21_25.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc21_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc21_25: init type = call constants.%Float(%int_64.loc21_25) [template = f64] -// CHECK:STDOUT: %.loc21_25.2: type = value_of_initializer %float.make_type.loc21_25 [template = f64] -// CHECK:STDOUT: %.loc21_25.3: type = converted %float.make_type.loc21_25, %.loc21_25.2 [template = f64] +// CHECK:STDOUT: %.loc21_32.1: type = splice_block %.loc21_32.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc21_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc21_32: init type = call constants.%Float(%int_64.loc21_32) [template = f64] +// CHECK:STDOUT: %.loc21_32.2: type = value_of_initializer %float.make_type.loc21_32 [template = f64] +// CHECK:STDOUT: %.loc21_32.3: type = converted %float.make_type.loc21_32, %.loc21_32.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %RuntimeCallIsValidTooMany.decl: %RuntimeCallIsValidTooMany.type = fn_decl @RuntimeCallIsValidTooMany [template = constants.%RuntimeCallIsValidTooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -337,38 +337,38 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc32_50: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc32_50: init type = call constants.%Float(%int_64.loc32_50) [template = f64] -// CHECK:STDOUT: %.loc32_50.1: type = value_of_initializer %float.make_type.loc32_50 [template = f64] -// CHECK:STDOUT: %.loc32_50.2: type = converted %float.make_type.loc32_50, %.loc32_50.1 [template = f64] +// CHECK:STDOUT: %int_64.loc32_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc32_57: init type = call constants.%Float(%int_64.loc32_57) [template = f64] +// CHECK:STDOUT: %.loc32_57.1: type = value_of_initializer %float.make_type.loc32_57 [template = f64] +// CHECK:STDOUT: %.loc32_57.2: type = converted %float.make_type.loc32_57, %.loc32_57.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc32_26.1: type = splice_block %.loc32_26.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc32_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc32_26: init type = call constants.%Float(%int_64.loc32_26) [template = f64] -// CHECK:STDOUT: %.loc32_26.2: type = value_of_initializer %float.make_type.loc32_26 [template = f64] -// CHECK:STDOUT: %.loc32_26.3: type = converted %float.make_type.loc32_26, %.loc32_26.2 [template = f64] +// CHECK:STDOUT: %.loc32_33.1: type = splice_block %.loc32_33.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc32_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc32_33: init type = call constants.%Float(%int_64.loc32_33) [template = f64] +// CHECK:STDOUT: %.loc32_33.2: type = value_of_initializer %float.make_type.loc32_33 [template = f64] +// CHECK:STDOUT: %.loc32_33.3: type = converted %float.make_type.loc32_33, %.loc32_33.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc32_34.1: type = splice_block %.loc32_34.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc32_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc32_34: init type = call constants.%Float(%int_64.loc32_34) [template = f64] -// CHECK:STDOUT: %.loc32_34.2: type = value_of_initializer %float.make_type.loc32_34 [template = f64] -// CHECK:STDOUT: %.loc32_34.3: type = converted %float.make_type.loc32_34, %.loc32_34.2 [template = f64] +// CHECK:STDOUT: %.loc32_41.1: type = splice_block %.loc32_41.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc32_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc32_41: init type = call constants.%Float(%int_64.loc32_41) [template = f64] +// CHECK:STDOUT: %.loc32_41.2: type = value_of_initializer %float.make_type.loc32_41 [template = f64] +// CHECK:STDOUT: %.loc32_41.3: type = converted %float.make_type.loc32_41, %.loc32_41.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 -// CHECK:STDOUT: %.loc32_42.1: type = splice_block %.loc32_42.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc32_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc32_42: init type = call constants.%Float(%int_64.loc32_42) [template = f64] -// CHECK:STDOUT: %.loc32_42.2: type = value_of_initializer %float.make_type.loc32_42 [template = f64] -// CHECK:STDOUT: %.loc32_42.3: type = converted %float.make_type.loc32_42, %.loc32_42.2 [template = f64] +// CHECK:STDOUT: %.loc32_49.1: type = splice_block %.loc32_49.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc32_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc32_49: init type = call constants.%Float(%int_64.loc32_49) [template = f64] +// CHECK:STDOUT: %.loc32_49.2: type = value_of_initializer %float.make_type.loc32_49 [template = f64] +// CHECK:STDOUT: %.loc32_49.3: type = converted %float.make_type.loc32_49, %.loc32_49.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType.decl: %RuntimeCallIsValidBadReturnType.type = fn_decl @RuntimeCallIsValidBadReturnType [template = constants.%RuntimeCallIsValidBadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -377,22 +377,22 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc43_48.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc43_48.2: type = converted %bool.make_type, %.loc43_48.1 [template = bool] +// CHECK:STDOUT: %.loc43_55.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc43_55.2: type = converted %bool.make_type, %.loc43_55.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc43_32.1: type = splice_block %.loc43_32.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc43_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc43_32: init type = call constants.%Float(%int_64.loc43_32) [template = f64] -// CHECK:STDOUT: %.loc43_32.2: type = value_of_initializer %float.make_type.loc43_32 [template = f64] -// CHECK:STDOUT: %.loc43_32.3: type = converted %float.make_type.loc43_32, %.loc43_32.2 [template = f64] +// CHECK:STDOUT: %.loc43_39.1: type = splice_block %.loc43_39.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc43_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc43_39: init type = call constants.%Float(%int_64.loc43_39) [template = f64] +// CHECK:STDOUT: %.loc43_39.2: type = value_of_initializer %float.make_type.loc43_39 [template = f64] +// CHECK:STDOUT: %.loc43_39.3: type = converted %float.make_type.loc43_39, %.loc43_39.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc43_40.1: type = splice_block %.loc43_40.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc43_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc43_40: init type = call constants.%Float(%int_64.loc43_40) [template = f64] -// CHECK:STDOUT: %.loc43_40.2: type = value_of_initializer %float.make_type.loc43_40 [template = f64] -// CHECK:STDOUT: %.loc43_40.3: type = converted %float.make_type.loc43_40, %.loc43_40.2 [template = f64] +// CHECK:STDOUT: %.loc43_47.1: type = splice_block %.loc43_47.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc43_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc43_47: init type = call constants.%Float(%int_64.loc43_47) [template = f64] +// CHECK:STDOUT: %.loc43_47.2: type = value_of_initializer %float.make_type.loc43_47 [template = f64] +// CHECK:STDOUT: %.loc43_47.3: type = converted %float.make_type.loc43_47, %.loc43_47.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -408,14 +408,14 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @JustRight(%a.param_patt: f64) -> f64 = "float.negate"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValidTooFew(%a.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -424,7 +424,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/neq.carbon b/toolchain/check/testdata/builtins/float/neq.carbon index e0364272e5f60..7e6d5002d58d6 100644 --- a/toolchain/check/testdata/builtins/float/neq.carbon +++ b/toolchain/check/testdata/builtins/float/neq.carbon @@ -20,7 +20,7 @@ fn F(true_: True, false_: False) { false_ as (if Neq(1.0, 1.0) then True else False); } -fn RuntimeCall(a: f64, b: f64) -> bool { +fn RuntimeCallIsValid(a: f64, b: f64) -> bool { return Neq(a, b); } @@ -53,8 +53,8 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %float.2: f64 = float_literal 2 [template] // CHECK:STDOUT: %true: bool = bool_literal true [template] // CHECK:STDOUT: %false: bool = bool_literal false [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [template] +// CHECK:STDOUT: %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -73,7 +73,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: .True = %True.decl // CHECK:STDOUT: .False = %False.decl // CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .RuntimeCallIsValid = %RuntimeCallIsValid.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Neq.decl: %Neq.type = fn_decl @Neq [template = constants.%Neq] { @@ -121,7 +121,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] // CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [template = constants.%RuntimeCallIsValid] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -130,22 +130,22 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] +// CHECK:STDOUT: %.loc12_42.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc12_42.2: type = converted %bool.make_type, %.loc12_42.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc12_19.1: type = splice_block %.loc12_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc12_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc12_19: init type = call constants.%Float(%int_64.loc12_19) [template = f64] -// CHECK:STDOUT: %.loc12_19.2: type = value_of_initializer %float.make_type.loc12_19 [template = f64] -// CHECK:STDOUT: %.loc12_19.3: type = converted %float.make_type.loc12_19, %.loc12_19.2 [template = f64] +// CHECK:STDOUT: %.loc12_26.1: type = splice_block %.loc12_26.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc12_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc12_26: init type = call constants.%Float(%int_64.loc12_26) [template = f64] +// CHECK:STDOUT: %.loc12_26.2: type = value_of_initializer %float.make_type.loc12_26 [template = f64] +// CHECK:STDOUT: %.loc12_26.3: type = converted %float.make_type.loc12_26, %.loc12_26.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc12_27.1: type = splice_block %.loc12_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc12_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc12_27: init type = call constants.%Float(%int_64.loc12_27) [template = f64] -// CHECK:STDOUT: %.loc12_27.2: type = value_of_initializer %float.make_type.loc12_27 [template = f64] -// CHECK:STDOUT: %.loc12_27.3: type = converted %float.make_type.loc12_27, %.loc12_27.2 [template = f64] +// CHECK:STDOUT: %.loc12_34.1: type = splice_block %.loc12_34.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc12_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc12_34: init type = call constants.%Float(%int_64.loc12_34) [template = f64] +// CHECK:STDOUT: %.loc12_34.2: type = value_of_initializer %float.make_type.loc12_34 [template = f64] +// CHECK:STDOUT: %.loc12_34.3: type = converted %float.make_type.loc12_34, %.loc12_34.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -214,7 +214,7 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq"; // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Neq.ref: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/float/sub.carbon b/toolchain/check/testdata/builtins/float/sub.carbon index 07303628f1cc6..03add0c7e2126 100644 --- a/toolchain/check/testdata/builtins/float/sub.carbon +++ b/toolchain/check/testdata/builtins/float/sub.carbon @@ -12,7 +12,7 @@ fn Sub(a: f64, b: f64) -> f64 = "float.sub"; -fn RuntimeCall(a: f64, b: f64) -> f64 { +fn RuntimeCallIsValid(a: f64, b: f64) -> f64 { return Sub(a, b); } @@ -38,15 +38,15 @@ fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.sub"; fn BadReturnType(a: f64, b: f64) -> bool = "float.sub"; fn JustRight(a: f64, b: f64) -> f64 = "float.sub"; -fn RuntimeCallTooFew(a: f64) -> f64 { +fn RuntimeCallIsValidTooFew(a: f64) -> f64 { return TooFew(a); } -fn RuntimeCallTooMany(a: f64, b: f64, c: f64) -> f64 { +fn RuntimeCallIsValidTooMany(a: f64, b: f64, c: f64) -> f64 { return TooMany(a, b, c); } -fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { +fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool { return BadReturnType(a, b); } @@ -58,8 +58,8 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %Float: %Float.type = struct_value () [template] // CHECK:STDOUT: %Sub.type: type = fn_type @Sub [template] // CHECK:STDOUT: %Sub: %Sub.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [template] +// CHECK:STDOUT: %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [template] // CHECK:STDOUT: %float.1: f64 = float_literal 2 [template] // CHECK:STDOUT: %float.2: f64 = float_literal 0.5 [template] // CHECK:STDOUT: %float.3: f64 = float_literal 1.5 [template] @@ -77,7 +77,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: package: = namespace [template] { // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl +// CHECK:STDOUT: .RuntimeCallIsValid = %RuntimeCallIsValid.decl // CHECK:STDOUT: .x = %x // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core @@ -112,7 +112,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [template = constants.%RuntimeCallIsValid] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -120,24 +120,24 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc4_35: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_35: init type = call constants.%Float(%int_64.loc4_35) [template = f64] -// CHECK:STDOUT: %.loc4_35.1: type = value_of_initializer %float.make_type.loc4_35 [template = f64] -// CHECK:STDOUT: %.loc4_35.2: type = converted %float.make_type.loc4_35, %.loc4_35.1 [template = f64] +// CHECK:STDOUT: %int_64.loc4_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_42: init type = call constants.%Float(%int_64.loc4_42) [template = f64] +// CHECK:STDOUT: %.loc4_42.1: type = value_of_initializer %float.make_type.loc4_42 [template = f64] +// CHECK:STDOUT: %.loc4_42.2: type = converted %float.make_type.loc4_42, %.loc4_42.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_19.1: type = splice_block %.loc4_19.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc4_19: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_19: init type = call constants.%Float(%int_64.loc4_19) [template = f64] -// CHECK:STDOUT: %.loc4_19.2: type = value_of_initializer %float.make_type.loc4_19 [template = f64] -// CHECK:STDOUT: %.loc4_19.3: type = converted %float.make_type.loc4_19, %.loc4_19.2 [template = f64] +// CHECK:STDOUT: %.loc4_26.1: type = splice_block %.loc4_26.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_26: init type = call constants.%Float(%int_64.loc4_26) [template = f64] +// CHECK:STDOUT: %.loc4_26.2: type = value_of_initializer %float.make_type.loc4_26 [template = f64] +// CHECK:STDOUT: %.loc4_26.3: type = converted %float.make_type.loc4_26, %.loc4_26.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_27.1: type = splice_block %.loc4_27.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc4_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc4_27: init type = call constants.%Float(%int_64.loc4_27) [template = f64] -// CHECK:STDOUT: %.loc4_27.2: type = value_of_initializer %float.make_type.loc4_27 [template = f64] -// CHECK:STDOUT: %.loc4_27.3: type = converted %float.make_type.loc4_27, %.loc4_27.2 [template = f64] +// CHECK:STDOUT: %.loc4_34.1: type = splice_block %.loc4_34.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc4_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc4_34: init type = call constants.%Float(%int_64.loc4_34) [template = f64] +// CHECK:STDOUT: %.loc4_34.2: type = value_of_initializer %float.make_type.loc4_34 [template = f64] +// CHECK:STDOUT: %.loc4_34.3: type = converted %float.make_type.loc4_34, %.loc4_34.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 @@ -149,7 +149,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @Sub(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.sub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: f64, %b.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param_patt: f64, %b.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [template = constants.%Sub] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -186,12 +186,12 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] // CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] // CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] -// CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] -// CHECK:STDOUT: %RuntimeCallTooMany: %RuntimeCallTooMany.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType.type: type = fn_type @RuntimeCallBadReturnType [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooFew.type: type = fn_type @RuntimeCallIsValidTooFew [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooFew: %RuntimeCallIsValidTooFew.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooMany.type: type = fn_type @RuntimeCallIsValidTooMany [template] +// CHECK:STDOUT: %RuntimeCallIsValidTooMany: %RuntimeCallIsValidTooMany.type = struct_value () [template] +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType.type: type = fn_type @RuntimeCallIsValidBadReturnType [template] +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType: %RuntimeCallIsValidBadReturnType.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -210,9 +210,9 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: .TooMany = %TooMany.decl // CHECK:STDOUT: .BadReturnType = %BadReturnType.decl // CHECK:STDOUT: .JustRight = %JustRight.decl -// CHECK:STDOUT: .RuntimeCallTooFew = %RuntimeCallTooFew.decl -// CHECK:STDOUT: .RuntimeCallTooMany = %RuntimeCallTooMany.decl -// CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl +// CHECK:STDOUT: .RuntimeCallIsValidTooFew = %RuntimeCallIsValidTooFew.decl +// CHECK:STDOUT: .RuntimeCallIsValidTooMany = %RuntimeCallIsValidTooMany.decl +// CHECK:STDOUT: .RuntimeCallIsValidBadReturnType = %RuntimeCallIsValidBadReturnType.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { @@ -338,28 +338,28 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param2 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { +// CHECK:STDOUT: %RuntimeCallIsValidTooFew.decl: %RuntimeCallIsValidTooFew.type = fn_decl @RuntimeCallIsValidTooFew [template = constants.%RuntimeCallIsValidTooFew] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param1 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc20_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_33: init type = call constants.%Float(%int_64.loc20_33) [template = f64] -// CHECK:STDOUT: %.loc20_33.1: type = value_of_initializer %float.make_type.loc20_33 [template = f64] -// CHECK:STDOUT: %.loc20_33.2: type = converted %float.make_type.loc20_33, %.loc20_33.1 [template = f64] +// CHECK:STDOUT: %int_64.loc20_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_40: init type = call constants.%Float(%int_64.loc20_40) [template = f64] +// CHECK:STDOUT: %.loc20_40.1: type = value_of_initializer %float.make_type.loc20_40 [template = f64] +// CHECK:STDOUT: %.loc20_40.2: type = converted %float.make_type.loc20_40, %.loc20_40.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc20_25.1: type = splice_block %.loc20_25.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc20_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc20_25: init type = call constants.%Float(%int_64.loc20_25) [template = f64] -// CHECK:STDOUT: %.loc20_25.2: type = value_of_initializer %float.make_type.loc20_25 [template = f64] -// CHECK:STDOUT: %.loc20_25.3: type = converted %float.make_type.loc20_25, %.loc20_25.2 [template = f64] +// CHECK:STDOUT: %.loc20_32.1: type = splice_block %.loc20_32.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc20_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc20_32: init type = call constants.%Float(%int_64.loc20_32) [template = f64] +// CHECK:STDOUT: %.loc20_32.2: type = value_of_initializer %float.make_type.loc20_32 [template = f64] +// CHECK:STDOUT: %.loc20_32.3: type = converted %float.make_type.loc20_32, %.loc20_32.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param1 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { +// CHECK:STDOUT: %RuntimeCallIsValidTooMany.decl: %RuntimeCallIsValidTooMany.type = fn_decl @RuntimeCallIsValidTooMany [template = constants.%RuntimeCallIsValidTooMany] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -369,38 +369,38 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.patt: f64 = return_slot_pattern // CHECK:STDOUT: %return.param_patt: f64 = out_param_pattern %return.patt, runtime_param3 // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64.loc24_50: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_50: init type = call constants.%Float(%int_64.loc24_50) [template = f64] -// CHECK:STDOUT: %.loc24_50.1: type = value_of_initializer %float.make_type.loc24_50 [template = f64] -// CHECK:STDOUT: %.loc24_50.2: type = converted %float.make_type.loc24_50, %.loc24_50.1 [template = f64] +// CHECK:STDOUT: %int_64.loc24_57: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_57: init type = call constants.%Float(%int_64.loc24_57) [template = f64] +// CHECK:STDOUT: %.loc24_57.1: type = value_of_initializer %float.make_type.loc24_57 [template = f64] +// CHECK:STDOUT: %.loc24_57.2: type = converted %float.make_type.loc24_57, %.loc24_57.1 [template = f64] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc24_26.1: type = splice_block %.loc24_26.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_26: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_26: init type = call constants.%Float(%int_64.loc24_26) [template = f64] -// CHECK:STDOUT: %.loc24_26.2: type = value_of_initializer %float.make_type.loc24_26 [template = f64] -// CHECK:STDOUT: %.loc24_26.3: type = converted %float.make_type.loc24_26, %.loc24_26.2 [template = f64] +// CHECK:STDOUT: %.loc24_33.1: type = splice_block %.loc24_33.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_33: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_33: init type = call constants.%Float(%int_64.loc24_33) [template = f64] +// CHECK:STDOUT: %.loc24_33.2: type = value_of_initializer %float.make_type.loc24_33 [template = f64] +// CHECK:STDOUT: %.loc24_33.3: type = converted %float.make_type.loc24_33, %.loc24_33.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc24_34.1: type = splice_block %.loc24_34.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_34: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_34: init type = call constants.%Float(%int_64.loc24_34) [template = f64] -// CHECK:STDOUT: %.loc24_34.2: type = value_of_initializer %float.make_type.loc24_34 [template = f64] -// CHECK:STDOUT: %.loc24_34.3: type = converted %float.make_type.loc24_34, %.loc24_34.2 [template = f64] +// CHECK:STDOUT: %.loc24_41.1: type = splice_block %.loc24_41.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_41: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_41: init type = call constants.%Float(%int_64.loc24_41) [template = f64] +// CHECK:STDOUT: %.loc24_41.2: type = value_of_initializer %float.make_type.loc24_41 [template = f64] +// CHECK:STDOUT: %.loc24_41.3: type = converted %float.make_type.loc24_41, %.loc24_41.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %c.param: f64 = value_param runtime_param2 -// CHECK:STDOUT: %.loc24_42.1: type = splice_block %.loc24_42.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc24_42: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc24_42: init type = call constants.%Float(%int_64.loc24_42) [template = f64] -// CHECK:STDOUT: %.loc24_42.2: type = value_of_initializer %float.make_type.loc24_42 [template = f64] -// CHECK:STDOUT: %.loc24_42.3: type = converted %float.make_type.loc24_42, %.loc24_42.2 [template = f64] +// CHECK:STDOUT: %.loc24_49.1: type = splice_block %.loc24_49.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc24_49: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc24_49: init type = call constants.%Float(%int_64.loc24_49) [template = f64] +// CHECK:STDOUT: %.loc24_49.2: type = value_of_initializer %float.make_type.loc24_49 [template = f64] +// CHECK:STDOUT: %.loc24_49.3: type = converted %float.make_type.loc24_49, %.loc24_49.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %c: f64 = bind_name c, %c.param // CHECK:STDOUT: %return.param: ref f64 = out_param runtime_param3 // CHECK:STDOUT: %return: ref f64 = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { +// CHECK:STDOUT: %RuntimeCallIsValidBadReturnType.decl: %RuntimeCallIsValidBadReturnType.type = fn_decl @RuntimeCallIsValidBadReturnType [template = constants.%RuntimeCallIsValidBadReturnType] { // CHECK:STDOUT: %a.patt: f64 = binding_pattern a // CHECK:STDOUT: %a.param_patt: f64 = value_param_pattern %a.patt, runtime_param0 // CHECK:STDOUT: %b.patt: f64 = binding_pattern b @@ -409,22 +409,22 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 // CHECK:STDOUT: } { // CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc28_48.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc28_48.2: type = converted %bool.make_type, %.loc28_48.1 [template = bool] +// CHECK:STDOUT: %.loc28_55.1: type = value_of_initializer %bool.make_type [template = bool] +// CHECK:STDOUT: %.loc28_55.2: type = converted %bool.make_type, %.loc28_55.1 [template = bool] // CHECK:STDOUT: %a.param: f64 = value_param runtime_param0 -// CHECK:STDOUT: %.loc28_32.1: type = splice_block %.loc28_32.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_32: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_32: init type = call constants.%Float(%int_64.loc28_32) [template = f64] -// CHECK:STDOUT: %.loc28_32.2: type = value_of_initializer %float.make_type.loc28_32 [template = f64] -// CHECK:STDOUT: %.loc28_32.3: type = converted %float.make_type.loc28_32, %.loc28_32.2 [template = f64] +// CHECK:STDOUT: %.loc28_39.1: type = splice_block %.loc28_39.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_39: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_39: init type = call constants.%Float(%int_64.loc28_39) [template = f64] +// CHECK:STDOUT: %.loc28_39.2: type = value_of_initializer %float.make_type.loc28_39 [template = f64] +// CHECK:STDOUT: %.loc28_39.3: type = converted %float.make_type.loc28_39, %.loc28_39.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %a: f64 = bind_name a, %a.param // CHECK:STDOUT: %b.param: f64 = value_param runtime_param1 -// CHECK:STDOUT: %.loc28_40.1: type = splice_block %.loc28_40.3 [template = f64] { -// CHECK:STDOUT: %int_64.loc28_40: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %float.make_type.loc28_40: init type = call constants.%Float(%int_64.loc28_40) [template = f64] -// CHECK:STDOUT: %.loc28_40.2: type = value_of_initializer %float.make_type.loc28_40 [template = f64] -// CHECK:STDOUT: %.loc28_40.3: type = converted %float.make_type.loc28_40, %.loc28_40.2 [template = f64] +// CHECK:STDOUT: %.loc28_47.1: type = splice_block %.loc28_47.3 [template = f64] { +// CHECK:STDOUT: %int_64.loc28_47: Core.IntLiteral = int_value 64 [template = constants.%int_64] +// CHECK:STDOUT: %float.make_type.loc28_47: init type = call constants.%Float(%int_64.loc28_47) [template = f64] +// CHECK:STDOUT: %.loc28_47.2: type = value_of_initializer %float.make_type.loc28_47 [template = f64] +// CHECK:STDOUT: %.loc28_47.3: type = converted %float.make_type.loc28_47, %.loc28_47.2 [template = f64] // CHECK:STDOUT: } // CHECK:STDOUT: %b: f64 = bind_name b, %b.param // CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 @@ -440,7 +440,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: // CHECK:STDOUT: fn @JustRight(%a.param_patt: f64, %b.param_patt: f64) -> f64 = "float.sub"; // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValidTooFew(%a.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -450,7 +450,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc21_19.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { +// CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param_patt: f64, %b.param_patt: f64, %c.param_patt: f64) -> f64 { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a @@ -462,7 +462,7 @@ fn RuntimeCallBadReturnType(a: f64, b: f64) -> bool { // CHECK:STDOUT: return %.loc25_26.2 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { +// CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param_patt: f64, %b.param_patt: f64) -> bool { // CHECK:STDOUT: !entry: // CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] // CHECK:STDOUT: %a.ref: f64 = name_ref a, %a diff --git a/toolchain/check/testdata/builtins/int/and.carbon b/toolchain/check/testdata/builtins/int/and.carbon index 11a19c0b6943a..325f6f0ff821d 100644 --- a/toolchain/check/testdata/builtins/int/and.carbon +++ b/toolchain/check/testdata/builtins/int/and.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/and.carbon @@ -15,114 +17,6 @@ fn And(a: i32, b: i32) -> i32 = "int.and"; var arr: [i32; And(12, 10)]; let arr_p: [i32; 8]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return And(a, b); } - -// CHECK:STDOUT: --- int_and.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: %And.type: type = fn_type @And [template] -// CHECK:STDOUT: %And: %And.type = struct_value () [template] -// CHECK:STDOUT: %int_8.2: Core.IntLiteral = int_value 8 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_8.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .And = %And.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @And(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.and"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %And.ref: %And.type = name_ref And, file.%And.decl [template = constants.%And] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.and: init %i32 = call %And.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.and -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.and, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/complement.carbon b/toolchain/check/testdata/builtins/int/complement.carbon index ee858a1a98150..ddcb047d88f73 100644 --- a/toolchain/check/testdata/builtins/int/complement.carbon +++ b/toolchain/check/testdata/builtins/int/complement.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/complement.carbon @@ -16,127 +18,6 @@ fn And(a: i32, b: i32) -> i32 = "int.and"; var arr: [i32; And(Complement(0x123456), 0xFFFFFF)]; let arr_p: [i32; 0xEDCBA9]* = &arr; -fn RuntimeCall(a: i32) -> i32 { +fn RuntimeCallIsValid(a: i32) -> i32 { return Complement(a); } - -// CHECK:STDOUT: --- int_complement.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: %Complement.type: type = fn_type @Complement [template] -// CHECK:STDOUT: %Complement: %Complement.type = struct_value () [template] -// CHECK:STDOUT: %And.type: type = fn_type @And [template] -// CHECK:STDOUT: %And: %And.type = struct_value () [template] -// CHECK:STDOUT: %int_15584169.2: Core.IntLiteral = int_value 15584169 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_15584169.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Complement = %Complement.decl -// CHECK:STDOUT: .And = %And.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Complement.decl: %Complement.type = fn_decl @Complement [template = constants.%Complement] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2: type = splice_block %i32.loc2_18 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %And.decl: %And.type = fn_decl @And [template = constants.%And] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc3_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc3_11: type = splice_block %i32.loc3_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc3_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc3_19: type = splice_block %i32.loc3_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc3_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc8_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc8: type = splice_block %i32.loc8_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc8_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Complement(%a.param_patt: %i32) -> %i32 = "int.complement"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @And(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.and"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Complement.ref: %Complement.type = name_ref Complement, file.%Complement.decl [template = constants.%Complement] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %int.complement: init %i32 = call %Complement.ref(%a.ref) -// CHECK:STDOUT: %.loc9_23.1: %i32 = value_of_initializer %int.complement -// CHECK:STDOUT: %.loc9_23.2: %i32 = converted %int.complement, %.loc9_23.1 -// CHECK:STDOUT: return %.loc9_23.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/convert_checked.carbon b/toolchain/check/testdata/builtins/int/convert_checked.carbon index 5212383db342b..ec0a6a84f18f9 100644 --- a/toolchain/check/testdata/builtins/int/convert_checked.carbon +++ b/toolchain/check/testdata/builtins/int/convert_checked.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/convert_checked.carbon @@ -247,2724 +249,3 @@ let convert_not_constant_same: i32 = Int32ToInt32(not_constant); // CHECK:STDERR: fn Int32ToInt64(a: i32) -> i64 = "int.convert_checked"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ let convert_not_constant_widen: i64 = Int32ToInt64(not_constant); - -// CHECK:STDOUT: --- int_ops.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: %NegateI32.type: type = fn_type @NegateI32 [template] -// CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] -// CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] -// CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] -// CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template] -// CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %Int32ToInt32.type: type = fn_type @Int32ToInt32 [template] -// CHECK:STDOUT: %Int32ToInt32: %Int32ToInt32.type = struct_value () [template] -// CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] -// CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %Uint32ToInt32.type: type = fn_type @Uint32ToInt32 [template] -// CHECK:STDOUT: %Uint32ToInt32: %Uint32ToInt32.type = struct_value () [template] -// CHECK:STDOUT: %Uint32ToUint32.type: type = fn_type @Uint32ToUint32 [template] -// CHECK:STDOUT: %Uint32ToUint32: %Uint32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %IntLiteralToIntLiteral.type: type = fn_type @IntLiteralToIntLiteral [template] -// CHECK:STDOUT: %IntLiteralToIntLiteral: %IntLiteralToIntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] -// CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] -// CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template] -// CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] -// CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.type = struct_value () [template] -// CHECK:STDOUT: %Uint32ToInt16.type: type = fn_type @Uint32ToInt16 [template] -// CHECK:STDOUT: %Uint32ToInt16: %Uint32ToInt16.type = struct_value () [template] -// CHECK:STDOUT: %Uint32ToUint16.type: type = fn_type @Uint32ToUint16 [template] -// CHECK:STDOUT: %Uint32ToUint16: %Uint32ToUint16.type = struct_value () [template] -// CHECK:STDOUT: %IntLiteralToInt16.type: type = fn_type @IntLiteralToInt16 [template] -// CHECK:STDOUT: %IntLiteralToInt16: %IntLiteralToInt16.type = struct_value () [template] -// CHECK:STDOUT: %IntLiteralToUint16.type: type = fn_type @IntLiteralToUint16 [template] -// CHECK:STDOUT: %IntLiteralToUint16: %IntLiteralToUint16.type = struct_value () [template] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template] -// CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template] -// CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template] -// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template] -// CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template] -// CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.type = struct_value () [template] -// CHECK:STDOUT: %Uint32ToInt64.type: type = fn_type @Uint32ToInt64 [template] -// CHECK:STDOUT: %Uint32ToInt64: %Uint32ToInt64.type = struct_value () [template] -// CHECK:STDOUT: %Uint32ToUint64.type: type = fn_type @Uint32ToUint64 [template] -// CHECK:STDOUT: %Uint32ToUint64: %Uint32ToUint64.type = struct_value () [template] -// CHECK:STDOUT: %Int32ToIntLiteral.type: type = fn_type @Int32ToIntLiteral [template] -// CHECK:STDOUT: %Int32ToIntLiteral: %Int32ToIntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %Uint32ToUintLiteral.type: type = fn_type @Uint32ToUintLiteral [template] -// CHECK:STDOUT: %Uint32ToUintLiteral: %Uint32ToUintLiteral.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .UInt = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .NegateI32 = %NegateI32.decl -// CHECK:STDOUT: .SubI32 = %SubI32.decl -// CHECK:STDOUT: .AddU32 = %AddU32.decl -// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl -// CHECK:STDOUT: .Int32ToInt32 = %Int32ToInt32.decl -// CHECK:STDOUT: .Int32ToUint32 = %Int32ToUint32.decl -// CHECK:STDOUT: .Uint32ToInt32 = %Uint32ToInt32.decl -// CHECK:STDOUT: .Uint32ToUint32 = %Uint32ToUint32.decl -// CHECK:STDOUT: .IntLiteralToIntLiteral = %IntLiteralToIntLiteral.decl -// CHECK:STDOUT: .Int32ToInt16 = %Int32ToInt16.decl -// CHECK:STDOUT: .Int32ToUint16 = %Int32ToUint16.decl -// CHECK:STDOUT: .Uint32ToInt16 = %Uint32ToInt16.decl -// CHECK:STDOUT: .Uint32ToUint16 = %Uint32ToUint16.decl -// CHECK:STDOUT: .IntLiteralToInt16 = %IntLiteralToInt16.decl -// CHECK:STDOUT: .IntLiteralToUint16 = %IntLiteralToUint16.decl -// CHECK:STDOUT: .Int32ToInt64 = %Int32ToInt64.decl -// CHECK:STDOUT: .Int32ToUint64 = %Int32ToUint64.decl -// CHECK:STDOUT: .Uint32ToInt64 = %Uint32ToInt64.decl -// CHECK:STDOUT: .Uint32ToUint64 = %Uint32ToUint64.decl -// CHECK:STDOUT: .Int32ToIntLiteral = %Int32ToIntLiteral.decl -// CHECK:STDOUT: .Uint32ToUintLiteral = %Uint32ToUintLiteral.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %NegateI32.decl: %NegateI32.type = fn_decl @NegateI32 [template = constants.%NegateI32] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4: type = splice_block %i32.loc4_17 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %SubI32.decl: %SubI32.type = fn_decl @SubI32 [template = constants.%SubI32] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_30: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc5_14: type = splice_block %i32.loc5_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc5_22: type = splice_block %i32.loc5_22 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %AddU32.decl: %AddU32.type = fn_decl @AddU32 [template = constants.%AddU32] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %u32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %u32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc6_30: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc6_14: type = splice_block %u32.loc6_14 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc6_14: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %u32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc6_22: type = splice_block %u32.loc6_22 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc6_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %u32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { -// CHECK:STDOUT: %return.patt: type = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Int32ToInt32.decl: %Int32ToInt32.type = fn_decl @Int32ToInt32 [template = constants.%Int32ToInt32] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc10_28: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc10: type = splice_block %i32.loc10_20 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc10_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Int32ToUint32.decl: %Int32ToUint32.type = fn_decl @Int32ToUint32 [template = constants.%Int32ToUint32] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc11_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc11: type = splice_block %i32 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc11_21: 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: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Uint32ToInt32.decl: %Uint32ToInt32.type = fn_decl @Uint32ToInt32 [template = constants.%Uint32ToInt32] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc12_29: 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: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc12: type = splice_block %u32 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc12_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Uint32ToUint32.decl: %Uint32ToUint32.type = fn_decl @Uint32ToUint32 [template = constants.%Uint32ToUint32] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_30: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc13_30: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc13: type = splice_block %u32.loc13_22 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc13_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc13_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %IntLiteralToIntLiteral.decl: %IntLiteralToIntLiteral.type = fn_decl @IntLiteralToIntLiteral [template = constants.%IntLiteralToIntLiteral] { -// CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a -// CHECK:STDOUT: %a.param_patt: Core.IntLiteral = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref.loc14_47: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type.loc14_58: init type = call %IntLiteral.ref.loc14_47() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_58.1: type = value_of_initializer %int_literal.make_type.loc14_58 [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_58.2: type = converted %int_literal.make_type.loc14_58, %.loc14_58.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 -// CHECK:STDOUT: %.loc14_41.1: type = splice_block %.loc14_41.3 [template = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref.loc14_30: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type.loc14_41: init type = call %IntLiteral.ref.loc14_30() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_41.2: type = value_of_initializer %int_literal.make_type.loc14_41 [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_41.3: type = converted %int_literal.make_type.loc14_41, %.loc14_41.2 [template = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 -// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Int32ToInt16.decl: %Int32ToInt16.type = fn_decl @Int32ToInt16 [template = constants.%Int32ToInt16] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc18: 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: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i16 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Int32ToUint16.decl: %Int32ToUint16.type = fn_decl @Int32ToUint16 [template = constants.%Int32ToUint16] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc19: 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: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u16 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Uint32ToInt16.decl: %Uint32ToInt16.type = fn_decl @Uint32ToInt16 [template = constants.%Uint32ToInt16] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc20: type = splice_block %u32 [template = constants.%u32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i16 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Uint32ToUint16.decl: %Uint32ToUint16.type = fn_decl @Uint32ToUint16 [template = constants.%Uint32ToUint16] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc21: type = splice_block %u32 [template = constants.%u32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u16 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %IntLiteralToInt16.decl: %IntLiteralToInt16.type = fn_decl @IntLiteralToInt16 [template = constants.%IntLiteralToInt16] { -// CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a -// CHECK:STDOUT: %a.param_patt: Core.IntLiteral = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i16 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i16 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(constants.%int_16) [template = constants.%i16] -// CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 -// CHECK:STDOUT: %.loc22_36.1: type = splice_block %.loc22_36.3 [template = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc22_36.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc22_36.3: type = converted %int_literal.make_type, %.loc22_36.2 [template = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i16 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i16 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %IntLiteralToUint16.decl: %IntLiteralToUint16.type = fn_decl @IntLiteralToUint16 [template = constants.%IntLiteralToUint16] { -// CHECK:STDOUT: %a.patt: Core.IntLiteral = binding_pattern a -// CHECK:STDOUT: %a.param_patt: Core.IntLiteral = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u16 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u16 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template = constants.%int_16] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(constants.%int_16) [template = constants.%u16] -// CHECK:STDOUT: %a.param: Core.IntLiteral = value_param runtime_param0 -// CHECK:STDOUT: %.loc23_37.1: type = splice_block %.loc23_37.3 [template = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc23_37.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc23_37.3: type = converted %int_literal.make_type, %.loc23_37.2 [template = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: Core.IntLiteral = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %u16 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u16 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Int32ToInt64.decl: %Int32ToInt64.type = fn_decl @Int32ToInt64 [template = constants.%Int32ToInt64] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc26: 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: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i64 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Int32ToUint64.decl: %Int32ToUint64.type = fn_decl @Int32ToUint64 [template = constants.%Int32ToUint64] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u64 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc27: 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: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u64 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Uint32ToInt64.decl: %Uint32ToInt64.type = fn_decl @Uint32ToInt64 [template = constants.%Uint32ToInt64] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i64 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i64 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %i64: type = class_type @Int, @Int(constants.%int_64) [template = constants.%i64] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc28: type = splice_block %u32 [template = constants.%u32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i64 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i64 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Uint32ToUint64.decl: %Uint32ToUint64.type = fn_decl @Uint32ToUint64 [template = constants.%Uint32ToUint64] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u64 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u64 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(constants.%int_64) [template = constants.%u64] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc29: type = splice_block %u32 [template = constants.%u32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %u64 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u64 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Int32ToIntLiteral.decl: %Int32ToIntLiteral.type = fn_decl @Int32ToIntLiteral [template = constants.%Int32ToIntLiteral] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc30_44.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc30_44.2: type = converted %int_literal.make_type, %.loc30_44.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc30_25: 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: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 -// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Uint32ToUintLiteral.decl: %Uint32ToUintLiteral.type = fn_decl @Uint32ToUintLiteral [template = constants.%Uint32ToUintLiteral] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: Core.IntLiteral = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: Core.IntLiteral = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc31_46.1: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc31_46.2: type = converted %int_literal.make_type, %.loc31_46.1 [template = Core.IntLiteral] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc31_27: type = splice_block %u32 [template = constants.%u32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref Core.IntLiteral = out_param runtime_param1 -// CHECK:STDOUT: %return: ref Core.IntLiteral = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @AddU32(%a.param_patt: %u32, %b.param_patt: %u32) -> %u32 = "int.uadd"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: %i32) -> %i32 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %u32) -> %i32 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint32(%a.param_patt: %u32) -> %u32 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteralToIntLiteral(%a.param_patt: Core.IntLiteral) -> Core.IntLiteral = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %u32) -> %i16 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %u32) -> %u16 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteralToInt16(%a.param_patt: Core.IntLiteral) -> %i16 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteralToUint16(%a.param_patt: Core.IntLiteral) -> %u16 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: %i32) -> %i64 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt64(%a.param_patt: %u32) -> %i64 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint64(%a.param_patt: %u32) -> %u64 = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUintLiteral(%a.param_patt: %u32) -> Core.IntLiteral = "int.convert_checked"; -// CHECK:STDOUT: -// CHECK:STDOUT: --- identity.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: %Int32ToInt32.type: type = fn_type @Int32ToInt32 [template] -// CHECK:STDOUT: %Int32ToInt32: %Int32ToInt32.type = struct_value () [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] -// CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] -// CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template] -// CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] -// CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %IntLiteralToIntLiteral.type: type = fn_type @IntLiteralToIntLiteral [template] -// CHECK:STDOUT: %IntLiteralToIntLiteral: %IntLiteralToIntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %Int32ToIntLiteral.type: type = fn_type @Int32ToIntLiteral [template] -// CHECK:STDOUT: %Int32ToIntLiteral: %Int32ToIntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %int_-1.2: Core.IntLiteral = int_value -1 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4: %IntLiteral.type = import_ref Main//int_ops, IntLiteral, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, Int32ToInt32, loaded [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9: %IntLiteralToIntLiteral.type = import_ref Main//int_ops, IntLiteralToIntLiteral, loaded [template = constants.%IntLiteralToIntLiteral] -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, Int32ToIntLiteral, loaded [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.26 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: .d = @__global_init.%d -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: %i32) -> %i32 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteralToIntLiteral(%a.param_patt: Core.IntLiteral) -> Core.IntLiteral = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32ToInt32.ref.loc5: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0, %impl.elem0.loc5 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc5_27: init %i32 = call %Convert.specific_fn.loc5(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_27.1: %i32 = value_of_initializer %int.convert_checked.loc5_27 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_27.2: %i32 = converted %int_0, %.loc5_27.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %Int32ToInt32.ref.loc5(%.loc5_27.2) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_29.1: %i32 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_29.2: %i32 = converted %int.convert_checked.loc5_28, %.loc5_29.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc5_29.2 -// CHECK:STDOUT: %Int32ToInt32.ref.loc6: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc6_27: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_27.1: %i32 = value_of_initializer %int.convert_checked.loc6_27 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_27.2: %i32 = converted %int_2147483647.loc6, %.loc6_27.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.convert_checked.loc6_38: init %i32 = call %Int32ToInt32.ref.loc6(%.loc6_27.2) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_39.1: %i32 = value_of_initializer %int.convert_checked.loc6_38 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_39.2: %i32 = converted %int.convert_checked.loc6_38, %.loc6_39.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc6_39.2 -// CHECK:STDOUT: %Int32ToInt32.ref.loc7: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] -// CHECK:STDOUT: %NegateI32.ref.loc7: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] -// CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc7_44: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_44: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_44 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc7_44: = specific_function %Convert.bound.loc7_44, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc7_44: init %i32 = call %Convert.specific_fn.loc7_44(%int_2147483647.loc7) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc7_44.1: %i32 = value_of_initializer %int.convert_checked.loc7_44 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc7_44.2: %i32 = converted %int_2147483647.loc7, %.loc7_44.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.snegate.loc7: init %i32 = call %NegateI32.ref.loc7(%.loc7_44.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1.loc7: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc7_55.1: %i32 = value_of_initializer %int.snegate.loc7 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc7_55.2: %i32 = converted %int.snegate.loc7, %.loc7_55.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc7_58: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_58: = bound_method %int_1.loc7, %impl.elem0.loc7_58 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc7_58: = specific_function %Convert.bound.loc7_58, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc7_58: init %i32 = call %Convert.specific_fn.loc7_58(%int_1.loc7) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc7_58.1: %i32 = value_of_initializer %int.convert_checked.loc7_58 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc7_58.2: %i32 = converted %int_1.loc7, %.loc7_58.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc7_55.2, %.loc7_58.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc7_59.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc7_59.2: %i32 = converted %int.ssub, %.loc7_59.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %int.convert_checked.loc7_60: init %i32 = call %Int32ToInt32.ref.loc7(%.loc7_59.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc7_61.1: %i32 = value_of_initializer %int.convert_checked.loc7_60 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc7_61.2: %i32 = converted %int.convert_checked.loc7_60, %.loc7_61.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc7_61.2 -// CHECK:STDOUT: %IntLiteralToIntLiteral.ref: %IntLiteralToIntLiteral.type = name_ref IntLiteralToIntLiteral, imports.%import_ref.9 [template = constants.%IntLiteralToIntLiteral] -// CHECK:STDOUT: %Int32ToIntLiteral.ref: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %NegateI32.ref.loc8: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] -// CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_1.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc8_74: init %i32 = call %Convert.specific_fn.loc8(%int_1.loc8) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_74.1: %i32 = value_of_initializer %int.convert_checked.loc8_74 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_74.2: %i32 = converted %int_1.loc8, %.loc8_74.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc8: init %i32 = call %NegateI32.ref.loc8(%.loc8_74.2) [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc8_75.1: %i32 = value_of_initializer %int.snegate.loc8 [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc8_75.2: %i32 = converted %int.snegate.loc8, %.loc8_75.1 [template = constants.%int_-1.1] -// CHECK:STDOUT: %int.convert_checked.loc8_76: init Core.IntLiteral = call %Int32ToIntLiteral.ref(%.loc8_75.2) [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc8_76.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc8_76 [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc8_76.2: Core.IntLiteral = converted %int.convert_checked.loc8_76, %.loc8_76.1 [template = constants.%int_-1.2] -// CHECK:STDOUT: %int.convert_checked.loc8_77: init Core.IntLiteral = call %IntLiteralToIntLiteral.ref(%.loc8_76.2) [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc8_78.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc8_77 [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc8_78.2: Core.IntLiteral = converted %int.convert_checked.loc8_77, %.loc8_78.1 [template = constants.%int_-1.2] -// CHECK:STDOUT: %d: Core.IntLiteral = bind_name d, %.loc8_78.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- same_size.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] -// CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] -// CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_2147483647.3: %u32 = int_value 2147483647 [template] -// CHECK:STDOUT: %Uint32ToInt32.type: type = fn_type @Uint32ToInt32 [template] -// CHECK:STDOUT: %Uint32ToInt32: %Uint32ToInt32.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, Uint32ToInt32, loaded [template = constants.%Uint32ToInt32] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.29 -// CHECK:STDOUT: .Int = %import_ref.217 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .max = @__global_init.%max -// CHECK:STDOUT: .max_roundtrip = @__global_init.%max_roundtrip -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %u32) -> %i32 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32ToUint32.ref.loc5: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_2147483647.loc5: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_2147483647.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc5_30: init %i32 = call %Convert.specific_fn.loc5(%int_2147483647.loc5) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc5_30.1: %i32 = value_of_initializer %int.convert_checked.loc5_30 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc5_30.2: %i32 = converted %int_2147483647.loc5, %.loc5_30.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.convert_checked.loc5_41: init %u32 = call %Int32ToUint32.ref.loc5(%.loc5_30.2) [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc5_42.1: %u32 = value_of_initializer %int.convert_checked.loc5_41 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc5_42.2: %u32 = converted %int.convert_checked.loc5_41, %.loc5_42.1 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %max: %u32 = bind_name max, %.loc5_42.2 -// CHECK:STDOUT: %Uint32ToInt32.ref: %Uint32ToInt32.type = name_ref Uint32ToInt32, imports.%import_ref.7 [template = constants.%Uint32ToInt32] -// CHECK:STDOUT: %Int32ToUint32.ref.loc6: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc6_54: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_54.1: %i32 = value_of_initializer %int.convert_checked.loc6_54 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_54.2: %i32 = converted %int_2147483647.loc6, %.loc6_54.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.convert_checked.loc6_65: init %u32 = call %Int32ToUint32.ref.loc6(%.loc6_54.2) [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc6_65.1: %u32 = value_of_initializer %int.convert_checked.loc6_65 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc6_65.2: %u32 = converted %int.convert_checked.loc6_65, %.loc6_65.1 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %int.convert_checked.loc6_66: init %i32 = call %Uint32ToInt32.ref(%.loc6_65.2) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_67.1: %i32 = value_of_initializer %int.convert_checked.loc6_66 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_67.2: %i32 = converted %int.convert_checked.loc6_66, %.loc6_67.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %max_roundtrip: %i32 = bind_name max_roundtrip, %.loc6_67.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- truncate.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template] -// CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] -// CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.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: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_0.3: %u16 = int_value 0 [template] -// CHECK:STDOUT: %int_65535.1: Core.IntLiteral = int_value 65535 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_65535.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_65535.2: %i32 = int_value 65535 [template] -// CHECK:STDOUT: %int_65535.3: %u16 = int_value 65535 [template] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] -// CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] -// CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] -// CHECK:STDOUT: %int_32767.1: Core.IntLiteral = int_value 32767 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32767.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_32767.2: %i32 = int_value 32767 [template] -// CHECK:STDOUT: %int_32767.3: %i16 = int_value 32767 [template] -// CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template] -// CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] -// CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_32768.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] -// CHECK:STDOUT: %int_-32768.1: %i32 = int_value -32768 [template] -// CHECK:STDOUT: %int_-32768.2: %i16 = int_value -32768 [template] -// CHECK:STDOUT: %Uint32ToUint16.type: type = fn_type @Uint32ToUint16 [template] -// CHECK:STDOUT: %Uint32ToUint16: %Uint32ToUint16.type = struct_value () [template] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] -// CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] -// CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %int_0.4: %u32 = int_value 0 [template] -// CHECK:STDOUT: %int_65535.4: %u32 = int_value 65535 [template] -// CHECK:STDOUT: %Uint32ToInt16.type: type = fn_type @Uint32ToInt16 [template] -// CHECK:STDOUT: %Uint32ToInt16: %Uint32ToInt16.type = struct_value () [template] -// CHECK:STDOUT: %int_0.5: %i16 = int_value 0 [template] -// CHECK:STDOUT: %int_32767.4: %u32 = int_value 32767 [template] -// CHECK:STDOUT: %IntLiteralToInt16.type: type = fn_type @IntLiteralToInt16 [template] -// CHECK:STDOUT: %IntLiteralToInt16: %IntLiteralToInt16.type = struct_value () [template] -// CHECK:STDOUT: %Int32ToIntLiteral.type: type = fn_type @Int32ToIntLiteral [template] -// CHECK:STDOUT: %Int32ToIntLiteral: %Int32ToIntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %int_-32768.3: Core.IntLiteral = int_value -32768 [template] -// CHECK:STDOUT: %IntLiteralToUint16.type: type = fn_type @IntLiteralToUint16 [template] -// CHECK:STDOUT: %IntLiteralToUint16: %IntLiteralToUint16.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, Int32ToUint16, loaded [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, Uint32ToInt16, loaded [template = constants.%Uint32ToInt16] -// CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, Uint32ToUint16, loaded [template = constants.%Uint32ToUint16] -// CHECK:STDOUT: %import_ref.14: %IntLiteralToInt16.type = import_ref Main//int_ops, IntLiteralToInt16, loaded [template = constants.%IntLiteralToInt16] -// CHECK:STDOUT: %import_ref.15: %IntLiteralToUint16.type = import_ref Main//int_ops, IntLiteralToUint16, loaded [template = constants.%IntLiteralToUint16] -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20: %Int32ToIntLiteral.type = import_ref Main//int_ops, Int32ToIntLiteral, loaded [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.29 -// CHECK:STDOUT: .Int = %import_ref.217 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: .d = @__global_init.%d -// CHECK:STDOUT: .e = @__global_init.%e -// CHECK:STDOUT: .f = @__global_init.%f -// CHECK:STDOUT: .g = @__global_init.%g -// CHECK:STDOUT: .h = @__global_init.%h -// CHECK:STDOUT: .lit_i16_min = @__global_init.%lit_i16_min -// CHECK:STDOUT: .lit_i16_max = @__global_init.%lit_i16_max -// CHECK:STDOUT: .lit_u16_min = @__global_init.%lit_u16_min -// CHECK:STDOUT: .lit_u16_max = @__global_init.%lit_u16_max -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %u32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %u32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteralToInt16(%a.param_patt: Core.IntLiteral) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToIntLiteral(%a.param_patt: %i32) -> Core.IntLiteral = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteralToUint16(%a.param_patt: Core.IntLiteral) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32ToUint16.ref.loc5: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %int_0.loc5: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %Convert.specific_fn.loc5(%int_0.loc5) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_28.1: %i32 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_28.2: %i32 = converted %int_0.loc5, %.loc5_28.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.convert_checked.loc5_29: init %u16 = call %Int32ToUint16.ref.loc5(%.loc5_28.2) [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc5_30.1: %u16 = value_of_initializer %int.convert_checked.loc5_29 [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc5_30.2: %u16 = converted %int.convert_checked.loc5_29, %.loc5_30.1 [template = constants.%int_0.3] -// CHECK:STDOUT: %a: %u16 = bind_name a, %.loc5_30.2 -// CHECK:STDOUT: %Int32ToUint16.ref.loc6: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %int_65535.loc6: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_65535.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6(%int_65535.loc6) [template = constants.%int_65535.2] -// CHECK:STDOUT: %.loc6_28.1: %i32 = value_of_initializer %int.convert_checked.loc6_28 [template = constants.%int_65535.2] -// CHECK:STDOUT: %.loc6_28.2: %i32 = converted %int_65535.loc6, %.loc6_28.1 [template = constants.%int_65535.2] -// CHECK:STDOUT: %int.convert_checked.loc6_34: init %u16 = call %Int32ToUint16.ref.loc6(%.loc6_28.2) [template = constants.%int_65535.3] -// CHECK:STDOUT: %.loc6_35.1: %u16 = value_of_initializer %int.convert_checked.loc6_34 [template = constants.%int_65535.3] -// CHECK:STDOUT: %.loc6_35.2: %u16 = converted %int.convert_checked.loc6_34, %.loc6_35.1 [template = constants.%int_65535.3] -// CHECK:STDOUT: %b: %u16 = bind_name b, %.loc6_35.2 -// CHECK:STDOUT: %Int32ToInt16.ref.loc8: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %int_32767.loc8: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_32767.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc8_27: init %i32 = call %Convert.specific_fn.loc8(%int_32767.loc8) [template = constants.%int_32767.2] -// CHECK:STDOUT: %.loc8_27.1: %i32 = value_of_initializer %int.convert_checked.loc8_27 [template = constants.%int_32767.2] -// CHECK:STDOUT: %.loc8_27.2: %i32 = converted %int_32767.loc8, %.loc8_27.1 [template = constants.%int_32767.2] -// CHECK:STDOUT: %int.convert_checked.loc8_33: init %i16 = call %Int32ToInt16.ref.loc8(%.loc8_27.2) [template = constants.%int_32767.3] -// CHECK:STDOUT: %.loc8_34.1: %i16 = value_of_initializer %int.convert_checked.loc8_33 [template = constants.%int_32767.3] -// CHECK:STDOUT: %.loc8_34.2: %i16 = converted %int.convert_checked.loc8_33, %.loc8_34.1 [template = constants.%int_32767.3] -// CHECK:STDOUT: %c: %i16 = bind_name c, %.loc8_34.2 -// CHECK:STDOUT: %Int32ToInt16.ref.loc9: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %NegateI32.ref.loc9: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] -// CHECK:STDOUT: %int_32768.loc9: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_32768.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] -// CHECK:STDOUT: %int.convert_checked.loc9_37: init %i32 = call %Convert.specific_fn.loc9(%int_32768.loc9) [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc9_37.1: %i32 = value_of_initializer %int.convert_checked.loc9_37 [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc9_37.2: %i32 = converted %int_32768.loc9, %.loc9_37.1 [template = constants.%int_32768.2] -// CHECK:STDOUT: %int.snegate.loc9: init %i32 = call %NegateI32.ref.loc9(%.loc9_37.2) [template = constants.%int_-32768.1] -// CHECK:STDOUT: %.loc9_43.1: %i32 = value_of_initializer %int.snegate.loc9 [template = constants.%int_-32768.1] -// CHECK:STDOUT: %.loc9_43.2: %i32 = converted %int.snegate.loc9, %.loc9_43.1 [template = constants.%int_-32768.1] -// CHECK:STDOUT: %int.convert_checked.loc9_44: init %i16 = call %Int32ToInt16.ref.loc9(%.loc9_43.2) [template = constants.%int_-32768.2] -// CHECK:STDOUT: %.loc9_45.1: %i16 = value_of_initializer %int.convert_checked.loc9_44 [template = constants.%int_-32768.2] -// CHECK:STDOUT: %.loc9_45.2: %i16 = converted %int.convert_checked.loc9_44, %.loc9_45.1 [template = constants.%int_-32768.2] -// CHECK:STDOUT: %d: %i16 = bind_name d, %.loc9_45.2 -// CHECK:STDOUT: %Uint32ToUint16.ref.loc11: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] -// CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_0.loc11, %impl.elem0.loc11 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc11_43: init %i32 = call %Convert.specific_fn.loc11(%int_0.loc11) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_43.1: %i32 = value_of_initializer %int.convert_checked.loc11_43 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_43.2: %i32 = converted %int_0.loc11, %.loc11_43.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.convert_checked.loc11_44: init %u32 = call %Int32ToUint32.ref.loc11(%.loc11_43.2) [template = constants.%int_0.4] -// CHECK:STDOUT: %.loc11_44.1: %u32 = value_of_initializer %int.convert_checked.loc11_44 [template = constants.%int_0.4] -// CHECK:STDOUT: %.loc11_44.2: %u32 = converted %int.convert_checked.loc11_44, %.loc11_44.1 [template = constants.%int_0.4] -// CHECK:STDOUT: %int.convert_checked.loc11_45: init %u16 = call %Uint32ToUint16.ref.loc11(%.loc11_44.2) [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc11_46.1: %u16 = value_of_initializer %int.convert_checked.loc11_45 [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc11_46.2: %u16 = converted %int.convert_checked.loc11_45, %.loc11_46.1 [template = constants.%int_0.3] -// CHECK:STDOUT: %e: %u16 = bind_name e, %.loc11_46.2 -// CHECK:STDOUT: %Uint32ToUint16.ref.loc12: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] -// CHECK:STDOUT: %Int32ToUint32.ref.loc12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_65535.loc12: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_65535.loc12, %impl.elem0.loc12 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12(%int_65535.loc12) [template = constants.%int_65535.2] -// CHECK:STDOUT: %.loc12_43.1: %i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%int_65535.2] -// CHECK:STDOUT: %.loc12_43.2: %i32 = converted %int_65535.loc12, %.loc12_43.1 [template = constants.%int_65535.2] -// CHECK:STDOUT: %int.convert_checked.loc12_49: init %u32 = call %Int32ToUint32.ref.loc12(%.loc12_43.2) [template = constants.%int_65535.4] -// CHECK:STDOUT: %.loc12_49.1: %u32 = value_of_initializer %int.convert_checked.loc12_49 [template = constants.%int_65535.4] -// CHECK:STDOUT: %.loc12_49.2: %u32 = converted %int.convert_checked.loc12_49, %.loc12_49.1 [template = constants.%int_65535.4] -// CHECK:STDOUT: %int.convert_checked.loc12_50: init %u16 = call %Uint32ToUint16.ref.loc12(%.loc12_49.2) [template = constants.%int_65535.3] -// CHECK:STDOUT: %.loc12_51.1: %u16 = value_of_initializer %int.convert_checked.loc12_50 [template = constants.%int_65535.3] -// CHECK:STDOUT: %.loc12_51.2: %u16 = converted %int.convert_checked.loc12_50, %.loc12_51.1 [template = constants.%int_65535.3] -// CHECK:STDOUT: %f: %u16 = bind_name f, %.loc12_51.2 -// CHECK:STDOUT: %Uint32ToInt16.ref.loc14: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] -// CHECK:STDOUT: %Int32ToUint32.ref.loc14: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_0.loc14: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc14: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14: = bound_method %int_0.loc14, %impl.elem0.loc14 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc14: = specific_function %Convert.bound.loc14, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc14_42: init %i32 = call %Convert.specific_fn.loc14(%int_0.loc14) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc14_42.1: %i32 = value_of_initializer %int.convert_checked.loc14_42 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc14_42.2: %i32 = converted %int_0.loc14, %.loc14_42.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.convert_checked.loc14_43: init %u32 = call %Int32ToUint32.ref.loc14(%.loc14_42.2) [template = constants.%int_0.4] -// CHECK:STDOUT: %.loc14_43.1: %u32 = value_of_initializer %int.convert_checked.loc14_43 [template = constants.%int_0.4] -// CHECK:STDOUT: %.loc14_43.2: %u32 = converted %int.convert_checked.loc14_43, %.loc14_43.1 [template = constants.%int_0.4] -// CHECK:STDOUT: %int.convert_checked.loc14_44: init %i16 = call %Uint32ToInt16.ref.loc14(%.loc14_43.2) [template = constants.%int_0.5] -// CHECK:STDOUT: %.loc14_45.1: %i16 = value_of_initializer %int.convert_checked.loc14_44 [template = constants.%int_0.5] -// CHECK:STDOUT: %.loc14_45.2: %i16 = converted %int.convert_checked.loc14_44, %.loc14_45.1 [template = constants.%int_0.5] -// CHECK:STDOUT: %g: %i16 = bind_name g, %.loc14_45.2 -// CHECK:STDOUT: %Uint32ToInt16.ref.loc15: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] -// CHECK:STDOUT: %Int32ToUint32.ref.loc15: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_32767.loc15: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_32767.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc15_42: init %i32 = call %Convert.specific_fn.loc15(%int_32767.loc15) [template = constants.%int_32767.2] -// CHECK:STDOUT: %.loc15_42.1: %i32 = value_of_initializer %int.convert_checked.loc15_42 [template = constants.%int_32767.2] -// CHECK:STDOUT: %.loc15_42.2: %i32 = converted %int_32767.loc15, %.loc15_42.1 [template = constants.%int_32767.2] -// CHECK:STDOUT: %int.convert_checked.loc15_48: init %u32 = call %Int32ToUint32.ref.loc15(%.loc15_42.2) [template = constants.%int_32767.4] -// CHECK:STDOUT: %.loc15_48.1: %u32 = value_of_initializer %int.convert_checked.loc15_48 [template = constants.%int_32767.4] -// CHECK:STDOUT: %.loc15_48.2: %u32 = converted %int.convert_checked.loc15_48, %.loc15_48.1 [template = constants.%int_32767.4] -// CHECK:STDOUT: %int.convert_checked.loc15_49: init %i16 = call %Uint32ToInt16.ref.loc15(%.loc15_48.2) [template = constants.%int_32767.3] -// CHECK:STDOUT: %.loc15_50.1: %i16 = value_of_initializer %int.convert_checked.loc15_49 [template = constants.%int_32767.3] -// CHECK:STDOUT: %.loc15_50.2: %i16 = converted %int.convert_checked.loc15_49, %.loc15_50.1 [template = constants.%int_32767.3] -// CHECK:STDOUT: %h: %i16 = bind_name h, %.loc15_50.2 -// CHECK:STDOUT: %IntLiteralToInt16.ref.loc17: %IntLiteralToInt16.type = name_ref IntLiteralToInt16, imports.%import_ref.14 [template = constants.%IntLiteralToInt16] -// CHECK:STDOUT: %Int32ToIntLiteral.ref.loc17: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %NegateI32.ref.loc17: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] -// CHECK:STDOUT: %int_32768.loc17: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0.loc17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc17: = bound_method %int_32768.loc17, %impl.elem0.loc17 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %Convert.specific_fn.loc17: = specific_function %Convert.bound.loc17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] -// CHECK:STDOUT: %int.convert_checked.loc17_70: init %i32 = call %Convert.specific_fn.loc17(%int_32768.loc17) [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc17_70.1: %i32 = value_of_initializer %int.convert_checked.loc17_70 [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc17_70.2: %i32 = converted %int_32768.loc17, %.loc17_70.1 [template = constants.%int_32768.2] -// CHECK:STDOUT: %int.snegate.loc17: init %i32 = call %NegateI32.ref.loc17(%.loc17_70.2) [template = constants.%int_-32768.1] -// CHECK:STDOUT: %.loc17_76.1: %i32 = value_of_initializer %int.snegate.loc17 [template = constants.%int_-32768.1] -// CHECK:STDOUT: %.loc17_76.2: %i32 = converted %int.snegate.loc17, %.loc17_76.1 [template = constants.%int_-32768.1] -// CHECK:STDOUT: %int.convert_checked.loc17_77: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc17(%.loc17_76.2) [template = constants.%int_-32768.3] -// CHECK:STDOUT: %.loc17_77.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc17_77 [template = constants.%int_-32768.3] -// CHECK:STDOUT: %.loc17_77.2: Core.IntLiteral = converted %int.convert_checked.loc17_77, %.loc17_77.1 [template = constants.%int_-32768.3] -// CHECK:STDOUT: %int.convert_checked.loc17_78: init %i16 = call %IntLiteralToInt16.ref.loc17(%.loc17_77.2) [template = constants.%int_-32768.2] -// CHECK:STDOUT: %.loc17_79.1: %i16 = value_of_initializer %int.convert_checked.loc17_78 [template = constants.%int_-32768.2] -// CHECK:STDOUT: %.loc17_79.2: %i16 = converted %int.convert_checked.loc17_78, %.loc17_79.1 [template = constants.%int_-32768.2] -// CHECK:STDOUT: %lit_i16_min: %i16 = bind_name lit_i16_min, %.loc17_79.2 -// CHECK:STDOUT: %IntLiteralToInt16.ref.loc18: %IntLiteralToInt16.type = name_ref IntLiteralToInt16, imports.%import_ref.14 [template = constants.%IntLiteralToInt16] -// CHECK:STDOUT: %Int32ToIntLiteral.ref.loc18: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %int_32767.loc18: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] -// CHECK:STDOUT: %impl.elem0.loc18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc18: = bound_method %int_32767.loc18, %impl.elem0.loc18 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc18: = specific_function %Convert.bound.loc18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc18_60: init %i32 = call %Convert.specific_fn.loc18(%int_32767.loc18) [template = constants.%int_32767.2] -// CHECK:STDOUT: %.loc18_60.1: %i32 = value_of_initializer %int.convert_checked.loc18_60 [template = constants.%int_32767.2] -// CHECK:STDOUT: %.loc18_60.2: %i32 = converted %int_32767.loc18, %.loc18_60.1 [template = constants.%int_32767.2] -// CHECK:STDOUT: %int.convert_checked.loc18_66: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc18(%.loc18_60.2) [template = constants.%int_32767.1] -// CHECK:STDOUT: %.loc18_66.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc18_66 [template = constants.%int_32767.1] -// CHECK:STDOUT: %.loc18_66.2: Core.IntLiteral = converted %int.convert_checked.loc18_66, %.loc18_66.1 [template = constants.%int_32767.1] -// CHECK:STDOUT: %int.convert_checked.loc18_67: init %i16 = call %IntLiteralToInt16.ref.loc18(%.loc18_66.2) [template = constants.%int_32767.3] -// CHECK:STDOUT: %.loc18_68.1: %i16 = value_of_initializer %int.convert_checked.loc18_67 [template = constants.%int_32767.3] -// CHECK:STDOUT: %.loc18_68.2: %i16 = converted %int.convert_checked.loc18_67, %.loc18_68.1 [template = constants.%int_32767.3] -// CHECK:STDOUT: %lit_i16_max: %i16 = bind_name lit_i16_max, %.loc18_68.2 -// CHECK:STDOUT: %IntLiteralToUint16.ref.loc20: %IntLiteralToUint16.type = name_ref IntLiteralToUint16, imports.%import_ref.15 [template = constants.%IntLiteralToUint16] -// CHECK:STDOUT: %Int32ToIntLiteral.ref.loc20: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %int_0.loc20: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc20: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc20: = bound_method %int_0.loc20, %impl.elem0.loc20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc20: = specific_function %Convert.bound.loc20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc20_61: init %i32 = call %Convert.specific_fn.loc20(%int_0.loc20) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc20_61.1: %i32 = value_of_initializer %int.convert_checked.loc20_61 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc20_61.2: %i32 = converted %int_0.loc20, %.loc20_61.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.convert_checked.loc20_62: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc20(%.loc20_61.2) [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc20_62.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc20_62 [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc20_62.2: Core.IntLiteral = converted %int.convert_checked.loc20_62, %.loc20_62.1 [template = constants.%int_0.1] -// CHECK:STDOUT: %int.convert_checked.loc20_63: init %u16 = call %IntLiteralToUint16.ref.loc20(%.loc20_62.2) [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc20_64.1: %u16 = value_of_initializer %int.convert_checked.loc20_63 [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc20_64.2: %u16 = converted %int.convert_checked.loc20_63, %.loc20_64.1 [template = constants.%int_0.3] -// CHECK:STDOUT: %lit_u16_min: %u16 = bind_name lit_u16_min, %.loc20_64.2 -// CHECK:STDOUT: %IntLiteralToUint16.ref.loc21: %IntLiteralToUint16.type = name_ref IntLiteralToUint16, imports.%import_ref.15 [template = constants.%IntLiteralToUint16] -// CHECK:STDOUT: %Int32ToIntLiteral.ref.loc21: %Int32ToIntLiteral.type = name_ref Int32ToIntLiteral, imports.%import_ref.20 [template = constants.%Int32ToIntLiteral] -// CHECK:STDOUT: %int_65535.loc21: Core.IntLiteral = int_value 65535 [template = constants.%int_65535.1] -// CHECK:STDOUT: %impl.elem0.loc21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc21: = bound_method %int_65535.loc21, %impl.elem0.loc21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc21: = specific_function %Convert.bound.loc21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc21_61: init %i32 = call %Convert.specific_fn.loc21(%int_65535.loc21) [template = constants.%int_65535.2] -// CHECK:STDOUT: %.loc21_61.1: %i32 = value_of_initializer %int.convert_checked.loc21_61 [template = constants.%int_65535.2] -// CHECK:STDOUT: %.loc21_61.2: %i32 = converted %int_65535.loc21, %.loc21_61.1 [template = constants.%int_65535.2] -// CHECK:STDOUT: %int.convert_checked.loc21_67: init Core.IntLiteral = call %Int32ToIntLiteral.ref.loc21(%.loc21_61.2) [template = constants.%int_65535.1] -// CHECK:STDOUT: %.loc21_67.1: Core.IntLiteral = value_of_initializer %int.convert_checked.loc21_67 [template = constants.%int_65535.1] -// CHECK:STDOUT: %.loc21_67.2: Core.IntLiteral = converted %int.convert_checked.loc21_67, %.loc21_67.1 [template = constants.%int_65535.1] -// CHECK:STDOUT: %int.convert_checked.loc21_68: init %u16 = call %IntLiteralToUint16.ref.loc21(%.loc21_67.2) [template = constants.%int_65535.3] -// CHECK:STDOUT: %.loc21_69.1: %u16 = value_of_initializer %int.convert_checked.loc21_68 [template = constants.%int_65535.3] -// CHECK:STDOUT: %.loc21_69.2: %u16 = converted %int.convert_checked.loc21_68, %.loc21_69.1 [template = constants.%int_65535.3] -// CHECK:STDOUT: %lit_u16_max: %u16 = bind_name lit_u16_max, %.loc21_69.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- zero_extend.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template] -// CHECK:STDOUT: %Uint32ToUint64.type: type = fn_type @Uint32ToUint64 [template] -// CHECK:STDOUT: %Uint32ToUint64: %Uint32ToUint64.type = struct_value () [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] -// CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] -// CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_0.3: %u32 = int_value 0 [template] -// CHECK:STDOUT: %int_0.4: %u64 = int_value 0 [template] -// CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template] -// CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_2147483647.3: %u32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_4294967294: %u32 = int_value 4294967294 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_1.3: %u32 = int_value 1 [template] -// CHECK:STDOUT: %int_4294967295.1: %u32 = int_value 4294967295 [template] -// CHECK:STDOUT: %int_4294967295.2: %u64 = int_value 4294967295 [template] -// CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template] -// CHECK:STDOUT: %Uint32ToInt64.type: type = fn_type @Uint32ToInt64 [template] -// CHECK:STDOUT: %Uint32ToInt64: %Uint32ToInt64.type = struct_value () [template] -// CHECK:STDOUT: %int_0.5: %i64 = int_value 0 [template] -// CHECK:STDOUT: %int_4294967295.3: %i64 = int_value 4294967295 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded -// CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, AddU32, loaded [template = constants.%AddU32] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18: %Uint32ToInt64.type = import_ref Main//int_ops, Uint32ToInt64, loaded [template = constants.%Uint32ToInt64] -// CHECK:STDOUT: %import_ref.19: %Uint32ToUint64.type = import_ref Main//int_ops, Uint32ToUint64, loaded [template = constants.%Uint32ToUint64] -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.29 -// CHECK:STDOUT: .Int = %import_ref.217 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: .d = @__global_init.%d -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint64(%a.param_patt: %u32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @AddU32(%a.param_patt: %u32, %b.param_patt: %u32) -> %u32 = "int.uadd" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt64(%a.param_patt: %u32) -> %i64 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Uint32ToUint64.ref.loc5: %Uint32ToUint64.type = name_ref Uint32ToUint64, imports.%import_ref.19 [template = constants.%Uint32ToUint64] -// CHECK:STDOUT: %Int32ToUint32.ref.loc5: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_0.loc5: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0.loc5, %impl.elem0.loc5 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc5_43: init %i32 = call %Convert.specific_fn.loc5(%int_0.loc5) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_43.1: %i32 = value_of_initializer %int.convert_checked.loc5_43 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_43.2: %i32 = converted %int_0.loc5, %.loc5_43.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.convert_checked.loc5_44: init %u32 = call %Int32ToUint32.ref.loc5(%.loc5_43.2) [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc5_44.1: %u32 = value_of_initializer %int.convert_checked.loc5_44 [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc5_44.2: %u32 = converted %int.convert_checked.loc5_44, %.loc5_44.1 [template = constants.%int_0.3] -// CHECK:STDOUT: %int.convert_checked.loc5_45: init %u64 = call %Uint32ToUint64.ref.loc5(%.loc5_44.2) [template = constants.%int_0.4] -// CHECK:STDOUT: %.loc5_46.1: %u64 = value_of_initializer %int.convert_checked.loc5_45 [template = constants.%int_0.4] -// CHECK:STDOUT: %.loc5_46.2: %u64 = converted %int.convert_checked.loc5_45, %.loc5_46.1 [template = constants.%int_0.4] -// CHECK:STDOUT: %a: %u64 = bind_name a, %.loc5_46.2 -// CHECK:STDOUT: %Uint32ToUint64.ref.loc6: %Uint32ToUint64.type = name_ref Uint32ToUint64, imports.%import_ref.19 [template = constants.%Uint32ToUint64] -// CHECK:STDOUT: %AddU32.ref.loc7: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] -// CHECK:STDOUT: %AddU32.ref.loc8: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] -// CHECK:STDOUT: %Int32ToUint32.ref.loc8_12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_2147483647.loc8_26: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_26: = bound_method %int_2147483647.loc8_26, %impl.elem0.loc8_26 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc8_26: = specific_function %Convert.bound.loc8_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc8_26: init %i32 = call %Convert.specific_fn.loc8_26(%int_2147483647.loc8_26) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_26.1: %i32 = value_of_initializer %int.convert_checked.loc8_26 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_26.2: %i32 = converted %int_2147483647.loc8_26, %.loc8_26.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.convert_checked.loc8_37: init %u32 = call %Int32ToUint32.ref.loc8_12(%.loc8_26.2) [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %Int32ToUint32.ref.loc8_40: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_2147483647.loc8_54: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_54: = bound_method %int_2147483647.loc8_54, %impl.elem0.loc8_54 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc8_54: = specific_function %Convert.bound.loc8_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc8_54: init %i32 = call %Convert.specific_fn.loc8_54(%int_2147483647.loc8_54) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_54.1: %i32 = value_of_initializer %int.convert_checked.loc8_54 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_54.2: %i32 = converted %int_2147483647.loc8_54, %.loc8_54.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.convert_checked.loc8_65: init %u32 = call %Int32ToUint32.ref.loc8_40(%.loc8_54.2) [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc8_37.1: %u32 = value_of_initializer %int.convert_checked.loc8_37 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc8_37.2: %u32 = converted %int.convert_checked.loc8_37, %.loc8_37.1 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc8_65.1: %u32 = value_of_initializer %int.convert_checked.loc8_65 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc8_65.2: %u32 = converted %int.convert_checked.loc8_65, %.loc8_65.1 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %int.uadd.loc8: init %u32 = call %AddU32.ref.loc8(%.loc8_37.2, %.loc8_65.2) [template = constants.%int_4294967294] -// CHECK:STDOUT: %Int32ToUint32.ref.loc9: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_1.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc9_19: init %i32 = call %Convert.specific_fn.loc9(%int_1.loc9) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_19.1: %i32 = value_of_initializer %int.convert_checked.loc9_19 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_19.2: %i32 = converted %int_1.loc9, %.loc9_19.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.convert_checked.loc9_20: init %u32 = call %Int32ToUint32.ref.loc9(%.loc9_19.2) [template = constants.%int_1.3] -// CHECK:STDOUT: %.loc8_66.1: %u32 = value_of_initializer %int.uadd.loc8 [template = constants.%int_4294967294] -// CHECK:STDOUT: %.loc8_66.2: %u32 = converted %int.uadd.loc8, %.loc8_66.1 [template = constants.%int_4294967294] -// CHECK:STDOUT: %.loc9_20.1: %u32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%int_1.3] -// CHECK:STDOUT: %.loc9_20.2: %u32 = converted %int.convert_checked.loc9_20, %.loc9_20.1 [template = constants.%int_1.3] -// CHECK:STDOUT: %int.uadd.loc9: init %u32 = call %AddU32.ref.loc7(%.loc8_66.2, %.loc9_20.2) [template = constants.%int_4294967295.1] -// CHECK:STDOUT: %.loc9_21.1: %u32 = value_of_initializer %int.uadd.loc9 [template = constants.%int_4294967295.1] -// CHECK:STDOUT: %.loc9_21.2: %u32 = converted %int.uadd.loc9, %.loc9_21.1 [template = constants.%int_4294967295.1] -// CHECK:STDOUT: %int.convert_checked.loc9_22: init %u64 = call %Uint32ToUint64.ref.loc6(%.loc9_21.2) [template = constants.%int_4294967295.2] -// CHECK:STDOUT: %.loc9_23.1: %u64 = value_of_initializer %int.convert_checked.loc9_22 [template = constants.%int_4294967295.2] -// CHECK:STDOUT: %.loc9_23.2: %u64 = converted %int.convert_checked.loc9_22, %.loc9_23.1 [template = constants.%int_4294967295.2] -// CHECK:STDOUT: %b: %u64 = bind_name b, %.loc9_23.2 -// CHECK:STDOUT: %Uint32ToInt64.ref.loc11: %Uint32ToInt64.type = name_ref Uint32ToInt64, imports.%import_ref.18 [template = constants.%Uint32ToInt64] -// CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_0.loc11, %impl.elem0.loc11 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc11_42: init %i32 = call %Convert.specific_fn.loc11(%int_0.loc11) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_42.1: %i32 = value_of_initializer %int.convert_checked.loc11_42 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_42.2: %i32 = converted %int_0.loc11, %.loc11_42.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.convert_checked.loc11_43: init %u32 = call %Int32ToUint32.ref.loc11(%.loc11_42.2) [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc11_43.1: %u32 = value_of_initializer %int.convert_checked.loc11_43 [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc11_43.2: %u32 = converted %int.convert_checked.loc11_43, %.loc11_43.1 [template = constants.%int_0.3] -// CHECK:STDOUT: %int.convert_checked.loc11_44: init %i64 = call %Uint32ToInt64.ref.loc11(%.loc11_43.2) [template = constants.%int_0.5] -// CHECK:STDOUT: %.loc11_45.1: %i64 = value_of_initializer %int.convert_checked.loc11_44 [template = constants.%int_0.5] -// CHECK:STDOUT: %.loc11_45.2: %i64 = converted %int.convert_checked.loc11_44, %.loc11_45.1 [template = constants.%int_0.5] -// CHECK:STDOUT: %c: %i64 = bind_name c, %.loc11_45.2 -// CHECK:STDOUT: %Uint32ToInt64.ref.loc12: %Uint32ToInt64.type = name_ref Uint32ToInt64, imports.%import_ref.18 [template = constants.%Uint32ToInt64] -// CHECK:STDOUT: %AddU32.ref.loc13: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] -// CHECK:STDOUT: %AddU32.ref.loc14: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] -// CHECK:STDOUT: %Int32ToUint32.ref.loc14_12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_2147483647.loc14_26: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc14_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14_26: = bound_method %int_2147483647.loc14_26, %impl.elem0.loc14_26 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc14_26: = specific_function %Convert.bound.loc14_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc14_26: init %i32 = call %Convert.specific_fn.loc14_26(%int_2147483647.loc14_26) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc14_26.1: %i32 = value_of_initializer %int.convert_checked.loc14_26 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc14_26.2: %i32 = converted %int_2147483647.loc14_26, %.loc14_26.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.convert_checked.loc14_37: init %u32 = call %Int32ToUint32.ref.loc14_12(%.loc14_26.2) [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %Int32ToUint32.ref.loc14_40: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_2147483647.loc14_54: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc14_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14_54: = bound_method %int_2147483647.loc14_54, %impl.elem0.loc14_54 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc14_54: = specific_function %Convert.bound.loc14_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc14_54: init %i32 = call %Convert.specific_fn.loc14_54(%int_2147483647.loc14_54) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc14_54.1: %i32 = value_of_initializer %int.convert_checked.loc14_54 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc14_54.2: %i32 = converted %int_2147483647.loc14_54, %.loc14_54.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.convert_checked.loc14_65: init %u32 = call %Int32ToUint32.ref.loc14_40(%.loc14_54.2) [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc14_37.1: %u32 = value_of_initializer %int.convert_checked.loc14_37 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc14_37.2: %u32 = converted %int.convert_checked.loc14_37, %.loc14_37.1 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc14_65.1: %u32 = value_of_initializer %int.convert_checked.loc14_65 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc14_65.2: %u32 = converted %int.convert_checked.loc14_65, %.loc14_65.1 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %int.uadd.loc14: init %u32 = call %AddU32.ref.loc14(%.loc14_37.2, %.loc14_65.2) [template = constants.%int_4294967294] -// CHECK:STDOUT: %Int32ToUint32.ref.loc15: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_1.loc15: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15: = bound_method %int_1.loc15, %impl.elem0.loc15 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc15: = specific_function %Convert.bound.loc15, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc15_19: init %i32 = call %Convert.specific_fn.loc15(%int_1.loc15) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc15_19.1: %i32 = value_of_initializer %int.convert_checked.loc15_19 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc15_19.2: %i32 = converted %int_1.loc15, %.loc15_19.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.convert_checked.loc15_20: init %u32 = call %Int32ToUint32.ref.loc15(%.loc15_19.2) [template = constants.%int_1.3] -// CHECK:STDOUT: %.loc14_66.1: %u32 = value_of_initializer %int.uadd.loc14 [template = constants.%int_4294967294] -// CHECK:STDOUT: %.loc14_66.2: %u32 = converted %int.uadd.loc14, %.loc14_66.1 [template = constants.%int_4294967294] -// CHECK:STDOUT: %.loc15_20.1: %u32 = value_of_initializer %int.convert_checked.loc15_20 [template = constants.%int_1.3] -// CHECK:STDOUT: %.loc15_20.2: %u32 = converted %int.convert_checked.loc15_20, %.loc15_20.1 [template = constants.%int_1.3] -// CHECK:STDOUT: %int.uadd.loc15: init %u32 = call %AddU32.ref.loc13(%.loc14_66.2, %.loc15_20.2) [template = constants.%int_4294967295.1] -// CHECK:STDOUT: %.loc15_21.1: %u32 = value_of_initializer %int.uadd.loc15 [template = constants.%int_4294967295.1] -// CHECK:STDOUT: %.loc15_21.2: %u32 = converted %int.uadd.loc15, %.loc15_21.1 [template = constants.%int_4294967295.1] -// CHECK:STDOUT: %int.convert_checked.loc15_22: init %i64 = call %Uint32ToInt64.ref.loc12(%.loc15_21.2) [template = constants.%int_4294967295.3] -// CHECK:STDOUT: %.loc15_23.1: %i64 = value_of_initializer %int.convert_checked.loc15_22 [template = constants.%int_4294967295.3] -// CHECK:STDOUT: %.loc15_23.2: %i64 = converted %int.convert_checked.loc15_22, %.loc15_23.1 [template = constants.%int_4294967295.3] -// CHECK:STDOUT: %d: %i64 = bind_name d, %.loc15_23.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- sign_extend.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template] -// CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template] -// CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.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: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_0.3: %u64 = int_value 0 [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_2147483647.3: %u64 = int_value 2147483647 [template] -// CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template] -// CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template] -// CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template] -// CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] -// CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] -// CHECK:STDOUT: %NegateI32.type: type = fn_type @NegateI32 [template] -// CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] -// CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-2147483648.1: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: %int_-2147483648.2: %i64 = int_value -2147483648 [template] -// CHECK:STDOUT: %int_2147483647.4: %i64 = int_value 2147483647 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, Int32ToInt64, loaded [template = constants.%Int32ToInt64] -// CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, Int32ToUint64, loaded [template = constants.%Int32ToUint64] -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.29 -// CHECK:STDOUT: .Int = %import_ref.217 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: .d = @__global_init.%d -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: %i32) -> %i64 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32ToUint64.ref.loc5: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc5: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc5: = bound_method %int_0, %impl.elem0.loc5 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc5: = specific_function %Convert.bound.loc5, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc5_28: init %i32 = call %Convert.specific_fn.loc5(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_28.1: %i32 = value_of_initializer %int.convert_checked.loc5_28 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_28.2: %i32 = converted %int_0, %.loc5_28.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.convert_checked.loc5_29: init %u64 = call %Int32ToUint64.ref.loc5(%.loc5_28.2) [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc5_30.1: %u64 = value_of_initializer %int.convert_checked.loc5_29 [template = constants.%int_0.3] -// CHECK:STDOUT: %.loc5_30.2: %u64 = converted %int.convert_checked.loc5_29, %.loc5_30.1 [template = constants.%int_0.3] -// CHECK:STDOUT: %a: %u64 = bind_name a, %.loc5_30.2 -// CHECK:STDOUT: %Int32ToUint64.ref.loc6: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64] -// CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6: = bound_method %int_2147483647.loc6, %impl.elem0.loc6 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc6: = specific_function %Convert.bound.loc6, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc6_28: init %i32 = call %Convert.specific_fn.loc6(%int_2147483647.loc6) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_28.1: %i32 = value_of_initializer %int.convert_checked.loc6_28 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_28.2: %i32 = converted %int_2147483647.loc6, %.loc6_28.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.convert_checked.loc6_39: init %u64 = call %Int32ToUint64.ref.loc6(%.loc6_28.2) [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc6_40.1: %u64 = value_of_initializer %int.convert_checked.loc6_39 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc6_40.2: %u64 = converted %int.convert_checked.loc6_39, %.loc6_40.1 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %b: %u64 = bind_name b, %.loc6_40.2 -// CHECK:STDOUT: %Int32ToInt64.ref.loc8: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%import_ref.16 [template = constants.%Int32ToInt64] -// CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] -// CHECK:STDOUT: %NegateI32.ref: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] -// CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_44: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_44: = bound_method %int_2147483647.loc8, %impl.elem0.loc8_44 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc8_44: = specific_function %Convert.bound.loc8_44, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc8_44: init %i32 = call %Convert.specific_fn.loc8_44(%int_2147483647.loc8) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_44.1: %i32 = value_of_initializer %int.convert_checked.loc8_44 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_44.2: %i32 = converted %int_2147483647.loc8, %.loc8_44.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.snegate: init %i32 = call %NegateI32.ref(%.loc8_44.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc8_55.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc8_55.2: %i32 = converted %int.snegate, %.loc8_55.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc8_58: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_58: = bound_method %int_1, %impl.elem0.loc8_58 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc8_58: = specific_function %Convert.bound.loc8_58, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc8_58: init %i32 = call %Convert.specific_fn.loc8_58(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_58.1: %i32 = value_of_initializer %int.convert_checked.loc8_58 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_58.2: %i32 = converted %int_1, %.loc8_58.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc8_55.2, %.loc8_58.2) [template = constants.%int_-2147483648.1] -// CHECK:STDOUT: %.loc8_59.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_-2147483648.1] -// CHECK:STDOUT: %.loc8_59.2: %i32 = converted %int.ssub, %.loc8_59.1 [template = constants.%int_-2147483648.1] -// CHECK:STDOUT: %int.convert_checked.loc8_60: init %i64 = call %Int32ToInt64.ref.loc8(%.loc8_59.2) [template = constants.%int_-2147483648.2] -// CHECK:STDOUT: %.loc8_61.1: %i64 = value_of_initializer %int.convert_checked.loc8_60 [template = constants.%int_-2147483648.2] -// CHECK:STDOUT: %.loc8_61.2: %i64 = converted %int.convert_checked.loc8_60, %.loc8_61.1 [template = constants.%int_-2147483648.2] -// CHECK:STDOUT: %c: %i64 = bind_name c, %.loc8_61.2 -// CHECK:STDOUT: %Int32ToInt64.ref.loc9: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%import_ref.16 [template = constants.%Int32ToInt64] -// CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9: = bound_method %int_2147483647.loc9, %impl.elem0.loc9 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9: = specific_function %Convert.bound.loc9, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_27: init %i32 = call %Convert.specific_fn.loc9(%int_2147483647.loc9) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %int.convert_checked.loc9_27 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_2147483647.loc9, %.loc9_27.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.convert_checked.loc9_38: init %i64 = call %Int32ToInt64.ref.loc9(%.loc9_27.2) [template = constants.%int_2147483647.4] -// CHECK:STDOUT: %.loc9_39.1: %i64 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%int_2147483647.4] -// CHECK:STDOUT: %.loc9_39.2: %i64 = converted %int.convert_checked.loc9_38, %.loc9_39.1 [template = constants.%int_2147483647.4] -// CHECK:STDOUT: %d: %i64 = bind_name d, %.loc9_39.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_too_large_u32_for_i32.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: %Uint32ToInt32.type: type = fn_type @Uint32ToInt32 [template] -// CHECK:STDOUT: %Uint32ToInt32: %Uint32ToInt32.type = struct_value () [template] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] -// CHECK:STDOUT: %AddU32.type: type = fn_type @AddU32 [template] -// CHECK:STDOUT: %AddU32: %AddU32.type = struct_value () [template] -// CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] -// CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_2147483647.3: %u32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_1.3: %u32 = int_value 1 [template] -// CHECK:STDOUT: %int_2147483648.1: %u32 = int_value 2147483648 [template] -// CHECK:STDOUT: %int_2147483648.2: %i32 = int_value 2147483648 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded -// CHECK:STDOUT: %import_ref.3: %AddU32.type = import_ref Main//int_ops, AddU32, loaded [template = constants.%AddU32] -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7: %Uint32ToInt32.type = import_ref Main//int_ops, Uint32ToInt32, loaded [template = constants.%Uint32ToInt32] -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.29 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .max_plus_one = @__global_init.%max_plus_one -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt32(%a.param_patt: %u32) -> %i32 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @AddU32(%a.param_patt: %u32, %b.param_patt: %u32) -> %u32 = "int.uadd" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Uint32ToInt32.ref: %Uint32ToInt32.type = name_ref Uint32ToInt32, imports.%import_ref.7 [template = constants.%Uint32ToInt32] -// CHECK:STDOUT: %AddU32.ref: %AddU32.type = name_ref AddU32, imports.%import_ref.3 [template = constants.%AddU32] -// CHECK:STDOUT: %Int32ToUint32.ref.loc11: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_2147483647: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc11: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11: = bound_method %int_2147483647, %impl.elem0.loc11 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc11: = specific_function %Convert.bound.loc11, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc11_26: init %i32 = call %Convert.specific_fn.loc11(%int_2147483647) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_26.1: %i32 = value_of_initializer %int.convert_checked.loc11_26 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_26.2: %i32 = converted %int_2147483647, %.loc11_26.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.convert_checked.loc11_37: init %u32 = call %Int32ToUint32.ref.loc11(%.loc11_26.2) [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %Int32ToUint32.ref.loc12: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12: = bound_method %int_1, %impl.elem0.loc12 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12: = specific_function %Convert.bound.loc12, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_26: init %i32 = call %Convert.specific_fn.loc12(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_26.1: %i32 = value_of_initializer %int.convert_checked.loc12_26 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_26.2: %i32 = converted %int_1, %.loc12_26.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.convert_checked.loc12_27: init %u32 = call %Int32ToUint32.ref.loc12(%.loc12_26.2) [template = constants.%int_1.3] -// CHECK:STDOUT: %.loc11_37.1: %u32 = value_of_initializer %int.convert_checked.loc11_37 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc11_37.2: %u32 = converted %int.convert_checked.loc11_37, %.loc11_37.1 [template = constants.%int_2147483647.3] -// CHECK:STDOUT: %.loc12_27.1: %u32 = value_of_initializer %int.convert_checked.loc12_27 [template = constants.%int_1.3] -// CHECK:STDOUT: %.loc12_27.2: %u32 = converted %int.convert_checked.loc12_27, %.loc12_27.1 [template = constants.%int_1.3] -// CHECK:STDOUT: %int.uadd: init %u32 = call %AddU32.ref(%.loc11_37.2, %.loc12_27.2) [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %.loc12_28.1: %u32 = value_of_initializer %int.uadd [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %.loc12_28.2: %u32 = converted %int.uadd, %.loc12_28.1 [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Uint32ToInt32.ref(%.loc12_28.2) [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc12_30.1: %i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc12_30.2: %i32 = converted %int.convert_checked.loc12_29, %.loc12_30.1 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %max_plus_one: %i32 = bind_name max_plus_one, %.loc12_30.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_too_large_i32_for_i16.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] -// CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] -// CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.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: %int_32768.1: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_32768.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] -// CHECK:STDOUT: %int_32768.3: %i16 = int_value 32768 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.26 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .max_plus_one = @__global_init.%max_plus_one -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_32768, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc9_38: init %i32 = call %Convert.specific_fn(%int_32768) [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc9_38.1: %i32 = value_of_initializer %int.convert_checked.loc9_38 [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc9_38.2: %i32 = converted %int_32768, %.loc9_38.1 [template = constants.%int_32768.2] -// CHECK:STDOUT: %int.convert_checked.loc9_44: init %i16 = call %Int32ToInt16.ref(%.loc9_38.2) [template = constants.%int_32768.3] -// CHECK:STDOUT: %.loc9_45.1: %i16 = value_of_initializer %int.convert_checked.loc9_44 [template = constants.%int_32768.3] -// CHECK:STDOUT: %.loc9_45.2: %i16 = converted %int.convert_checked.loc9_44, %.loc9_45.1 [template = constants.%int_32768.3] -// CHECK:STDOUT: %max_plus_one: %i16 = bind_name max_plus_one, %.loc9_45.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_too_large_i32_for_u16.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template] -// CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] -// CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.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: %int_65536.1: Core.IntLiteral = int_value 65536 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_65536.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template] -// CHECK:STDOUT: %int_65536.3: %u16 = int_value 65536 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, Int32ToUint16, loaded [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.29 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .max_plus_one = @__global_init.%max_plus_one -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32ToUint16.ref: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %int_65536: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_65536, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc9_39: init %i32 = call %Convert.specific_fn(%int_65536) [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc9_39.1: %i32 = value_of_initializer %int.convert_checked.loc9_39 [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc9_39.2: %i32 = converted %int_65536, %.loc9_39.1 [template = constants.%int_65536.2] -// CHECK:STDOUT: %int.convert_checked.loc9_47: init %u16 = call %Int32ToUint16.ref(%.loc9_39.2) [template = constants.%int_65536.3] -// CHECK:STDOUT: %.loc9_48.1: %u16 = value_of_initializer %int.convert_checked.loc9_47 [template = constants.%int_65536.3] -// CHECK:STDOUT: %.loc9_48.2: %u16 = converted %int.convert_checked.loc9_47, %.loc9_48.1 [template = constants.%int_65536.3] -// CHECK:STDOUT: %max_plus_one: %u16 = bind_name max_plus_one, %.loc9_48.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_too_large_u32_for_i16.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] -// CHECK:STDOUT: %Uint32ToInt16.type: type = fn_type @Uint32ToInt16 [template] -// CHECK:STDOUT: %Uint32ToInt16: %Uint32ToInt16.type = struct_value () [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] -// CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] -// CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_32768.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] -// CHECK:STDOUT: %int_32768.3: %u32 = int_value 32768 [template] -// CHECK:STDOUT: %int_32768.4: %i16 = int_value 32768 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12: %Uint32ToInt16.type = import_ref Main//int_ops, Uint32ToInt16, loaded [template = constants.%Uint32ToInt16] -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.29 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .max_plus_one = @__global_init.%max_plus_one -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToInt16(%a.param_patt: %u32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Uint32ToInt16.ref: %Uint32ToInt16.type = name_ref Uint32ToInt16, imports.%import_ref.12 [template = constants.%Uint32ToInt16] -// CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_32768, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn(%int_32768) [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc9_53.1: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc9_53.2: %i32 = converted %int_32768, %.loc9_53.1 [template = constants.%int_32768.2] -// CHECK:STDOUT: %int.convert_checked.loc9_59: init %u32 = call %Int32ToUint32.ref(%.loc9_53.2) [template = constants.%int_32768.3] -// CHECK:STDOUT: %.loc9_59.1: %u32 = value_of_initializer %int.convert_checked.loc9_59 [template = constants.%int_32768.3] -// CHECK:STDOUT: %.loc9_59.2: %u32 = converted %int.convert_checked.loc9_59, %.loc9_59.1 [template = constants.%int_32768.3] -// CHECK:STDOUT: %int.convert_checked.loc9_60: init %i16 = call %Uint32ToInt16.ref(%.loc9_59.2) [template = constants.%int_32768.4] -// CHECK:STDOUT: %.loc9_61.1: %i16 = value_of_initializer %int.convert_checked.loc9_60 [template = constants.%int_32768.4] -// CHECK:STDOUT: %.loc9_61.2: %i16 = converted %int.convert_checked.loc9_60, %.loc9_61.1 [template = constants.%int_32768.4] -// CHECK:STDOUT: %max_plus_one: %i16 = bind_name max_plus_one, %.loc9_61.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_too_large_u32_for_u16.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template] -// CHECK:STDOUT: %Uint32ToUint16.type: type = fn_type @Uint32ToUint16 [template] -// CHECK:STDOUT: %Uint32ToUint16: %Uint32ToUint16.type = struct_value () [template] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] -// CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] -// CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %int_65536.1: Core.IntLiteral = int_value 65536 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_65536.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template] -// CHECK:STDOUT: %int_65536.3: %u32 = int_value 65536 [template] -// CHECK:STDOUT: %int_65536.4: %u16 = int_value 65536 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13: %Uint32ToUint16.type = import_ref Main//int_ops, Uint32ToUint16, loaded [template = constants.%Uint32ToUint16] -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.29 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .max_plus_one = @__global_init.%max_plus_one -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Uint32ToUint16(%a.param_patt: %u32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Uint32ToUint16.ref: %Uint32ToUint16.type = name_ref Uint32ToUint16, imports.%import_ref.13 [template = constants.%Uint32ToUint16] -// CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %int_65536: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_65536, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc9_54: init %i32 = call %Convert.specific_fn(%int_65536) [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc9_54.1: %i32 = value_of_initializer %int.convert_checked.loc9_54 [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc9_54.2: %i32 = converted %int_65536, %.loc9_54.1 [template = constants.%int_65536.2] -// CHECK:STDOUT: %int.convert_checked.loc9_62: init %u32 = call %Int32ToUint32.ref(%.loc9_54.2) [template = constants.%int_65536.3] -// CHECK:STDOUT: %.loc9_62.1: %u32 = value_of_initializer %int.convert_checked.loc9_62 [template = constants.%int_65536.3] -// CHECK:STDOUT: %.loc9_62.2: %u32 = converted %int.convert_checked.loc9_62, %.loc9_62.1 [template = constants.%int_65536.3] -// CHECK:STDOUT: %int.convert_checked.loc9_63: init %u16 = call %Uint32ToUint16.ref(%.loc9_62.2) [template = constants.%int_65536.4] -// CHECK:STDOUT: %.loc9_64.1: %u16 = value_of_initializer %int.convert_checked.loc9_63 [template = constants.%int_65536.4] -// CHECK:STDOUT: %.loc9_64.2: %u16 = converted %int.convert_checked.loc9_63, %.loc9_64.1 [template = constants.%int_65536.4] -// CHECK:STDOUT: %max_plus_one: %u16 = bind_name max_plus_one, %.loc9_64.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_negative_i32_to_u16.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %u16: type = class_type @UInt, @UInt(%int_16) [template] -// CHECK:STDOUT: %Int32ToUint16.type: type = fn_type @Int32ToUint16 [template] -// CHECK:STDOUT: %Int32ToUint16: %Int32ToUint16.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: %SubI32.type: type = fn_type @SubI32 [template] -// CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %int_-1.2: %u16 = int_value 18446744073709551615 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.11: %Int32ToUint16.type = import_ref Main//int_ops, Int32ToUint16, loaded [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.29 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .minus_one_to_u16 = @__global_init.%minus_one_to_u16 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint16(%a.param_patt: %i32) -> %u16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32ToUint16.ref: %Int32ToUint16.type = name_ref Int32ToUint16, imports.%import_ref.11 [template = constants.%Int32ToUint16] -// CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_50: = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_50: = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_53: = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_53: = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_53.1: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_53.2: %i32 = converted %int_1, %.loc9_53.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc9_50.2, %.loc9_53.2) [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc9_54.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc9_54.2: %i32 = converted %int.ssub, %.loc9_54.1 [template = constants.%int_-1.1] -// CHECK:STDOUT: %int.convert_checked.loc9_55: init %u16 = call %Int32ToUint16.ref(%.loc9_54.2) [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc9_56.1: %u16 = value_of_initializer %int.convert_checked.loc9_55 [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc9_56.2: %u16 = converted %int.convert_checked.loc9_55, %.loc9_56.1 [template = constants.%int_-1.2] -// CHECK:STDOUT: %minus_one_to_u16: %u16 = bind_name minus_one_to_u16, %.loc9_56.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_negative_i32_to_u32.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] -// CHECK:STDOUT: %Int32ToUint32.type: type = fn_type @Int32ToUint32 [template] -// CHECK:STDOUT: %Int32ToUint32: %Int32ToUint32.type = struct_value () [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template] -// CHECK:STDOUT: %SubI32.type: type = fn_type @SubI32 [template] -// CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %int_-1.2: %u32 = int_value 18446744073709551615 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.29 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .minus_one_to_u32 = @__global_init.%minus_one_to_u32 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint32(%a.param_patt: %i32) -> %u32 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%import_ref.6 [template = constants.%Int32ToUint32] -// CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_50: = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_50: = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_53: = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_53: = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_53.1: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_53.2: %i32 = converted %int_1, %.loc9_53.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc9_50.2, %.loc9_53.2) [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc9_54.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc9_54.2: %i32 = converted %int.ssub, %.loc9_54.1 [template = constants.%int_-1.1] -// CHECK:STDOUT: %int.convert_checked.loc9_55: init %u32 = call %Int32ToUint32.ref(%.loc9_54.2) [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc9_56.1: %u32 = value_of_initializer %int.convert_checked.loc9_55 [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc9_56.2: %u32 = converted %int.convert_checked.loc9_55, %.loc9_56.1 [template = constants.%int_-1.2] -// CHECK:STDOUT: %minus_one_to_u32: %u32 = bind_name minus_one_to_u32, %.loc9_56.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_negative_i32_to_u64.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %u64: type = class_type @UInt, @UInt(%int_64) [template] -// CHECK:STDOUT: %Int32ToUint64.type: type = fn_type @Int32ToUint64 [template] -// CHECK:STDOUT: %Int32ToUint64: %Int32ToUint64.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: %SubI32.type: type = fn_type @SubI32 [template] -// CHECK:STDOUT: %SubI32: %SubI32.type = struct_value () [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1.1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %int_-1.2: %u64 = int_value 18446744073709551615 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded -// CHECK:STDOUT: %import_ref.2: %SubI32.type = import_ref Main//int_ops, SubI32, loaded [template = constants.%SubI32] -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10 = import_ref Main//int_ops, Int32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17: %Int32ToUint64.type = import_ref Main//int_ops, Int32ToUint64, loaded [template = constants.%Int32ToUint64] -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.29 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .minus_one_to_u64 = @__global_init.%minus_one_to_u64 -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToUint64(%a.param_patt: %i32) -> %u64 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @SubI32(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32ToUint64.ref: %Int32ToUint64.type = name_ref Int32ToUint64, imports.%import_ref.17 [template = constants.%Int32ToUint64] -// CHECK:STDOUT: %SubI32.ref: %SubI32.type = name_ref SubI32, imports.%import_ref.2 [template = constants.%SubI32] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_50: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_50: = bound_method %int_0, %impl.elem0.loc9_50 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_50: = specific_function %Convert.bound.loc9_50, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_50: init %i32 = call %Convert.specific_fn.loc9_50(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc9_50.1: %i32 = value_of_initializer %int.convert_checked.loc9_50 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc9_50.2: %i32 = converted %int_0, %.loc9_50.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc9_53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_53: = bound_method %int_1, %impl.elem0.loc9_53 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_53: = specific_function %Convert.bound.loc9_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_53: init %i32 = call %Convert.specific_fn.loc9_53(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_53.1: %i32 = value_of_initializer %int.convert_checked.loc9_53 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_53.2: %i32 = converted %int_1, %.loc9_53.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.ssub: init %i32 = call %SubI32.ref(%.loc9_50.2, %.loc9_53.2) [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc9_54.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_-1.1] -// CHECK:STDOUT: %.loc9_54.2: %i32 = converted %int.ssub, %.loc9_54.1 [template = constants.%int_-1.1] -// CHECK:STDOUT: %int.convert_checked.loc9_55: init %u64 = call %Int32ToUint64.ref(%.loc9_54.2) [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc9_56.1: %u64 = value_of_initializer %int.convert_checked.loc9_55 [template = constants.%int_-1.2] -// CHECK:STDOUT: %.loc9_56.2: %u64 = converted %int.convert_checked.loc9_55, %.loc9_56.1 [template = constants.%int_-1.2] -// CHECK:STDOUT: %minus_one_to_u64: %u64 = bind_name minus_one_to_u64, %.loc9_56.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_too_small_i32_for_i16.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] -// CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] -// CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.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: %NegateI32.type: type = fn_type @NegateI32 [template] -// CHECK:STDOUT: %NegateI32: %NegateI32.type = struct_value () [template] -// CHECK:STDOUT: %int_32769.1: Core.IntLiteral = int_value 32769 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_32769.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_32769.2: %i32 = int_value 32769 [template] -// CHECK:STDOUT: %int_-32769.1: %i32 = int_value -32769 [template] -// CHECK:STDOUT: %int_-32769.2: %i16 = int_value -32769 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %NegateI32.type = import_ref Main//int_ops, NegateI32, loaded [template = constants.%NegateI32] -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5 = import_ref Main//int_ops, Int32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16 = import_ref Main//int_ops, Int32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.26 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .min_minus_one = @__global_init.%min_minus_one -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @NegateI32(%a.param_patt: %i32) -> %i32 = "int.snegate" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %NegateI32.ref: %NegateI32.type = name_ref NegateI32, imports.%import_ref.1 [template = constants.%NegateI32] -// CHECK:STDOUT: %int_32769: Core.IntLiteral = int_value 32769 [template = constants.%int_32769.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_32769, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc9_49: init %i32 = call %Convert.specific_fn(%int_32769) [template = constants.%int_32769.2] -// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.convert_checked.loc9_49 [template = constants.%int_32769.2] -// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int_32769, %.loc9_49.1 [template = constants.%int_32769.2] -// CHECK:STDOUT: %int.snegate: init %i32 = call %NegateI32.ref(%.loc9_49.2) [template = constants.%int_-32769.1] -// CHECK:STDOUT: %.loc9_55.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-32769.1] -// CHECK:STDOUT: %.loc9_55.2: %i32 = converted %int.snegate, %.loc9_55.1 [template = constants.%int_-32769.1] -// CHECK:STDOUT: %int.convert_checked.loc9_56: init %i16 = call %Int32ToInt16.ref(%.loc9_55.2) [template = constants.%int_-32769.2] -// CHECK:STDOUT: %.loc9_57.1: %i16 = value_of_initializer %int.convert_checked.loc9_56 [template = constants.%int_-32769.2] -// CHECK:STDOUT: %.loc9_57.2: %i16 = converted %int.convert_checked.loc9_56, %.loc9_57.1 [template = constants.%int_-32769.2] -// CHECK:STDOUT: %min_minus_one: %i16 = bind_name min_minus_one, %.loc9_57.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_not_constant.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.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [template] -// CHECK:STDOUT: %i16: type = class_type @Int, @Int(%int_16) [template] -// CHECK:STDOUT: %Int32ToInt16.type: type = fn_type @Int32ToInt16 [template] -// CHECK:STDOUT: %Int32ToInt16: %Int32ToInt16.type = struct_value () [template] -// CHECK:STDOUT: %Int32ToInt32.type: type = fn_type @Int32ToInt32 [template] -// CHECK:STDOUT: %Int32ToInt32: %Int32ToInt32.type = struct_value () [template] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %i64: type = class_type @Int, @Int(%int_64) [template] -// CHECK:STDOUT: %Int32ToInt64.type: type = fn_type @Int32ToInt64 [template] -// CHECK:STDOUT: %Int32ToInt64: %Int32ToInt64.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//int_ops, NegateI32, unloaded -// CHECK:STDOUT: %import_ref.2 = import_ref Main//int_ops, SubI32, unloaded -// CHECK:STDOUT: %import_ref.3 = import_ref Main//int_ops, AddU32, unloaded -// CHECK:STDOUT: %import_ref.4 = import_ref Main//int_ops, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.5: %Int32ToInt32.type = import_ref Main//int_ops, Int32ToInt32, loaded [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %import_ref.6 = import_ref Main//int_ops, Int32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.7 = import_ref Main//int_ops, Uint32ToInt32, unloaded -// CHECK:STDOUT: %import_ref.8 = import_ref Main//int_ops, Uint32ToUint32, unloaded -// CHECK:STDOUT: %import_ref.9 = import_ref Main//int_ops, IntLiteralToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.10: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %import_ref.11 = import_ref Main//int_ops, Int32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.12 = import_ref Main//int_ops, Uint32ToInt16, unloaded -// CHECK:STDOUT: %import_ref.13 = import_ref Main//int_ops, Uint32ToUint16, unloaded -// CHECK:STDOUT: %import_ref.14 = import_ref Main//int_ops, IntLiteralToInt16, unloaded -// CHECK:STDOUT: %import_ref.15 = import_ref Main//int_ops, IntLiteralToUint16, unloaded -// CHECK:STDOUT: %import_ref.16: %Int32ToInt64.type = import_ref Main//int_ops, Int32ToInt64, loaded [template = constants.%Int32ToInt64] -// CHECK:STDOUT: %import_ref.17 = import_ref Main//int_ops, Int32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.18 = import_ref Main//int_ops, Uint32ToInt64, unloaded -// CHECK:STDOUT: %import_ref.19 = import_ref Main//int_ops, Uint32ToUint64, unloaded -// CHECK:STDOUT: %import_ref.20 = import_ref Main//int_ops, Int32ToIntLiteral, unloaded -// CHECK:STDOUT: %import_ref.21 = import_ref Main//int_ops, Uint32ToUintLiteral, unloaded -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.22 -// CHECK:STDOUT: .ImplicitAs = %import_ref.26 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .NegateI32 = imports.%import_ref.1 -// CHECK:STDOUT: .SubI32 = imports.%import_ref.2 -// CHECK:STDOUT: .AddU32 = imports.%import_ref.3 -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.4 -// CHECK:STDOUT: .Int32ToInt32 = imports.%import_ref.5 -// CHECK:STDOUT: .Int32ToUint32 = imports.%import_ref.6 -// CHECK:STDOUT: .Uint32ToInt32 = imports.%import_ref.7 -// CHECK:STDOUT: .Uint32ToUint32 = imports.%import_ref.8 -// CHECK:STDOUT: .IntLiteralToIntLiteral = imports.%import_ref.9 -// CHECK:STDOUT: .Int32ToInt16 = imports.%import_ref.10 -// CHECK:STDOUT: .Int32ToUint16 = imports.%import_ref.11 -// CHECK:STDOUT: .Uint32ToInt16 = imports.%import_ref.12 -// CHECK:STDOUT: .Uint32ToUint16 = imports.%import_ref.13 -// CHECK:STDOUT: .IntLiteralToInt16 = imports.%import_ref.14 -// CHECK:STDOUT: .IntLiteralToUint16 = imports.%import_ref.15 -// CHECK:STDOUT: .Int32ToInt64 = imports.%import_ref.16 -// CHECK:STDOUT: .Int32ToUint64 = imports.%import_ref.17 -// CHECK:STDOUT: .Uint32ToInt64 = imports.%import_ref.18 -// CHECK:STDOUT: .Uint32ToUint64 = imports.%import_ref.19 -// CHECK:STDOUT: .Int32ToIntLiteral = imports.%import_ref.20 -// CHECK:STDOUT: .Uint32ToUintLiteral = imports.%import_ref.21 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .not_constant = @__global_init.%not_constant -// CHECK:STDOUT: .convert_not_constant_narrow = @__global_init.%convert_not_constant_narrow -// CHECK:STDOUT: .convert_not_constant_same = @__global_init.%convert_not_constant_same -// CHECK:STDOUT: .convert_not_constant_widen = @__global_init.%convert_not_constant_widen -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt16(%a.param_patt: %i32) -> %i16 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt32(%a.param_patt: %i32) -> %i32 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int32ToInt64(%a.param_patt: %i32) -> %i64 = "int.convert_checked" [from "int_ops.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_0, %impl.elem0 [template = constants.%Convert.bound] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn] -// CHECK:STDOUT: %int.convert_checked.loc5: init %i32 = call %Convert.specific_fn(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_26.1: %i32 = value_of_initializer %int.convert_checked.loc5 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc5_26.2: %i32 = converted %int_0, %.loc5_26.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %not_constant: %i32 = bind_name not_constant, %.loc5_26.2 -// CHECK:STDOUT: %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%import_ref.10 [template = constants.%Int32ToInt16] -// CHECK:STDOUT: %not_constant.ref.loc15: %i32 = name_ref not_constant, %not_constant -// CHECK:STDOUT: %int.convert_checked.loc15: init %i16 = call %Int32ToInt16.ref(%not_constant.ref.loc15) -// CHECK:STDOUT: %.loc15_66.1: %i16 = value_of_initializer %int.convert_checked.loc15 -// CHECK:STDOUT: %.loc15_66.2: %i16 = converted %int.convert_checked.loc15, %.loc15_66.1 -// CHECK:STDOUT: %convert_not_constant_narrow: %i16 = bind_name convert_not_constant_narrow, %.loc15_66.2 -// CHECK:STDOUT: %Int32ToInt32.ref: %Int32ToInt32.type = name_ref Int32ToInt32, imports.%import_ref.5 [template = constants.%Int32ToInt32] -// CHECK:STDOUT: %not_constant.ref.loc25: %i32 = name_ref not_constant, %not_constant -// CHECK:STDOUT: %int.convert_checked.loc25: init %i32 = call %Int32ToInt32.ref(%not_constant.ref.loc25) -// CHECK:STDOUT: %.loc25_64.1: %i32 = value_of_initializer %int.convert_checked.loc25 -// CHECK:STDOUT: %.loc25_64.2: %i32 = converted %int.convert_checked.loc25, %.loc25_64.1 -// CHECK:STDOUT: %convert_not_constant_same: %i32 = bind_name convert_not_constant_same, %.loc25_64.2 -// CHECK:STDOUT: %Int32ToInt64.ref: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%import_ref.16 [template = constants.%Int32ToInt64] -// CHECK:STDOUT: %not_constant.ref.loc34: %i32 = name_ref not_constant, %not_constant -// CHECK:STDOUT: %int.convert_checked.loc34: init %i64 = call %Int32ToInt64.ref(%not_constant.ref.loc34) -// CHECK:STDOUT: %.loc34_65.1: %i64 = value_of_initializer %int.convert_checked.loc34 -// CHECK:STDOUT: %.loc34_65.2: %i64 = converted %int.convert_checked.loc34, %.loc34_65.1 -// CHECK:STDOUT: %convert_not_constant_widen: %i64 = bind_name convert_not_constant_widen, %.loc34_65.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/eq.carbon b/toolchain/check/testdata/builtins/int/eq.carbon index 88ec32a2a1d81..2700539af9293 100644 --- a/toolchain/check/testdata/builtins/int/eq.carbon +++ b/toolchain/check/testdata/builtins/int/eq.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/eq.carbon @@ -20,7 +22,7 @@ fn F(true_: True, false_: False) { false_ as (if Eq(1, 2) then True else False); } -fn RuntimeCall(a: i32, b: i32) -> bool { +fn RuntimeCallIsValid(a: i32, b: i32) -> bool { return Eq(a, b); } @@ -32,274 +34,3 @@ package FailBadDecl; // CHECK:STDERR: fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ fn WrongResult(a: i32, b: i32) -> i32 = "int.eq"; - -// CHECK:STDOUT: --- int_eq.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: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Eq.type.1: type = fn_type @Eq.1 [template] -// CHECK:STDOUT: %Eq: %Eq.type.1 = struct_value () [template] -// CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %False: type = class_type @False [template] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %true: bool = bool_literal true [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %false: bool = bool_literal false [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.6 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Eq = %Eq.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Eq.decl: %Eq.type.1 = fn_decl @Eq.1 [template = constants.%Eq] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_26.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc2_26.2: type = converted %bool.make_type, %.loc2_26.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_10: type = splice_block %i32.loc2_10 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_18: type = splice_block %i32.loc2_18 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} -// CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ -// CHECK:STDOUT: %true_.param_patt: %True = value_param_pattern %true_.patt, runtime_param0 -// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ -// CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 -// CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param -// CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 -// CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc12_19: type = splice_block %i32.loc12_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc12_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc12_27: type = splice_block %i32.loc12_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc12_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%True -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%False -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Eq.1(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.eq"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ -// CHECK:STDOUT: %Eq.ref.loc8: %Eq.type.1 = name_ref Eq, file.%Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %int_1.loc8_19: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_1.loc8_22: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8_19: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_19: = bound_method %int_1.loc8_19, %impl.elem0.loc8_19 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc8_19: = specific_function %Convert.bound.loc8_19, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc8_19: init %i32 = call %Convert.specific_fn.loc8_19(%int_1.loc8_19) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.convert_checked.loc8_19 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int_1.loc8_19, %.loc8_19.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_22: = bound_method %int_1.loc8_22, %impl.elem0.loc8_22 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc8_22: = specific_function %Convert.bound.loc8_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc8_22: init %i32 = call %Convert.specific_fn.loc8_22(%int_1.loc8_22) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_22.1: %i32 = value_of_initializer %int.convert_checked.loc8_22 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_22.2: %i32 = converted %int_1.loc8_22, %.loc8_22.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.eq.loc8: init bool = call %Eq.ref.loc8(%.loc8_19.2, %.loc8_22.2) [template = constants.%true] -// CHECK:STDOUT: %.loc8_13.1: bool = value_of_initializer %int.eq.loc8 [template = constants.%true] -// CHECK:STDOUT: %.loc8_13.2: bool = converted %int.eq.loc8, %.loc8_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc8_13.2 br !if.expr.then.loc8 else br !if.expr.else.loc8 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc8: -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc8(%True.ref.loc8) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc8: -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc8(%False.ref.loc8) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc8: -// CHECK:STDOUT: %.loc8_13.3: type = block_arg !if.expr.result.loc8 [template = constants.%True] -// CHECK:STDOUT: %false_.ref: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Eq.ref.loc9: %Eq.type.1 = name_ref Eq, file.%Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_20: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_20: = bound_method %int_1.loc9, %impl.elem0.loc9_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_20: = specific_function %Convert.bound.loc9_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_20: init %i32 = call %Convert.specific_fn.loc9_20(%int_1.loc9) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_20.1: %i32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_20.2: %i32 = converted %int_1.loc9, %.loc9_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_23: = bound_method %int_2, %impl.elem0.loc9_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_23: = specific_function %Convert.bound.loc9_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %Convert.specific_fn.loc9_23(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_23.1: %i32 = value_of_initializer %int.convert_checked.loc9_23 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_23.2: %i32 = converted %int_2, %.loc9_23.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.eq.loc9: init bool = call %Eq.ref.loc9(%.loc9_20.2, %.loc9_23.2) [template = constants.%false] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.eq.loc9 [template = constants.%false] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.eq.loc9, %.loc9_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc9: -// CHECK:STDOUT: %True.ref.loc9: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc9(%True.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc9: -// CHECK:STDOUT: %False.ref.loc9: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc9(%False.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc9: -// CHECK:STDOUT: %.loc9_14.3: type = block_arg !if.expr.result.loc9 [template = constants.%False] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Eq.ref: %Eq.type.1 = name_ref Eq, file.%Eq.decl [template = constants.%Eq] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.eq: init bool = call %Eq.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc13_18.1: bool = value_of_initializer %int.eq -// CHECK:STDOUT: %.loc13_18.2: bool = converted %int.eq, %.loc13_18.1 -// CHECK:STDOUT: return %.loc13_18.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_bad_decl.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: %WrongResult.type: type = fn_type @WrongResult [template] -// CHECK:STDOUT: %WrongResult: %WrongResult.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .WrongResult = %WrongResult.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %WrongResult.decl: %WrongResult.type = fn_decl @WrongResult [template = constants.%WrongResult] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @WrongResult(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32; -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/greater.carbon b/toolchain/check/testdata/builtins/int/greater.carbon index 679fa7f939e15..5b5925db71832 100644 --- a/toolchain/check/testdata/builtins/int/greater.carbon +++ b/toolchain/check/testdata/builtins/int/greater.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/greater.carbon @@ -24,353 +26,6 @@ fn F(true_: True, false_: False) { true_ as (if Greater(0, Negate(1)) then True else False); } -fn RuntimeCall(a: i32, b: i32) -> bool { +fn RuntimeCallIsValid(a: i32, b: i32) -> bool { return Greater(a, b); } - -// CHECK:STDOUT: --- int_greater.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: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Greater.type.1: type = fn_type @Greater.1 [template] -// CHECK:STDOUT: %Greater.1: %Greater.type.1 = struct_value () [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %False: type = class_type @False [template] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %false: bool = bool_literal false [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %true: bool = bool_literal true [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.6 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Greater = %Greater.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Greater.decl: %Greater.type.1 = fn_decl @Greater.1 [template = constants.%Greater.1] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_31.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc2_31.2: type = converted %bool.make_type, %.loc2_31.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_15: type = splice_block %i32.loc2_15 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_23: type = splice_block %i32.loc2_23 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc3: type = splice_block %i32.loc3_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} -// CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ -// CHECK:STDOUT: %true_.param_patt: %True = value_param_pattern %true_.patt, runtime_param0 -// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ -// CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param -// CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc16_19: type = splice_block %i32.loc16_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc16_27: type = splice_block %i32.loc16_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%True -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%False -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Greater.1(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.greater"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Greater.ref.loc9: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] -// CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_1.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_1.loc9) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_25.1: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_25.2: %i32 = converted %int_1.loc9, %.loc9_25.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_28: = bound_method %int_2, %impl.elem0.loc9_28 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_28: = specific_function %Convert.bound.loc9_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_28: init %i32 = call %Convert.specific_fn.loc9_28(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_28.1: %i32 = value_of_initializer %int.convert_checked.loc9_28 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_28.2: %i32 = converted %int_2, %.loc9_28.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.greater.loc9: init bool = call %Greater.ref.loc9(%.loc9_25.2, %.loc9_28.2) [template = constants.%false] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.greater.loc9 [template = constants.%false] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.greater.loc9, %.loc9_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc9: -// CHECK:STDOUT: %True.ref.loc9: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc9(%True.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc9: -// CHECK:STDOUT: %False.ref.loc9: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc9(%False.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc9: -// CHECK:STDOUT: %.loc9_14.3: type = block_arg !if.expr.result.loc9 [template = constants.%False] -// CHECK:STDOUT: %false_.ref.loc10: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Greater.ref.loc10: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] -// CHECK:STDOUT: %int_1.loc10_25: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_1.loc10_28: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_25: = bound_method %int_1.loc10_25, %impl.elem0.loc10_25 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_25: = specific_function %Convert.bound.loc10_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_25: init %i32 = call %Convert.specific_fn.loc10_25(%int_1.loc10_25) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_25.1: %i32 = value_of_initializer %int.convert_checked.loc10_25 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_25.2: %i32 = converted %int_1.loc10_25, %.loc10_25.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_28: = bound_method %int_1.loc10_28, %impl.elem0.loc10_28 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_28: = specific_function %Convert.bound.loc10_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_28: init %i32 = call %Convert.specific_fn.loc10_28(%int_1.loc10_28) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_28.1: %i32 = value_of_initializer %int.convert_checked.loc10_28 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_28.2: %i32 = converted %int_1.loc10_28, %.loc10_28.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.greater.loc10: init bool = call %Greater.ref.loc10(%.loc10_25.2, %.loc10_28.2) [template = constants.%false] -// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %int.greater.loc10 [template = constants.%false] -// CHECK:STDOUT: %.loc10_14.2: bool = converted %int.greater.loc10, %.loc10_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc10_14.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc10: -// CHECK:STDOUT: %True.ref.loc10: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc10(%True.ref.loc10) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc10: -// CHECK:STDOUT: %False.ref.loc10: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc10(%False.ref.loc10) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc10: -// CHECK:STDOUT: %.loc10_14.3: type = block_arg !if.expr.result.loc10 [template = constants.%False] -// CHECK:STDOUT: %true_.ref.loc11: %True = name_ref true_, %true_ -// CHECK:STDOUT: %Greater.ref.loc11: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] -// CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_24: = bound_method %int_1.loc11, %impl.elem0.loc11_24 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc11_24: = specific_function %Convert.bound.loc11_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc11_24: init %i32 = call %Convert.specific_fn.loc11_24(%int_1.loc11) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc11_24.1: %i32 = value_of_initializer %int.convert_checked.loc11_24 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc11_24.2: %i32 = converted %int_1.loc11, %.loc11_24.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_27: = bound_method %int_0.loc11, %impl.elem0.loc11_27 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc11_27: = specific_function %Convert.bound.loc11_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc11_27: init %i32 = call %Convert.specific_fn.loc11_27(%int_0.loc11) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_27.1: %i32 = value_of_initializer %int.convert_checked.loc11_27 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_27.2: %i32 = converted %int_0.loc11, %.loc11_27.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.greater.loc11: init bool = call %Greater.ref.loc11(%.loc11_24.2, %.loc11_27.2) [template = constants.%true] -// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %int.greater.loc11 [template = constants.%true] -// CHECK:STDOUT: %.loc11_13.2: bool = converted %int.greater.loc11, %.loc11_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc11_13.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc11: -// CHECK:STDOUT: %True.ref.loc11: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc11(%True.ref.loc11) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc11: -// CHECK:STDOUT: %False.ref.loc11: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc11(%False.ref.loc11) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc11: -// CHECK:STDOUT: %.loc11_13.3: type = block_arg !if.expr.result.loc11 [template = constants.%True] -// CHECK:STDOUT: %false_.ref.loc12: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Greater.ref.loc12: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_32: = bound_method %int_1.loc12, %impl.elem0.loc12_32 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_32: = specific_function %Convert.bound.loc12_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %Convert.specific_fn.loc12_32(%int_1.loc12) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_32.1: %i32 = value_of_initializer %int.convert_checked.loc12_32 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_32.2: %i32 = converted %int_1.loc12, %.loc12_32.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_32.2) [template = constants.%int_-1] -// CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc12_33.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc12_33.2: %i32 = converted %int.snegate.loc12, %.loc12_33.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_36: = bound_method %int_0.loc12, %impl.elem0.loc12_36 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc12_36: = specific_function %Convert.bound.loc12_36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc12_36: init %i32 = call %Convert.specific_fn.loc12_36(%int_0.loc12) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_36.1: %i32 = value_of_initializer %int.convert_checked.loc12_36 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_36.2: %i32 = converted %int_0.loc12, %.loc12_36.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_33.2, %.loc12_36.2) [template = constants.%false] -// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater.loc12 [template = constants.%false] -// CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater.loc12, %.loc12_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc12: -// CHECK:STDOUT: %True.ref.loc12: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc12(%True.ref.loc12) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc12: -// CHECK:STDOUT: %False.ref.loc12: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc12(%False.ref.loc12) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc12: -// CHECK:STDOUT: %.loc12_14.3: type = block_arg !if.expr.result.loc12 [template = constants.%False] -// CHECK:STDOUT: %true_.ref.loc13: %True = name_ref true_, %true_ -// CHECK:STDOUT: %Greater.ref.loc13: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] -// CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_34: = bound_method %int_1.loc13, %impl.elem0.loc13_34 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc13_34: = specific_function %Convert.bound.loc13_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc13_34: init %i32 = call %Convert.specific_fn.loc13_34(%int_1.loc13) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_34.1: %i32 = value_of_initializer %int.convert_checked.loc13_34 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_34.2: %i32 = converted %int_1.loc13, %.loc13_34.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_34.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_24: = bound_method %int_0.loc13, %impl.elem0.loc13_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc13_24: = specific_function %Convert.bound.loc13_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc13_24: init %i32 = call %Convert.specific_fn.loc13_24(%int_0.loc13) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_24.1: %i32 = value_of_initializer %int.convert_checked.loc13_24 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_24.2: %i32 = converted %int_0.loc13, %.loc13_24.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_35.1: %i32 = value_of_initializer %int.snegate.loc13 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc13_35.2: %i32 = converted %int.snegate.loc13, %.loc13_35.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.greater.loc13: init bool = call %Greater.ref.loc13(%.loc13_24.2, %.loc13_35.2) [template = constants.%true] -// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %int.greater.loc13 [template = constants.%true] -// CHECK:STDOUT: %.loc13_13.2: bool = converted %int.greater.loc13, %.loc13_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc13: -// CHECK:STDOUT: %True.ref.loc13: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc13(%True.ref.loc13) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc13: -// CHECK:STDOUT: %False.ref.loc13: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc13(%False.ref.loc13) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc13: -// CHECK:STDOUT: %.loc13_13.3: type = block_arg !if.expr.result.loc13 [template = constants.%True] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Greater.ref: %Greater.type.1 = name_ref Greater, file.%Greater.decl [template = constants.%Greater.1] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.greater: init bool = call %Greater.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc17_23.1: bool = value_of_initializer %int.greater -// CHECK:STDOUT: %.loc17_23.2: bool = converted %int.greater, %.loc17_23.1 -// CHECK:STDOUT: return %.loc17_23.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/greater_eq.carbon b/toolchain/check/testdata/builtins/int/greater_eq.carbon index 8f865aab5e5e9..952e906458a0a 100644 --- a/toolchain/check/testdata/builtins/int/greater_eq.carbon +++ b/toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/greater_eq.carbon @@ -24,353 +26,6 @@ fn F(true_: True, false_: False) { true_ as (if GreaterEq(0, Negate(1)) then True else False); } -fn RuntimeCall(a: i32, b: i32) -> bool { +fn RuntimeCallIsValid(a: i32, b: i32) -> bool { return GreaterEq(a, b); } - -// CHECK:STDOUT: --- int_greater_eq.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: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %GreaterEq.type: type = fn_type @GreaterEq [template] -// CHECK:STDOUT: %GreaterEq: %GreaterEq.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %False: type = class_type @False [template] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %false: bool = bool_literal false [template] -// CHECK:STDOUT: %true: bool = bool_literal true [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.6 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .GreaterEq = %GreaterEq.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %GreaterEq.decl: %GreaterEq.type = fn_decl @GreaterEq [template = constants.%GreaterEq] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_33.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc2_33.2: type = converted %bool.make_type, %.loc2_33.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_17: type = splice_block %i32.loc2_17 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_25: type = splice_block %i32.loc2_25 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc3: type = splice_block %i32.loc3_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} -// CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ -// CHECK:STDOUT: %true_.param_patt: %True = value_param_pattern %true_.patt, runtime_param0 -// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ -// CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param -// CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc16_19: type = splice_block %i32.loc16_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc16_27: type = splice_block %i32.loc16_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%True -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%False -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @GreaterEq(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.greater_eq"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %false_.ref.loc9: %False = name_ref false_, %false_ -// CHECK:STDOUT: %GreaterEq.ref.loc9: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_27: = bound_method %int_1.loc9, %impl.elem0.loc9_27 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_27: = specific_function %Convert.bound.loc9_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_27: init %i32 = call %Convert.specific_fn.loc9_27(%int_1.loc9) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_27.1: %i32 = value_of_initializer %int.convert_checked.loc9_27 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_27.2: %i32 = converted %int_1.loc9, %.loc9_27.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_30: = bound_method %int_2, %impl.elem0.loc9_30 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_30: = specific_function %Convert.bound.loc9_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_30: init %i32 = call %Convert.specific_fn.loc9_30(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_30.1: %i32 = value_of_initializer %int.convert_checked.loc9_30 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_30.2: %i32 = converted %int_2, %.loc9_30.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.greater_eq.loc9: init bool = call %GreaterEq.ref.loc9(%.loc9_27.2, %.loc9_30.2) [template = constants.%false] -// CHECK:STDOUT: %.loc9_14.1: bool = value_of_initializer %int.greater_eq.loc9 [template = constants.%false] -// CHECK:STDOUT: %.loc9_14.2: bool = converted %int.greater_eq.loc9, %.loc9_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc9_14.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc9: -// CHECK:STDOUT: %True.ref.loc9: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc9(%True.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc9: -// CHECK:STDOUT: %False.ref.loc9: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc9(%False.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc9: -// CHECK:STDOUT: %.loc9_14.3: type = block_arg !if.expr.result.loc9 [template = constants.%False] -// CHECK:STDOUT: %true_.ref.loc10: %True = name_ref true_, %true_ -// CHECK:STDOUT: %GreaterEq.ref.loc10: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %int_1.loc10_26: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_1.loc10_29: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_26: = bound_method %int_1.loc10_26, %impl.elem0.loc10_26 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_26: = specific_function %Convert.bound.loc10_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %Convert.specific_fn.loc10_26(%int_1.loc10_26) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked.loc10_26 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_26.2: %i32 = converted %int_1.loc10_26, %.loc10_26.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_29: = bound_method %int_1.loc10_29, %impl.elem0.loc10_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_29: = specific_function %Convert.bound.loc10_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_29: init %i32 = call %Convert.specific_fn.loc10_29(%int_1.loc10_29) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_29.1: %i32 = value_of_initializer %int.convert_checked.loc10_29 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_29.2: %i32 = converted %int_1.loc10_29, %.loc10_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.greater_eq.loc10: init bool = call %GreaterEq.ref.loc10(%.loc10_26.2, %.loc10_29.2) [template = constants.%true] -// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %int.greater_eq.loc10 [template = constants.%true] -// CHECK:STDOUT: %.loc10_13.2: bool = converted %int.greater_eq.loc10, %.loc10_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc10_13.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc10: -// CHECK:STDOUT: %True.ref.loc10: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc10(%True.ref.loc10) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc10: -// CHECK:STDOUT: %False.ref.loc10: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc10(%False.ref.loc10) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc10: -// CHECK:STDOUT: %.loc10_13.3: type = block_arg !if.expr.result.loc10 [template = constants.%True] -// CHECK:STDOUT: %true_.ref.loc11: %True = name_ref true_, %true_ -// CHECK:STDOUT: %GreaterEq.ref.loc11: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_26: = bound_method %int_1.loc11, %impl.elem0.loc11_26 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc11_26: = specific_function %Convert.bound.loc11_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc11_26: init %i32 = call %Convert.specific_fn.loc11_26(%int_1.loc11) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc11_26.1: %i32 = value_of_initializer %int.convert_checked.loc11_26 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc11_26.2: %i32 = converted %int_1.loc11, %.loc11_26.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_29: = bound_method %int_0.loc11, %impl.elem0.loc11_29 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc11_29: = specific_function %Convert.bound.loc11_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc11_29: init %i32 = call %Convert.specific_fn.loc11_29(%int_0.loc11) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_29.1: %i32 = value_of_initializer %int.convert_checked.loc11_29 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_29.2: %i32 = converted %int_0.loc11, %.loc11_29.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.greater_eq.loc11: init bool = call %GreaterEq.ref.loc11(%.loc11_26.2, %.loc11_29.2) [template = constants.%true] -// CHECK:STDOUT: %.loc11_13.1: bool = value_of_initializer %int.greater_eq.loc11 [template = constants.%true] -// CHECK:STDOUT: %.loc11_13.2: bool = converted %int.greater_eq.loc11, %.loc11_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc11_13.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc11: -// CHECK:STDOUT: %True.ref.loc11: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc11(%True.ref.loc11) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc11: -// CHECK:STDOUT: %False.ref.loc11: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc11(%False.ref.loc11) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc11: -// CHECK:STDOUT: %.loc11_13.3: type = block_arg !if.expr.result.loc11 [template = constants.%True] -// CHECK:STDOUT: %false_.ref.loc12: %False = name_ref false_, %false_ -// CHECK:STDOUT: %GreaterEq.ref.loc12: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_34: = bound_method %int_1.loc12, %impl.elem0.loc12_34 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_34: = specific_function %Convert.bound.loc12_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_34: init %i32 = call %Convert.specific_fn.loc12_34(%int_1.loc12) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_34.1: %i32 = value_of_initializer %int.convert_checked.loc12_34 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_34.2: %i32 = converted %int_1.loc12, %.loc12_34.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_34.2) [template = constants.%int_-1] -// CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc12_35.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc12_35.2: %i32 = converted %int.snegate.loc12, %.loc12_35.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_38: = bound_method %int_0.loc12, %impl.elem0.loc12_38 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc12_38: = specific_function %Convert.bound.loc12_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc12_38: init %i32 = call %Convert.specific_fn.loc12_38(%int_0.loc12) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_38.1: %i32 = value_of_initializer %int.convert_checked.loc12_38 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_38.2: %i32 = converted %int_0.loc12, %.loc12_38.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_35.2, %.loc12_38.2) [template = constants.%false] -// CHECK:STDOUT: %.loc12_14.1: bool = value_of_initializer %int.greater_eq.loc12 [template = constants.%false] -// CHECK:STDOUT: %.loc12_14.2: bool = converted %int.greater_eq.loc12, %.loc12_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc12_14.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc12: -// CHECK:STDOUT: %True.ref.loc12: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc12(%True.ref.loc12) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc12: -// CHECK:STDOUT: %False.ref.loc12: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc12(%False.ref.loc12) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc12: -// CHECK:STDOUT: %.loc12_14.3: type = block_arg !if.expr.result.loc12 [template = constants.%False] -// CHECK:STDOUT: %true_.ref.loc13: %True = name_ref true_, %true_ -// CHECK:STDOUT: %GreaterEq.ref.loc13: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_36: = bound_method %int_1.loc13, %impl.elem0.loc13_36 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc13_36: = specific_function %Convert.bound.loc13_36, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc13_36: init %i32 = call %Convert.specific_fn.loc13_36(%int_1.loc13) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_36.1: %i32 = value_of_initializer %int.convert_checked.loc13_36 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_36.2: %i32 = converted %int_1.loc13, %.loc13_36.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_36.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_26: = bound_method %int_0.loc13, %impl.elem0.loc13_26 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc13_26: = specific_function %Convert.bound.loc13_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc13_26: init %i32 = call %Convert.specific_fn.loc13_26(%int_0.loc13) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_26.1: %i32 = value_of_initializer %int.convert_checked.loc13_26 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_26.2: %i32 = converted %int_0.loc13, %.loc13_26.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_37.1: %i32 = value_of_initializer %int.snegate.loc13 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc13_37.2: %i32 = converted %int.snegate.loc13, %.loc13_37.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%.loc13_26.2, %.loc13_37.2) [template = constants.%true] -// CHECK:STDOUT: %.loc13_13.1: bool = value_of_initializer %int.greater_eq.loc13 [template = constants.%true] -// CHECK:STDOUT: %.loc13_13.2: bool = converted %int.greater_eq.loc13, %.loc13_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc13_13.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc13: -// CHECK:STDOUT: %True.ref.loc13: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc13(%True.ref.loc13) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc13: -// CHECK:STDOUT: %False.ref.loc13: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc13(%False.ref.loc13) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc13: -// CHECK:STDOUT: %.loc13_13.3: type = block_arg !if.expr.result.loc13 [template = constants.%True] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %GreaterEq.ref: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [template = constants.%GreaterEq] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.greater_eq: init bool = call %GreaterEq.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc17_25.1: bool = value_of_initializer %int.greater_eq -// CHECK:STDOUT: %.loc17_25.2: bool = converted %int.greater_eq, %.loc17_25.1 -// CHECK:STDOUT: return %.loc17_25.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/left_shift.carbon b/toolchain/check/testdata/builtins/int/left_shift.carbon index 726997da352e7..47a7036515f12 100644 --- a/toolchain/check/testdata/builtins/int/left_shift.carbon +++ b/toolchain/check/testdata/builtins/int/left_shift.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/left_shift.carbon @@ -15,7 +17,7 @@ fn LeftShift(a: i32, b: i32) -> i32 = "int.left_shift"; var arr: [i32; LeftShift(5, 2)]; let arr_p: [i32; 20]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return LeftShift(a, b); } @@ -62,384 +64,3 @@ let no_overflow_2: i32 = LeftShift(0, 32); // CHECK:STDERR: let negative: i32 = LeftShift(1, Negate(1)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~ let negative: i32 = LeftShift(1, Negate(1)); - -// CHECK:STDOUT: --- int_left_shift.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: %LeftShift.type.1: type = fn_type @LeftShift.1 [template] -// CHECK:STDOUT: %LeftShift: %LeftShift.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_20.2: Core.IntLiteral = int_value 20 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_20.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .LeftShift = %LeftShift.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %LeftShift.decl: %LeftShift.type.1 = fn_decl @LeftShift.1 [template = constants.%LeftShift] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_17: type = splice_block %i32.loc2_17 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_25: type = splice_block %i32.loc2_25 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @LeftShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.left_shift"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %LeftShift.ref: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.left_shift: init %i32 = call %LeftShift.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_25.1: %i32 = value_of_initializer %int.left_shift -// CHECK:STDOUT: %.loc8_25.2: %i32 = converted %int.left_shift, %.loc8_25.1 -// CHECK:STDOUT: return %.loc8_25.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_bad_shift.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32.1) [template] -// CHECK:STDOUT: %LeftShift.type.1: type = fn_type @LeftShift.1 [template] -// CHECK:STDOUT: %LeftShift: %LeftShift.type.1 = struct_value () [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_31.1: Core.IntLiteral = int_value 31 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32.1) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_31.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32.1) [template] -// CHECK:STDOUT: %int_31.2: %i32 = int_value 31 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32.1) [template] -// CHECK:STDOUT: %int_32.2: %i32 = int_value 32 [template] -// CHECK:STDOUT: %int_33.1: Core.IntLiteral = int_value 33 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_33.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32.1) [template] -// CHECK:STDOUT: %int_33.2: %i32 = int_value 33 [template] -// CHECK:STDOUT: %int_1000.1: Core.IntLiteral = int_value 1000 [template] -// CHECK:STDOUT: %Convert.bound.5: = bound_method %int_1000.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.5: = specific_function %Convert.bound.5, @Convert.2(%int_32.1) [template] -// CHECK:STDOUT: %int_1000.2: %i32 = int_value 1000 [template] -// CHECK:STDOUT: %int_0.1: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_0.2: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.6: = bound_method %int_0.2, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.6: = specific_function %Convert.bound.6, @Convert.2(%int_32.1) [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .LeftShift = %LeftShift.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .size_1 = @__global_init.%size_1 -// CHECK:STDOUT: .size_2 = @__global_init.%size_2 -// CHECK:STDOUT: .size_3 = @__global_init.%size_3 -// CHECK:STDOUT: .overflow_1 = @__global_init.%overflow_1 -// CHECK:STDOUT: .overflow_2 = @__global_init.%overflow_2 -// CHECK:STDOUT: .no_overflow_1 = @__global_init.%no_overflow_1 -// CHECK:STDOUT: .no_overflow_2 = @__global_init.%no_overflow_2 -// CHECK:STDOUT: .negative = @__global_init.%negative -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %LeftShift.decl: %LeftShift.type.1 = fn_decl @LeftShift.1 [template = constants.%LeftShift] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_33: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc4_33: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_17: type = splice_block %i32.loc4_17 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_17: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc4_17: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_25: type = splice_block %i32.loc4_25 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_25: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc4_25: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc5: type = splice_block %i32.loc5_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @LeftShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.left_shift"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %LeftShift.ref.loc8: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_31.loc8: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc8_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_29: = bound_method %int_1.loc8, %impl.elem0.loc8_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc8_29: = specific_function %Convert.bound.loc8_29, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc8_29: init %i32 = call %Convert.specific_fn.loc8_29(%int_1.loc8) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_29.1: %i32 = value_of_initializer %int.convert_checked.loc8_29 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_29.2: %i32 = converted %int_1.loc8, %.loc8_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_32: = bound_method %int_31.loc8, %impl.elem0.loc8_32 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc8_32: = specific_function %Convert.bound.loc8_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc8_32: init %i32 = call %Convert.specific_fn.loc8_32(%int_31.loc8) [template = constants.%int_31.2] -// CHECK:STDOUT: %.loc8_32.1: %i32 = value_of_initializer %int.convert_checked.loc8_32 [template = constants.%int_31.2] -// CHECK:STDOUT: %.loc8_32.2: %i32 = converted %int_31.loc8, %.loc8_32.1 [template = constants.%int_31.2] -// CHECK:STDOUT: %int.left_shift.loc8: init %i32 = call %LeftShift.ref.loc8(%.loc8_29.2, %.loc8_32.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc8_35.1: %i32 = value_of_initializer %int.left_shift.loc8 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc8_35.2: %i32 = converted %int.left_shift.loc8, %.loc8_35.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %size_1: %i32 = bind_name size_1, %.loc8_35.2 -// CHECK:STDOUT: %LeftShift.ref.loc13: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc13_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_29: = bound_method %int_1.loc13, %impl.elem0.loc13_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc13_29: = specific_function %Convert.bound.loc13_29, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc13_29: init %i32 = call %Convert.specific_fn.loc13_29(%int_1.loc13) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_29.1: %i32 = value_of_initializer %int.convert_checked.loc13_29 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_29.2: %i32 = converted %int_1.loc13, %.loc13_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_32: = bound_method %int_32.loc13, %impl.elem0.loc13_32 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc13_32: = specific_function %Convert.bound.loc13_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc13_32: init %i32 = call %Convert.specific_fn.loc13_32(%int_32.loc13) [template = constants.%int_32.2] -// CHECK:STDOUT: %.loc13_32.1: %i32 = value_of_initializer %int.convert_checked.loc13_32 [template = constants.%int_32.2] -// CHECK:STDOUT: %.loc13_32.2: %i32 = converted %int_32.loc13, %.loc13_32.1 [template = constants.%int_32.2] -// CHECK:STDOUT: %int.left_shift.loc13: init %i32 = call %LeftShift.ref.loc13(%.loc13_29.2, %.loc13_32.2) [template = ] -// CHECK:STDOUT: %.loc13_35.1: %i32 = value_of_initializer %int.left_shift.loc13 [template = ] -// CHECK:STDOUT: %.loc13_35.2: %i32 = converted %int.left_shift.loc13, %.loc13_35.1 [template = ] -// CHECK:STDOUT: %size_2: %i32 = bind_name size_2, %.loc13_35.2 -// CHECK:STDOUT: %LeftShift.ref.loc18: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_33: Core.IntLiteral = int_value 33 [template = constants.%int_33.1] -// CHECK:STDOUT: %impl.elem0.loc18_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc18_29: = bound_method %int_1.loc18, %impl.elem0.loc18_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc18_29: = specific_function %Convert.bound.loc18_29, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc18_29: init %i32 = call %Convert.specific_fn.loc18_29(%int_1.loc18) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc18_29.1: %i32 = value_of_initializer %int.convert_checked.loc18_29 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc18_29.2: %i32 = converted %int_1.loc18, %.loc18_29.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc18_32: = bound_method %int_33, %impl.elem0.loc18_32 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %Convert.specific_fn.loc18_32: = specific_function %Convert.bound.loc18_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.4] -// CHECK:STDOUT: %int.convert_checked.loc18_32: init %i32 = call %Convert.specific_fn.loc18_32(%int_33) [template = constants.%int_33.2] -// CHECK:STDOUT: %.loc18_32.1: %i32 = value_of_initializer %int.convert_checked.loc18_32 [template = constants.%int_33.2] -// CHECK:STDOUT: %.loc18_32.2: %i32 = converted %int_33, %.loc18_32.1 [template = constants.%int_33.2] -// CHECK:STDOUT: %int.left_shift.loc18: init %i32 = call %LeftShift.ref.loc18(%.loc18_29.2, %.loc18_32.2) [template = ] -// CHECK:STDOUT: %.loc18_35.1: %i32 = value_of_initializer %int.left_shift.loc18 [template = ] -// CHECK:STDOUT: %.loc18_35.2: %i32 = converted %int.left_shift.loc18, %.loc18_35.1 [template = ] -// CHECK:STDOUT: %size_3: %i32 = bind_name size_3, %.loc18_35.2 -// CHECK:STDOUT: %LeftShift.ref.loc21: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %int_1000.loc21: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %int_31.loc21: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc21_33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc21_33: = bound_method %int_1000.loc21, %impl.elem0.loc21_33 [template = constants.%Convert.bound.5] -// CHECK:STDOUT: %Convert.specific_fn.loc21_33: = specific_function %Convert.bound.loc21_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.5] -// CHECK:STDOUT: %int.convert_checked.loc21_33: init %i32 = call %Convert.specific_fn.loc21_33(%int_1000.loc21) [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc21_33.1: %i32 = value_of_initializer %int.convert_checked.loc21_33 [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc21_33.2: %i32 = converted %int_1000.loc21, %.loc21_33.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %impl.elem0.loc21_39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc21_39: = bound_method %int_31.loc21, %impl.elem0.loc21_39 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc21_39: = specific_function %Convert.bound.loc21_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc21_39: init %i32 = call %Convert.specific_fn.loc21_39(%int_31.loc21) [template = constants.%int_31.2] -// CHECK:STDOUT: %.loc21_39.1: %i32 = value_of_initializer %int.convert_checked.loc21_39 [template = constants.%int_31.2] -// CHECK:STDOUT: %.loc21_39.2: %i32 = converted %int_31.loc21, %.loc21_39.1 [template = constants.%int_31.2] -// CHECK:STDOUT: %int.left_shift.loc21: init %i32 = call %LeftShift.ref.loc21(%.loc21_33.2, %.loc21_39.2) [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc21_42.1: %i32 = value_of_initializer %int.left_shift.loc21 [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc21_42.2: %i32 = converted %int.left_shift.loc21, %.loc21_42.1 [template = constants.%int_0.1] -// CHECK:STDOUT: %overflow_1: %i32 = bind_name overflow_1, %.loc21_42.2 -// CHECK:STDOUT: %LeftShift.ref.loc26: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %int_1000.loc26: Core.IntLiteral = int_value 1000 [template = constants.%int_1000.1] -// CHECK:STDOUT: %int_32.loc26: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc26_33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc26_33: = bound_method %int_1000.loc26, %impl.elem0.loc26_33 [template = constants.%Convert.bound.5] -// CHECK:STDOUT: %Convert.specific_fn.loc26_33: = specific_function %Convert.bound.loc26_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.5] -// CHECK:STDOUT: %int.convert_checked.loc26_33: init %i32 = call %Convert.specific_fn.loc26_33(%int_1000.loc26) [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc26_33.1: %i32 = value_of_initializer %int.convert_checked.loc26_33 [template = constants.%int_1000.2] -// CHECK:STDOUT: %.loc26_33.2: %i32 = converted %int_1000.loc26, %.loc26_33.1 [template = constants.%int_1000.2] -// CHECK:STDOUT: %impl.elem0.loc26_39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc26_39: = bound_method %int_32.loc26, %impl.elem0.loc26_39 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc26_39: = specific_function %Convert.bound.loc26_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc26_39: init %i32 = call %Convert.specific_fn.loc26_39(%int_32.loc26) [template = constants.%int_32.2] -// CHECK:STDOUT: %.loc26_39.1: %i32 = value_of_initializer %int.convert_checked.loc26_39 [template = constants.%int_32.2] -// CHECK:STDOUT: %.loc26_39.2: %i32 = converted %int_32.loc26, %.loc26_39.1 [template = constants.%int_32.2] -// CHECK:STDOUT: %int.left_shift.loc26: init %i32 = call %LeftShift.ref.loc26(%.loc26_33.2, %.loc26_39.2) [template = ] -// CHECK:STDOUT: %.loc26_42.1: %i32 = value_of_initializer %int.left_shift.loc26 [template = ] -// CHECK:STDOUT: %.loc26_42.2: %i32 = converted %int.left_shift.loc26, %.loc26_42.1 [template = ] -// CHECK:STDOUT: %overflow_2: %i32 = bind_name overflow_2, %.loc26_42.2 -// CHECK:STDOUT: %LeftShift.ref.loc29: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %int_0.loc29: Core.IntLiteral = int_value 0 [template = constants.%int_0.2] -// CHECK:STDOUT: %int_31.loc29: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc29_36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc29_36: = bound_method %int_0.loc29, %impl.elem0.loc29_36 [template = constants.%Convert.bound.6] -// CHECK:STDOUT: %Convert.specific_fn.loc29_36: = specific_function %Convert.bound.loc29_36, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.6] -// CHECK:STDOUT: %int.convert_checked.loc29_36: init %i32 = call %Convert.specific_fn.loc29_36(%int_0.loc29) [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc29_36.1: %i32 = value_of_initializer %int.convert_checked.loc29_36 [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc29_36.2: %i32 = converted %int_0.loc29, %.loc29_36.1 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc29_39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc29_39: = bound_method %int_31.loc29, %impl.elem0.loc29_39 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc29_39: = specific_function %Convert.bound.loc29_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc29_39: init %i32 = call %Convert.specific_fn.loc29_39(%int_31.loc29) [template = constants.%int_31.2] -// CHECK:STDOUT: %.loc29_39.1: %i32 = value_of_initializer %int.convert_checked.loc29_39 [template = constants.%int_31.2] -// CHECK:STDOUT: %.loc29_39.2: %i32 = converted %int_31.loc29, %.loc29_39.1 [template = constants.%int_31.2] -// CHECK:STDOUT: %int.left_shift.loc29: init %i32 = call %LeftShift.ref.loc29(%.loc29_36.2, %.loc29_39.2) [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc29_42.1: %i32 = value_of_initializer %int.left_shift.loc29 [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc29_42.2: %i32 = converted %int.left_shift.loc29, %.loc29_42.1 [template = constants.%int_0.1] -// CHECK:STDOUT: %no_overflow_1: %i32 = bind_name no_overflow_1, %.loc29_42.2 -// CHECK:STDOUT: %LeftShift.ref.loc34: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %int_0.loc34: Core.IntLiteral = int_value 0 [template = constants.%int_0.2] -// CHECK:STDOUT: %int_32.loc34: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc34_36: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc34_36: = bound_method %int_0.loc34, %impl.elem0.loc34_36 [template = constants.%Convert.bound.6] -// CHECK:STDOUT: %Convert.specific_fn.loc34_36: = specific_function %Convert.bound.loc34_36, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.6] -// CHECK:STDOUT: %int.convert_checked.loc34_36: init %i32 = call %Convert.specific_fn.loc34_36(%int_0.loc34) [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc34_36.1: %i32 = value_of_initializer %int.convert_checked.loc34_36 [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc34_36.2: %i32 = converted %int_0.loc34, %.loc34_36.1 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc34_39: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc34_39: = bound_method %int_32.loc34, %impl.elem0.loc34_39 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc34_39: = specific_function %Convert.bound.loc34_39, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc34_39: init %i32 = call %Convert.specific_fn.loc34_39(%int_32.loc34) [template = constants.%int_32.2] -// CHECK:STDOUT: %.loc34_39.1: %i32 = value_of_initializer %int.convert_checked.loc34_39 [template = constants.%int_32.2] -// CHECK:STDOUT: %.loc34_39.2: %i32 = converted %int_32.loc34, %.loc34_39.1 [template = constants.%int_32.2] -// CHECK:STDOUT: %int.left_shift.loc34: init %i32 = call %LeftShift.ref.loc34(%.loc34_36.2, %.loc34_39.2) [template = ] -// CHECK:STDOUT: %.loc34_42.1: %i32 = value_of_initializer %int.left_shift.loc34 [template = ] -// CHECK:STDOUT: %.loc34_42.2: %i32 = converted %int.left_shift.loc34, %.loc34_42.1 [template = ] -// CHECK:STDOUT: %no_overflow_2: %i32 = bind_name no_overflow_2, %.loc34_42.2 -// CHECK:STDOUT: %LeftShift.ref.loc40: %LeftShift.type.1 = name_ref LeftShift, file.%LeftShift.decl [template = constants.%LeftShift] -// CHECK:STDOUT: %int_1.loc40_31: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc40_41: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc40_41: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc40_41: = bound_method %int_1.loc40_41, %impl.elem0.loc40_41 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc40_41: = specific_function %Convert.bound.loc40_41, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc40_41: init %i32 = call %Convert.specific_fn.loc40_41(%int_1.loc40_41) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc40_41.1: %i32 = value_of_initializer %int.convert_checked.loc40_41 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc40_41.2: %i32 = converted %int_1.loc40_41, %.loc40_41.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc40_41.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc40_31: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc40_31: = bound_method %int_1.loc40_31, %impl.elem0.loc40_31 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc40_31: = specific_function %Convert.bound.loc40_31, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc40_31: init %i32 = call %Convert.specific_fn.loc40_31(%int_1.loc40_31) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc40_31.1: %i32 = value_of_initializer %int.convert_checked.loc40_31 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc40_31.2: %i32 = converted %int_1.loc40_31, %.loc40_31.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc40_42.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-1] -// CHECK:STDOUT: %.loc40_42.2: %i32 = converted %int.snegate, %.loc40_42.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.left_shift.loc40: init %i32 = call %LeftShift.ref.loc40(%.loc40_31.2, %.loc40_42.2) [template = ] -// CHECK:STDOUT: %.loc40_44.1: %i32 = value_of_initializer %int.left_shift.loc40 [template = ] -// CHECK:STDOUT: %.loc40_44.2: %i32 = converted %int.left_shift.loc40, %.loc40_44.1 [template = ] -// CHECK:STDOUT: %negative: %i32 = bind_name negative, %.loc40_44.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/less.carbon b/toolchain/check/testdata/builtins/int/less.carbon index 517e91b8aaa1a..fa6181050d87f 100644 --- a/toolchain/check/testdata/builtins/int/less.carbon +++ b/toolchain/check/testdata/builtins/int/less.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/less.carbon @@ -24,353 +26,6 @@ fn F(true_: True, false_: False) { false_ as (if Less(0, Negate(1)) then True else False); } -fn RuntimeCall(a: i32, b: i32) -> bool { +fn RuntimeCallIsValid(a: i32, b: i32) -> bool { return Less(a, b); } - -// CHECK:STDOUT: --- int_less.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: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Less.type.1: type = fn_type @Less.1 [template] -// CHECK:STDOUT: %Less.1: %Less.type.1 = struct_value () [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %False: type = class_type @False [template] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %true: bool = bool_literal true [template] -// CHECK:STDOUT: %false: bool = bool_literal false [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.6 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Less = %Less.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Less.decl: %Less.type.1 = fn_decl @Less.1 [template = constants.%Less.1] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_28.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc2_28.2: type = converted %bool.make_type, %.loc2_28.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_12: type = splice_block %i32.loc2_12 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_12: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_20: type = splice_block %i32.loc2_20 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_20: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_20: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc3: type = splice_block %i32.loc3_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} -// CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ -// CHECK:STDOUT: %true_.param_patt: %True = value_param_pattern %true_.patt, runtime_param0 -// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ -// CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param -// CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc16_19: type = splice_block %i32.loc16_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc16_27: type = splice_block %i32.loc16_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%True -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%False -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Less.1(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.less"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ -// CHECK:STDOUT: %Less.ref.loc9: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] -// CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_21: = bound_method %int_1.loc9, %impl.elem0.loc9_21 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_21: = specific_function %Convert.bound.loc9_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_21: init %i32 = call %Convert.specific_fn.loc9_21(%int_1.loc9) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_21.1: %i32 = value_of_initializer %int.convert_checked.loc9_21 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_21.2: %i32 = converted %int_1.loc9, %.loc9_21.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_24: = bound_method %int_2, %impl.elem0.loc9_24 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_24: = specific_function %Convert.bound.loc9_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_24: init %i32 = call %Convert.specific_fn.loc9_24(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_24.1: %i32 = value_of_initializer %int.convert_checked.loc9_24 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_24.2: %i32 = converted %int_2, %.loc9_24.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.less.loc9: init bool = call %Less.ref.loc9(%.loc9_21.2, %.loc9_24.2) [template = constants.%true] -// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.less.loc9 [template = constants.%true] -// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.less.loc9, %.loc9_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc9_13.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc9: -// CHECK:STDOUT: %True.ref.loc9: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc9(%True.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc9: -// CHECK:STDOUT: %False.ref.loc9: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc9(%False.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc9: -// CHECK:STDOUT: %.loc9_13.3: type = block_arg !if.expr.result.loc9 [template = constants.%True] -// CHECK:STDOUT: %false_.ref.loc10: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Less.ref.loc10: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] -// CHECK:STDOUT: %int_1.loc10_22: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_1.loc10_25: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_22: = bound_method %int_1.loc10_22, %impl.elem0.loc10_22 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_22: = specific_function %Convert.bound.loc10_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_22: init %i32 = call %Convert.specific_fn.loc10_22(%int_1.loc10_22) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_22.1: %i32 = value_of_initializer %int.convert_checked.loc10_22 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_22.2: %i32 = converted %int_1.loc10_22, %.loc10_22.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_25: = bound_method %int_1.loc10_25, %impl.elem0.loc10_25 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_25: = specific_function %Convert.bound.loc10_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_25: init %i32 = call %Convert.specific_fn.loc10_25(%int_1.loc10_25) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_25.1: %i32 = value_of_initializer %int.convert_checked.loc10_25 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_25.2: %i32 = converted %int_1.loc10_25, %.loc10_25.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.less.loc10: init bool = call %Less.ref.loc10(%.loc10_22.2, %.loc10_25.2) [template = constants.%false] -// CHECK:STDOUT: %.loc10_14.1: bool = value_of_initializer %int.less.loc10 [template = constants.%false] -// CHECK:STDOUT: %.loc10_14.2: bool = converted %int.less.loc10, %.loc10_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc10_14.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc10: -// CHECK:STDOUT: %True.ref.loc10: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc10(%True.ref.loc10) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc10: -// CHECK:STDOUT: %False.ref.loc10: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc10(%False.ref.loc10) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc10: -// CHECK:STDOUT: %.loc10_14.3: type = block_arg !if.expr.result.loc10 [template = constants.%False] -// CHECK:STDOUT: %false_.ref.loc11: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Less.ref.loc11: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] -// CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_22: = bound_method %int_1.loc11, %impl.elem0.loc11_22 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc11_22: = specific_function %Convert.bound.loc11_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %Convert.specific_fn.loc11_22(%int_1.loc11) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc11_22.1: %i32 = value_of_initializer %int.convert_checked.loc11_22 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc11_22.2: %i32 = converted %int_1.loc11, %.loc11_22.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_25: = bound_method %int_0.loc11, %impl.elem0.loc11_25 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc11_25: = specific_function %Convert.bound.loc11_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc11_25: init %i32 = call %Convert.specific_fn.loc11_25(%int_0.loc11) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_25.1: %i32 = value_of_initializer %int.convert_checked.loc11_25 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_25.2: %i32 = converted %int_0.loc11, %.loc11_25.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.less.loc11: init bool = call %Less.ref.loc11(%.loc11_22.2, %.loc11_25.2) [template = constants.%false] -// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %int.less.loc11 [template = constants.%false] -// CHECK:STDOUT: %.loc11_14.2: bool = converted %int.less.loc11, %.loc11_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc11_14.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc11: -// CHECK:STDOUT: %True.ref.loc11: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc11(%True.ref.loc11) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc11: -// CHECK:STDOUT: %False.ref.loc11: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc11(%False.ref.loc11) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc11: -// CHECK:STDOUT: %.loc11_14.3: type = block_arg !if.expr.result.loc11 [template = constants.%False] -// CHECK:STDOUT: %true_.ref.loc12: %True = name_ref true_, %true_ -// CHECK:STDOUT: %Less.ref.loc12: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_28: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_28: = bound_method %int_1.loc12, %impl.elem0.loc12_28 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_28: = specific_function %Convert.bound.loc12_28, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_28: init %i32 = call %Convert.specific_fn.loc12_28(%int_1.loc12) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_28.1: %i32 = value_of_initializer %int.convert_checked.loc12_28 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_28.2: %i32 = converted %int_1.loc12, %.loc12_28.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_28.2) [template = constants.%int_-1] -// CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc12_29.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc12_29.2: %i32 = converted %int.snegate.loc12, %.loc12_29.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_32: = bound_method %int_0.loc12, %impl.elem0.loc12_32 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc12_32: = specific_function %Convert.bound.loc12_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc12_32: init %i32 = call %Convert.specific_fn.loc12_32(%int_0.loc12) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_32.1: %i32 = value_of_initializer %int.convert_checked.loc12_32 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_32.2: %i32 = converted %int_0.loc12, %.loc12_32.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.less.loc12: init bool = call %Less.ref.loc12(%.loc12_29.2, %.loc12_32.2) [template = constants.%true] -// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less.loc12 [template = constants.%true] -// CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less.loc12, %.loc12_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc12: -// CHECK:STDOUT: %True.ref.loc12: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc12(%True.ref.loc12) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc12: -// CHECK:STDOUT: %False.ref.loc12: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc12(%False.ref.loc12) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc12: -// CHECK:STDOUT: %.loc12_13.3: type = block_arg !if.expr.result.loc12 [template = constants.%True] -// CHECK:STDOUT: %false_.ref.loc13: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Less.ref.loc13: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] -// CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_32: = bound_method %int_1.loc13, %impl.elem0.loc13_32 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc13_32: = specific_function %Convert.bound.loc13_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc13_32: init %i32 = call %Convert.specific_fn.loc13_32(%int_1.loc13) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_32.1: %i32 = value_of_initializer %int.convert_checked.loc13_32 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_32.2: %i32 = converted %int_1.loc13, %.loc13_32.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_32.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_22: = bound_method %int_0.loc13, %impl.elem0.loc13_22 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc13_22: = specific_function %Convert.bound.loc13_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc13_22: init %i32 = call %Convert.specific_fn.loc13_22(%int_0.loc13) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_22.1: %i32 = value_of_initializer %int.convert_checked.loc13_22 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_22.2: %i32 = converted %int_0.loc13, %.loc13_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_33.1: %i32 = value_of_initializer %int.snegate.loc13 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc13_33.2: %i32 = converted %int.snegate.loc13, %.loc13_33.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.less.loc13: init bool = call %Less.ref.loc13(%.loc13_22.2, %.loc13_33.2) [template = constants.%false] -// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %int.less.loc13 [template = constants.%false] -// CHECK:STDOUT: %.loc13_14.2: bool = converted %int.less.loc13, %.loc13_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc13: -// CHECK:STDOUT: %True.ref.loc13: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc13(%True.ref.loc13) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc13: -// CHECK:STDOUT: %False.ref.loc13: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc13(%False.ref.loc13) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc13: -// CHECK:STDOUT: %.loc13_14.3: type = block_arg !if.expr.result.loc13 [template = constants.%False] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Less.ref: %Less.type.1 = name_ref Less, file.%Less.decl [template = constants.%Less.1] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.less: init bool = call %Less.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc17_20.1: bool = value_of_initializer %int.less -// CHECK:STDOUT: %.loc17_20.2: bool = converted %int.less, %.loc17_20.1 -// CHECK:STDOUT: return %.loc17_20.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/less_eq.carbon b/toolchain/check/testdata/builtins/int/less_eq.carbon index 3f8d683fed8b7..6ae44f2efd2d0 100644 --- a/toolchain/check/testdata/builtins/int/less_eq.carbon +++ b/toolchain/check/testdata/builtins/int/less_eq.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/less_eq.carbon @@ -24,353 +26,6 @@ fn F(true_: True, false_: False) { false_ as (if LessEq(0, Negate(1)) then True else False); } -fn RuntimeCall(a: i32, b: i32) -> bool { +fn RuntimeCallIsValid(a: i32, b: i32) -> bool { return LessEq(a, b); } - -// CHECK:STDOUT: --- int_less_eq.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: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %LessEq.type: type = fn_type @LessEq [template] -// CHECK:STDOUT: %LessEq: %LessEq.type = struct_value () [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %False: type = class_type @False [template] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %true: bool = bool_literal true [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %false: bool = bool_literal false [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.6 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .LessEq = %LessEq.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %LessEq.decl: %LessEq.type = fn_decl @LessEq [template = constants.%LessEq] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_30.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc2_30.2: type = converted %bool.make_type, %.loc2_30.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_14: type = splice_block %i32.loc2_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_22: type = splice_block %i32.loc2_22 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc3_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc3: type = splice_block %i32.loc3_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc3_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc3_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} -// CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ -// CHECK:STDOUT: %true_.param_patt: %True = value_param_pattern %true_.patt, runtime_param0 -// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ -// CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param -// CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc16_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc16_35.2: type = converted %bool.make_type, %.loc16_35.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc16_19: type = splice_block %i32.loc16_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc16_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc16_27: type = splice_block %i32.loc16_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc16_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc16_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%True -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%False -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @LessEq(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.less_eq"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %true_.ref.loc9: %True = name_ref true_, %true_ -// CHECK:STDOUT: %LessEq.ref.loc9: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_23: = bound_method %int_1.loc9, %impl.elem0.loc9_23 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_23: = specific_function %Convert.bound.loc9_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %Convert.specific_fn.loc9_23(%int_1.loc9) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_23.1: %i32 = value_of_initializer %int.convert_checked.loc9_23 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_23.2: %i32 = converted %int_1.loc9, %.loc9_23.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_26: = bound_method %int_2, %impl.elem0.loc9_26 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_26: = specific_function %Convert.bound.loc9_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_26: init %i32 = call %Convert.specific_fn.loc9_26(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_26.1: %i32 = value_of_initializer %int.convert_checked.loc9_26 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_26.2: %i32 = converted %int_2, %.loc9_26.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.less_eq.loc9: init bool = call %LessEq.ref.loc9(%.loc9_23.2, %.loc9_26.2) [template = constants.%true] -// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.less_eq.loc9 [template = constants.%true] -// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.less_eq.loc9, %.loc9_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc9_13.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc9: -// CHECK:STDOUT: %True.ref.loc9: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc9(%True.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc9: -// CHECK:STDOUT: %False.ref.loc9: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc9(%False.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc9: -// CHECK:STDOUT: %.loc9_13.3: type = block_arg !if.expr.result.loc9 [template = constants.%True] -// CHECK:STDOUT: %true_.ref.loc10: %True = name_ref true_, %true_ -// CHECK:STDOUT: %LessEq.ref.loc10: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %int_1.loc10_23: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_1.loc10_26: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_23: = bound_method %int_1.loc10_23, %impl.elem0.loc10_23 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_23: = specific_function %Convert.bound.loc10_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_23: init %i32 = call %Convert.specific_fn.loc10_23(%int_1.loc10_23) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_23.1: %i32 = value_of_initializer %int.convert_checked.loc10_23 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_23.2: %i32 = converted %int_1.loc10_23, %.loc10_23.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_26: = bound_method %int_1.loc10_26, %impl.elem0.loc10_26 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_26: = specific_function %Convert.bound.loc10_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %Convert.specific_fn.loc10_26(%int_1.loc10_26) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked.loc10_26 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_26.2: %i32 = converted %int_1.loc10_26, %.loc10_26.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.less_eq.loc10: init bool = call %LessEq.ref.loc10(%.loc10_23.2, %.loc10_26.2) [template = constants.%true] -// CHECK:STDOUT: %.loc10_13.1: bool = value_of_initializer %int.less_eq.loc10 [template = constants.%true] -// CHECK:STDOUT: %.loc10_13.2: bool = converted %int.less_eq.loc10, %.loc10_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc10_13.2 br !if.expr.then.loc10 else br !if.expr.else.loc10 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc10: -// CHECK:STDOUT: %True.ref.loc10: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc10(%True.ref.loc10) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc10: -// CHECK:STDOUT: %False.ref.loc10: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc10(%False.ref.loc10) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc10: -// CHECK:STDOUT: %.loc10_13.3: type = block_arg !if.expr.result.loc10 [template = constants.%True] -// CHECK:STDOUT: %false_.ref.loc11: %False = name_ref false_, %false_ -// CHECK:STDOUT: %LessEq.ref.loc11: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc11_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_24: = bound_method %int_1.loc11, %impl.elem0.loc11_24 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc11_24: = specific_function %Convert.bound.loc11_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc11_24: init %i32 = call %Convert.specific_fn.loc11_24(%int_1.loc11) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc11_24.1: %i32 = value_of_initializer %int.convert_checked.loc11_24 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc11_24.2: %i32 = converted %int_1.loc11, %.loc11_24.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc11_27: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_27: = bound_method %int_0.loc11, %impl.elem0.loc11_27 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc11_27: = specific_function %Convert.bound.loc11_27, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc11_27: init %i32 = call %Convert.specific_fn.loc11_27(%int_0.loc11) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_27.1: %i32 = value_of_initializer %int.convert_checked.loc11_27 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_27.2: %i32 = converted %int_0.loc11, %.loc11_27.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.less_eq.loc11: init bool = call %LessEq.ref.loc11(%.loc11_24.2, %.loc11_27.2) [template = constants.%false] -// CHECK:STDOUT: %.loc11_14.1: bool = value_of_initializer %int.less_eq.loc11 [template = constants.%false] -// CHECK:STDOUT: %.loc11_14.2: bool = converted %int.less_eq.loc11, %.loc11_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc11_14.2 br !if.expr.then.loc11 else br !if.expr.else.loc11 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc11: -// CHECK:STDOUT: %True.ref.loc11: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc11(%True.ref.loc11) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc11: -// CHECK:STDOUT: %False.ref.loc11: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc11(%False.ref.loc11) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc11: -// CHECK:STDOUT: %.loc11_14.3: type = block_arg !if.expr.result.loc11 [template = constants.%False] -// CHECK:STDOUT: %true_.ref.loc12: %True = name_ref true_, %true_ -// CHECK:STDOUT: %LessEq.ref.loc12: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc12: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc12_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_30: = bound_method %int_1.loc12, %impl.elem0.loc12_30 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_30: = specific_function %Convert.bound.loc12_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_30: init %i32 = call %Convert.specific_fn.loc12_30(%int_1.loc12) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_30.1: %i32 = value_of_initializer %int.convert_checked.loc12_30 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_30.2: %i32 = converted %int_1.loc12, %.loc12_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_30.2) [template = constants.%int_-1] -// CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %.loc12_31.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc12_31.2: %i32 = converted %int.snegate.loc12, %.loc12_31.1 [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc12_34: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_34: = bound_method %int_0.loc12, %impl.elem0.loc12_34 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc12_34: = specific_function %Convert.bound.loc12_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc12_34: init %i32 = call %Convert.specific_fn.loc12_34(%int_0.loc12) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_34.1: %i32 = value_of_initializer %int.convert_checked.loc12_34 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_34.2: %i32 = converted %int_0.loc12, %.loc12_34.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_31.2, %.loc12_34.2) [template = constants.%true] -// CHECK:STDOUT: %.loc12_13.1: bool = value_of_initializer %int.less_eq.loc12 [template = constants.%true] -// CHECK:STDOUT: %.loc12_13.2: bool = converted %int.less_eq.loc12, %.loc12_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc12_13.2 br !if.expr.then.loc12 else br !if.expr.else.loc12 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc12: -// CHECK:STDOUT: %True.ref.loc12: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc12(%True.ref.loc12) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc12: -// CHECK:STDOUT: %False.ref.loc12: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc12(%False.ref.loc12) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc12: -// CHECK:STDOUT: %.loc12_13.3: type = block_arg !if.expr.result.loc12 [template = constants.%True] -// CHECK:STDOUT: %false_.ref.loc13: %False = name_ref false_, %false_ -// CHECK:STDOUT: %LessEq.ref.loc13: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %int_0.loc13: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %Negate.ref.loc13: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc13_34: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_34: = bound_method %int_1.loc13, %impl.elem0.loc13_34 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc13_34: = specific_function %Convert.bound.loc13_34, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc13_34: init %i32 = call %Convert.specific_fn.loc13_34(%int_1.loc13) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_34.1: %i32 = value_of_initializer %int.convert_checked.loc13_34 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_34.2: %i32 = converted %int_1.loc13, %.loc13_34.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc13: init %i32 = call %Negate.ref.loc13(%.loc13_34.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc13_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_24: = bound_method %int_0.loc13, %impl.elem0.loc13_24 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc13_24: = specific_function %Convert.bound.loc13_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc13_24: init %i32 = call %Convert.specific_fn.loc13_24(%int_0.loc13) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_24.1: %i32 = value_of_initializer %int.convert_checked.loc13_24 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_24.2: %i32 = converted %int_0.loc13, %.loc13_24.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc13_35.1: %i32 = value_of_initializer %int.snegate.loc13 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc13_35.2: %i32 = converted %int.snegate.loc13, %.loc13_35.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.less_eq.loc13: init bool = call %LessEq.ref.loc13(%.loc13_24.2, %.loc13_35.2) [template = constants.%false] -// CHECK:STDOUT: %.loc13_14.1: bool = value_of_initializer %int.less_eq.loc13 [template = constants.%false] -// CHECK:STDOUT: %.loc13_14.2: bool = converted %int.less_eq.loc13, %.loc13_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc13_14.2 br !if.expr.then.loc13 else br !if.expr.else.loc13 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc13: -// CHECK:STDOUT: %True.ref.loc13: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc13(%True.ref.loc13) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc13: -// CHECK:STDOUT: %False.ref.loc13: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc13(%False.ref.loc13) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc13: -// CHECK:STDOUT: %.loc13_14.3: type = block_arg !if.expr.result.loc13 [template = constants.%False] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %LessEq.ref: %LessEq.type = name_ref LessEq, file.%LessEq.decl [template = constants.%LessEq] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.less_eq: init bool = call %LessEq.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc17_22.1: bool = value_of_initializer %int.less_eq -// CHECK:STDOUT: %.loc17_22.2: bool = converted %int.less_eq, %.loc17_22.1 -// CHECK:STDOUT: return %.loc17_22.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/make_type_signed.carbon b/toolchain/check/testdata/builtins/int/make_type_signed.carbon index 7216669f4394d..d03c141203508 100644 --- a/toolchain/check/testdata/builtins/int/make_type_signed.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/make_type_signed.carbon @@ -88,529 +90,3 @@ import library "types"; // CHECK:STDERR: var m: Int(1000000000); // CHECK:STDERR: ^~~~~~~~~~~~~~~ var m: Int(1000000000); - -// CHECK:STDOUT: --- types.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl -// CHECK:STDOUT: .Int = %Int.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { -// CHECK:STDOUT: %return.patt: type = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Int.decl: %Int.type = fn_decl @Int [template = constants.%Int] { -// CHECK:STDOUT: %n.patt: Core.IntLiteral = binding_pattern n -// CHECK:STDOUT: %n.param_patt: Core.IntLiteral = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: type = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 -// CHECK:STDOUT: %.loc5_22.1: type = splice_block %.loc5_22.3 [template = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_22.3: type = converted %int_literal.make_type, %.loc5_22.2 [template = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed"; -// CHECK:STDOUT: -// CHECK:STDOUT: --- use_types.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [template] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %int_13: Core.IntLiteral = int_value 13 [template] -// CHECK:STDOUT: %i13.builtin: type = int_type signed, %int_13 [template] -// CHECK:STDOUT: %G.type: type = fn_type @G [template] -// CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] -// CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %iN.builtin [symbolic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Main//types, IntLiteral, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, Int, loaded [template = constants.%Int] -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 -// CHECK:STDOUT: .Int = imports.%import_ref.2 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .Symbolic = %Symbolic.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %n.patt: %i64.builtin = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i64.builtin = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i64.builtin = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i64.builtin = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc6_21: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_64.loc6_25: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc6_27: init type = call %Int.ref.loc6_21(%int_64.loc6_25) [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc6_27.1: type = value_of_initializer %int.make_type_signed.loc6_27 [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc6_27.2: type = converted %int.make_type_signed.loc6_27, %.loc6_27.1 [template = constants.%i64.builtin] -// CHECK:STDOUT: %n.param: %i64.builtin = value_param runtime_param0 -// CHECK:STDOUT: %.loc6_15.1: type = splice_block %.loc6_15.3 [template = constants.%i64.builtin] { -// CHECK:STDOUT: %Int.ref.loc6_9: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_64.loc6_13: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc6_15: init type = call %Int.ref.loc6_9(%int_64.loc6_13) [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc6_15.2: type = value_of_initializer %int.make_type_signed.loc6_15 [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc6_15.3: type = converted %int.make_type_signed.loc6_15, %.loc6_15.2 [template = constants.%i64.builtin] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: %i64.builtin = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i64.builtin = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i64.builtin = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %n.patt: %i13.builtin = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i13.builtin = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i13.builtin = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i13.builtin = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc10_21: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_13.loc10_25: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_signed.loc10_27: init type = call %Int.ref.loc10_21(%int_13.loc10_25) [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc10_27.1: type = value_of_initializer %int.make_type_signed.loc10_27 [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc10_27.2: type = converted %int.make_type_signed.loc10_27, %.loc10_27.1 [template = constants.%i13.builtin] -// CHECK:STDOUT: %n.param: %i13.builtin = value_param runtime_param0 -// CHECK:STDOUT: %.loc10_15.1: type = splice_block %.loc10_15.3 [template = constants.%i13.builtin] { -// CHECK:STDOUT: %Int.ref.loc10_9: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_13.loc10_13: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_signed.loc10_15: init type = call %Int.ref.loc10_9(%int_13.loc10_13) [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc10_15.2: type = value_of_initializer %int.make_type_signed.loc10_15 [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc10_15.3: type = converted %int.make_type_signed.loc10_15, %.loc10_15.2 [template = constants.%i13.builtin] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: %i13.builtin = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i13.builtin = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i13.builtin = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Symbolic.decl: %Symbolic.type = fn_decl @Symbolic [template = constants.%Symbolic] { -// CHECK:STDOUT: %N.patt.loc14_13.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc14_13.1, runtime_param [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] -// CHECK:STDOUT: %x.patt: @Symbolic.%iN.builtin (%iN.builtin) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @Symbolic.%iN.builtin (%iN.builtin) = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: @Symbolic.%iN.builtin (%iN.builtin) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Symbolic.%iN.builtin (%iN.builtin) = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc14_45: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %N.ref.loc14_49: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_signed.loc14_50: init type = call %Int.ref.loc14_45(%N.ref.loc14_49) [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: %.loc14_50.1: type = value_of_initializer %int.make_type_signed.loc14_50 [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: %.loc14_50.2: type = converted %int.make_type_signed.loc14_50, %.loc14_50.1 [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param -// CHECK:STDOUT: %.loc14_28.1: type = splice_block %.loc14_28.3 [template = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_28.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_28.3: type = converted %int_literal.make_type, %.loc14_28.2 [template = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc14_13.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %x.param: @Symbolic.%iN.builtin (%iN.builtin) = value_param runtime_param0 -// CHECK:STDOUT: %.loc14_39.1: type = splice_block %.loc14_39.3 [symbolic = %iN.builtin (constants.%iN.builtin)] { -// CHECK:STDOUT: %Int.ref.loc14_34: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %N.ref.loc14_38: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_signed.loc14_39: init type = call %Int.ref.loc14_34(%N.ref.loc14_38) [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: %.loc14_39.2: type = value_of_initializer %int.make_type_signed.loc14_39 [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: %.loc14_39.3: type = converted %int.make_type_signed.loc14_39, %.loc14_39.2 [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %x: @Symbolic.%iN.builtin (%iN.builtin) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @Symbolic.%iN.builtin (%iN.builtin) = out_param runtime_param1 -// CHECK:STDOUT: %return: ref @Symbolic.%iN.builtin (%iN.builtin) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "types.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt: %i64.builtin) -> %i64.builtin { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %i64.builtin = name_ref n, %n -// CHECK:STDOUT: return %n.ref -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n.param_patt: %i13.builtin) -> %i13.builtin { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %i13.builtin = name_ref n, %n -// CHECK:STDOUT: return %n.ref -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type" [from "types.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Symbolic(%N.loc14_13.1: Core.IntLiteral) { -// CHECK:STDOUT: %N.loc14_13.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc14_13.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N.loc14_13.2 [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%iN.builtin (%iN.builtin) [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%iN.builtin (%iN.builtin)) -> @Symbolic.%iN.builtin (%iN.builtin) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: @Symbolic.%iN.builtin (%iN.builtin) = name_ref x, %x -// CHECK:STDOUT: return %x.ref -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Symbolic(constants.%N) { -// CHECK:STDOUT: %N.loc14_13.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc14_13.2 => constants.%N -// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- import_types.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %i64.builtin: type = int_type signed, %int_64 [template] -// CHECK:STDOUT: %UseF.type: type = fn_type @UseF [template] -// CHECK:STDOUT: %UseF: %UseF.type = struct_value () [template] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %int_13: Core.IntLiteral = int_value 13 [template] -// CHECK:STDOUT: %i13.builtin: type = int_type signed, %int_13 [template] -// CHECK:STDOUT: %UseG.type: type = fn_type @UseG [template] -// CHECK:STDOUT: %UseG: %UseG.type = struct_value () [template] -// CHECK:STDOUT: %G.type: type = fn_type @G [template] -// CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %int_24: Core.IntLiteral = int_value 24 [template] -// CHECK:STDOUT: %i24.builtin: type = int_type signed, %int_24 [template] -// CHECK:STDOUT: %UseSymbolic.type: type = fn_type @UseSymbolic [template] -// CHECK:STDOUT: %UseSymbolic: %UseSymbolic.type = struct_value () [template] -// CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] -// CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %require_complete: = require_complete_type %iN.builtin [symbolic] -// CHECK:STDOUT: %Symbolic.specific_fn: = specific_function %Symbolic, @Symbolic(%int_24) [template] -// CHECK:STDOUT: %complete_type: = complete_type_witness %i24.builtin [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, Int, loaded [template = constants.%Int] -// CHECK:STDOUT: %import_ref.3: %F.type = import_ref Main//use_types, F, loaded [template = constants.%F] -// CHECK:STDOUT: %import_ref.4: %G.type = import_ref Main//use_types, G, loaded [template = constants.%G] -// CHECK:STDOUT: %import_ref.5: %Symbolic.type = import_ref Main//use_types, Symbolic, loaded [template = constants.%Symbolic] -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 -// CHECK:STDOUT: .Int = imports.%import_ref.2 -// CHECK:STDOUT: .F = imports.%import_ref.3 -// CHECK:STDOUT: .G = imports.%import_ref.4 -// CHECK:STDOUT: .Symbolic = imports.%import_ref.5 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .UseF = %UseF.decl -// CHECK:STDOUT: .UseG = %UseG.decl -// CHECK:STDOUT: .UseSymbolic = %UseSymbolic.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %UseF.decl: %UseF.type = fn_decl @UseF [template = constants.%UseF] { -// CHECK:STDOUT: %n.patt: %i64.builtin = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i64.builtin = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i64.builtin = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i64.builtin = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc7_24: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_64.loc7_28: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc7_30: init type = call %Int.ref.loc7_24(%int_64.loc7_28) [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc7_30.1: type = value_of_initializer %int.make_type_signed.loc7_30 [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc7_30.2: type = converted %int.make_type_signed.loc7_30, %.loc7_30.1 [template = constants.%i64.builtin] -// CHECK:STDOUT: %n.param: %i64.builtin = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_18.1: type = splice_block %.loc7_18.3 [template = constants.%i64.builtin] { -// CHECK:STDOUT: %Int.ref.loc7_12: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_64.loc7_16: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_signed.loc7_18: init type = call %Int.ref.loc7_12(%int_64.loc7_16) [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc7_18.2: type = value_of_initializer %int.make_type_signed.loc7_18 [template = constants.%i64.builtin] -// CHECK:STDOUT: %.loc7_18.3: type = converted %int.make_type_signed.loc7_18, %.loc7_18.2 [template = constants.%i64.builtin] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: %i64.builtin = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i64.builtin = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i64.builtin = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %UseG.decl: %UseG.type = fn_decl @UseG [template = constants.%UseG] { -// CHECK:STDOUT: %n.patt: %i13.builtin = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i13.builtin = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i13.builtin = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i13.builtin = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc11_24: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_13.loc11_28: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_signed.loc11_30: init type = call %Int.ref.loc11_24(%int_13.loc11_28) [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc11_30.1: type = value_of_initializer %int.make_type_signed.loc11_30 [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc11_30.2: type = converted %int.make_type_signed.loc11_30, %.loc11_30.1 [template = constants.%i13.builtin] -// CHECK:STDOUT: %n.param: %i13.builtin = value_param runtime_param0 -// CHECK:STDOUT: %.loc11_18.1: type = splice_block %.loc11_18.3 [template = constants.%i13.builtin] { -// CHECK:STDOUT: %Int.ref.loc11_12: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_13.loc11_16: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_signed.loc11_18: init type = call %Int.ref.loc11_12(%int_13.loc11_16) [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc11_18.2: type = value_of_initializer %int.make_type_signed.loc11_18 [template = constants.%i13.builtin] -// CHECK:STDOUT: %.loc11_18.3: type = converted %int.make_type_signed.loc11_18, %.loc11_18.2 [template = constants.%i13.builtin] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: %i13.builtin = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i13.builtin = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i13.builtin = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %UseSymbolic.decl: %UseSymbolic.type = fn_decl @UseSymbolic [template = constants.%UseSymbolic] { -// CHECK:STDOUT: %n.patt: %i24.builtin = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i24.builtin = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i24.builtin = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i24.builtin = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Int.ref.loc15_31: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_24.loc15_35: Core.IntLiteral = int_value 24 [template = constants.%int_24] -// CHECK:STDOUT: %int.make_type_signed.loc15_37: init type = call %Int.ref.loc15_31(%int_24.loc15_35) [template = constants.%i24.builtin] -// CHECK:STDOUT: %.loc15_37.1: type = value_of_initializer %int.make_type_signed.loc15_37 [template = constants.%i24.builtin] -// CHECK:STDOUT: %.loc15_37.2: type = converted %int.make_type_signed.loc15_37, %.loc15_37.1 [template = constants.%i24.builtin] -// CHECK:STDOUT: %n.param: %i24.builtin = value_param runtime_param0 -// CHECK:STDOUT: %.loc15_25.1: type = splice_block %.loc15_25.3 [template = constants.%i24.builtin] { -// CHECK:STDOUT: %Int.ref.loc15_19: %Int.type = name_ref Int, imports.%import_ref.2 [template = constants.%Int] -// CHECK:STDOUT: %int_24.loc15_23: Core.IntLiteral = int_value 24 [template = constants.%int_24] -// CHECK:STDOUT: %int.make_type_signed.loc15_25: init type = call %Int.ref.loc15_19(%int_24.loc15_23) [template = constants.%i24.builtin] -// CHECK:STDOUT: %.loc15_25.2: type = value_of_initializer %int.make_type_signed.loc15_25 [template = constants.%i24.builtin] -// CHECK:STDOUT: %.loc15_25.3: type = converted %int.make_type_signed.loc15_25, %.loc15_25.2 [template = constants.%i24.builtin] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: %i24.builtin = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i24.builtin = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i24.builtin = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "types.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @UseF(%n.param_patt: %i64.builtin) -> %i64.builtin { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.3 [template = constants.%F] -// CHECK:STDOUT: %n.ref: %i64.builtin = name_ref n, %n -// CHECK:STDOUT: %F.call: init %i64.builtin = call %F.ref(%n.ref) -// CHECK:STDOUT: %.loc8_14.1: %i64.builtin = value_of_initializer %F.call -// CHECK:STDOUT: %.loc8_14.2: %i64.builtin = converted %F.call, %.loc8_14.1 -// CHECK:STDOUT: return %.loc8_14.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt: %i64.builtin) -> %i64.builtin [from "use_types.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @UseG(%n.param_patt: %i13.builtin) -> %i13.builtin { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %G.ref: %G.type = name_ref G, imports.%import_ref.4 [template = constants.%G] -// CHECK:STDOUT: %n.ref: %i13.builtin = name_ref n, %n -// CHECK:STDOUT: %G.call: init %i13.builtin = call %G.ref(%n.ref) -// CHECK:STDOUT: %.loc12_14.1: %i13.builtin = value_of_initializer %G.call -// CHECK:STDOUT: %.loc12_14.2: %i13.builtin = converted %G.call, %.loc12_14.1 -// CHECK:STDOUT: return %.loc12_14.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n.param_patt: %i13.builtin) -> %i13.builtin [from "use_types.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @UseSymbolic(%n.param_patt: %i24.builtin) -> %i24.builtin { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Symbolic.ref: %Symbolic.type = name_ref Symbolic, imports.%import_ref.5 [template = constants.%Symbolic] -// CHECK:STDOUT: %int_24.loc16: Core.IntLiteral = int_value 24 [template = constants.%int_24] -// CHECK:STDOUT: %n.ref: %i24.builtin = name_ref n, %n -// CHECK:STDOUT: %Symbolic.specific_fn: = specific_function %Symbolic.ref, @Symbolic(constants.%int_24) [template = constants.%Symbolic.specific_fn] -// CHECK:STDOUT: %Symbolic.call: init %i24.builtin = call %Symbolic.specific_fn(%n.ref) -// CHECK:STDOUT: %.loc16_25.1: %i24.builtin = value_of_initializer %Symbolic.call -// CHECK:STDOUT: %.loc16_25.2: %i24.builtin = converted %Symbolic.call, %.loc16_25.1 -// CHECK:STDOUT: return %.loc16_25.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Symbolic(constants.%N: Core.IntLiteral) [from "use_types.carbon"] { -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N (constants.%N)] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt (constants.%N.patt)] -// CHECK:STDOUT: %iN.builtin: type = int_type signed, %N [symbolic = %iN.builtin (constants.%iN.builtin)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%iN.builtin (%iN.builtin) [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%iN.builtin (%iN.builtin)) -> @Symbolic.%iN.builtin (%iN.builtin); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Symbolic(constants.%N) { -// CHECK:STDOUT: %N => constants.%N -// CHECK:STDOUT: %N.patt => constants.%N -// CHECK:STDOUT: %iN.builtin => constants.%iN.builtin -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Symbolic(constants.%int_24) { -// CHECK:STDOUT: %N => constants.%int_24 -// CHECK:STDOUT: %N.patt => constants.%int_24 -// CHECK:STDOUT: %iN.builtin => constants.%i24.builtin -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_zero_size.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, Int, loaded [template = constants.%Int] -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 -// CHECK:STDOUT: .Int = imports.%import_ref.2 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .n = %n -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %n.var: ref = var n -// CHECK:STDOUT: %n: ref = bind_name n, %n.var -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "types.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_negative_size.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = class_type @Int.2, @Int.2(%int_32) [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %Int.type.2: type = fn_type @Int.1 [template] -// CHECK:STDOUT: %Int.2: %Int.type.2 = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.2: %Int.type.2 = import_ref Main//types, Int, loaded [template = constants.%Int.2] -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.3 -// CHECK:STDOUT: .ImplicitAs = %import_ref.7 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 -// CHECK:STDOUT: .Int = imports.%import_ref.2 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .n = %n -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int.2, @Int.2(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int.2, @Int.2(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %n.var: ref = var n -// CHECK:STDOUT: %n: ref = bind_name n, %n.var -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%n.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int.1(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "types.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_oversized.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %Int.type: type = fn_type @Int [template] -// CHECK:STDOUT: %Int: %Int.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.2: %Int.type = import_ref Main//types, Int, loaded [template = constants.%Int] -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 -// CHECK:STDOUT: .Int = imports.%import_ref.2 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .m = %m -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %m.var: ref = var m -// CHECK:STDOUT: %m: ref = bind_name m, %m.var -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Int(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_signed" [from "types.carbon"]; -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon index 4ebec9cc81017..6fc8961c2a120 100644 --- a/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon +++ b/toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/make_type_unsigned.carbon @@ -69,337 +71,3 @@ import library "types"; // CHECK:STDERR: var m: UInt(1000000000); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ var m: UInt(1000000000); - -// CHECK:STDOUT: --- types.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl -// CHECK:STDOUT: .UInt = %UInt.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { -// CHECK:STDOUT: %return.patt: type = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %UInt.decl: %UInt.type = fn_decl @UInt [template = constants.%UInt] { -// CHECK:STDOUT: %n.patt: Core.IntLiteral = binding_pattern n -// CHECK:STDOUT: %n.param_patt: Core.IntLiteral = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: type = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %n.param: Core.IntLiteral = value_param runtime_param0 -// CHECK:STDOUT: %.loc5_23.1: type = splice_block %.loc5_23.3 [template = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, file.%IntLiteral.decl [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_23.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc5_23.3: type = converted %int_literal.make_type, %.loc5_23.2 [template = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: Core.IntLiteral = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref type = out_param runtime_param1 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned"; -// CHECK:STDOUT: -// CHECK:STDOUT: --- use_types.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template] -// CHECK:STDOUT: %u64.builtin: type = int_type unsigned, %int_64 [template] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %int_13: Core.IntLiteral = int_value 13 [template] -// CHECK:STDOUT: %u13.builtin: type = int_type unsigned, %int_13 [template] -// CHECK:STDOUT: %G.type: type = fn_type @G [template] -// CHECK:STDOUT: %G: %G.type = struct_value () [template] -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] -// CHECK:STDOUT: %N: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %uN.builtin: type = int_type unsigned, %N [symbolic] -// CHECK:STDOUT: %Symbolic.type: type = fn_type @Symbolic [template] -// CHECK:STDOUT: %Symbolic: %Symbolic.type = struct_value () [template] -// CHECK:STDOUT: %require_complete: = require_complete_type %uN.builtin [symbolic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1: %IntLiteral.type = import_ref Main//types, IntLiteral, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, UInt, loaded [template = constants.%UInt] -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 -// CHECK:STDOUT: .UInt = imports.%import_ref.2 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .G = %G.decl -// CHECK:STDOUT: .Symbolic = %Symbolic.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %n.patt: %u64.builtin = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %u64.builtin = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u64.builtin = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u64.builtin = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %UInt.ref.loc6_22: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %int_64.loc6_27: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_29: init type = call %UInt.ref.loc6_22(%int_64.loc6_27) [template = constants.%u64.builtin] -// CHECK:STDOUT: %.loc6_29.1: type = value_of_initializer %int.make_type_unsigned.loc6_29 [template = constants.%u64.builtin] -// CHECK:STDOUT: %.loc6_29.2: type = converted %int.make_type_unsigned.loc6_29, %.loc6_29.1 [template = constants.%u64.builtin] -// CHECK:STDOUT: %n.param: %u64.builtin = value_param runtime_param0 -// CHECK:STDOUT: %.loc6_16.1: type = splice_block %.loc6_16.3 [template = constants.%u64.builtin] { -// CHECK:STDOUT: %UInt.ref.loc6_9: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %int_64.loc6_14: Core.IntLiteral = int_value 64 [template = constants.%int_64] -// CHECK:STDOUT: %int.make_type_unsigned.loc6_16: init type = call %UInt.ref.loc6_9(%int_64.loc6_14) [template = constants.%u64.builtin] -// CHECK:STDOUT: %.loc6_16.2: type = value_of_initializer %int.make_type_unsigned.loc6_16 [template = constants.%u64.builtin] -// CHECK:STDOUT: %.loc6_16.3: type = converted %int.make_type_unsigned.loc6_16, %.loc6_16.2 [template = constants.%u64.builtin] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: %u64.builtin = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %u64.builtin = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u64.builtin = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [template = constants.%G] { -// CHECK:STDOUT: %n.patt: %u13.builtin = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %u13.builtin = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u13.builtin = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u13.builtin = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %UInt.ref.loc10_22: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %int_13.loc10_27: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_unsigned.loc10_29: init type = call %UInt.ref.loc10_22(%int_13.loc10_27) [template = constants.%u13.builtin] -// CHECK:STDOUT: %.loc10_29.1: type = value_of_initializer %int.make_type_unsigned.loc10_29 [template = constants.%u13.builtin] -// CHECK:STDOUT: %.loc10_29.2: type = converted %int.make_type_unsigned.loc10_29, %.loc10_29.1 [template = constants.%u13.builtin] -// CHECK:STDOUT: %n.param: %u13.builtin = value_param runtime_param0 -// CHECK:STDOUT: %.loc10_16.1: type = splice_block %.loc10_16.3 [template = constants.%u13.builtin] { -// CHECK:STDOUT: %UInt.ref.loc10_9: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %int_13.loc10_14: Core.IntLiteral = int_value 13 [template = constants.%int_13] -// CHECK:STDOUT: %int.make_type_unsigned.loc10_16: init type = call %UInt.ref.loc10_9(%int_13.loc10_14) [template = constants.%u13.builtin] -// CHECK:STDOUT: %.loc10_16.2: type = value_of_initializer %int.make_type_unsigned.loc10_16 [template = constants.%u13.builtin] -// CHECK:STDOUT: %.loc10_16.3: type = converted %int.make_type_unsigned.loc10_16, %.loc10_16.2 [template = constants.%u13.builtin] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: %u13.builtin = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %u13.builtin = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u13.builtin = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Symbolic.decl: %Symbolic.type = fn_decl @Symbolic [template = constants.%Symbolic] { -// CHECK:STDOUT: %N.patt.loc14_13.1: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] -// CHECK:STDOUT: %N.param_patt: Core.IntLiteral = value_param_pattern %N.patt.loc14_13.1, runtime_param [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] -// CHECK:STDOUT: %x.patt: @Symbolic.%uN.builtin (%uN.builtin) = binding_pattern x -// CHECK:STDOUT: %x.param_patt: @Symbolic.%uN.builtin (%uN.builtin) = value_param_pattern %x.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: @Symbolic.%uN.builtin (%uN.builtin) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Symbolic.%uN.builtin (%uN.builtin) = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %UInt.ref.loc14_46: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %N.ref.loc14_51: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_unsigned.loc14_52: init type = call %UInt.ref.loc14_46(%N.ref.loc14_51) [symbolic = %uN.builtin (constants.%uN.builtin)] -// CHECK:STDOUT: %.loc14_52.1: type = value_of_initializer %int.make_type_unsigned.loc14_52 [symbolic = %uN.builtin (constants.%uN.builtin)] -// CHECK:STDOUT: %.loc14_52.2: type = converted %int.make_type_unsigned.loc14_52, %.loc14_52.1 [symbolic = %uN.builtin (constants.%uN.builtin)] -// CHECK:STDOUT: %N.param: Core.IntLiteral = value_param runtime_param -// CHECK:STDOUT: %.loc14_28.1: type = splice_block %.loc14_28.3 [template = Core.IntLiteral] { -// CHECK:STDOUT: %IntLiteral.ref: %IntLiteral.type = name_ref IntLiteral, imports.%import_ref.1 [template = constants.%IntLiteral] -// CHECK:STDOUT: %int_literal.make_type: init type = call %IntLiteral.ref() [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_28.2: type = value_of_initializer %int_literal.make_type [template = Core.IntLiteral] -// CHECK:STDOUT: %.loc14_28.3: type = converted %int_literal.make_type, %.loc14_28.2 [template = Core.IntLiteral] -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc14_13.1: Core.IntLiteral = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %x.param: @Symbolic.%uN.builtin (%uN.builtin) = value_param runtime_param0 -// CHECK:STDOUT: %.loc14_40.1: type = splice_block %.loc14_40.3 [symbolic = %uN.builtin (constants.%uN.builtin)] { -// CHECK:STDOUT: %UInt.ref.loc14_34: %UInt.type = name_ref UInt, imports.%import_ref.2 [template = constants.%UInt] -// CHECK:STDOUT: %N.ref.loc14_39: Core.IntLiteral = name_ref N, %N.loc14_13.1 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %int.make_type_unsigned.loc14_40: init type = call %UInt.ref.loc14_34(%N.ref.loc14_39) [symbolic = %uN.builtin (constants.%uN.builtin)] -// CHECK:STDOUT: %.loc14_40.2: type = value_of_initializer %int.make_type_unsigned.loc14_40 [symbolic = %uN.builtin (constants.%uN.builtin)] -// CHECK:STDOUT: %.loc14_40.3: type = converted %int.make_type_unsigned.loc14_40, %.loc14_40.2 [symbolic = %uN.builtin (constants.%uN.builtin)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %x: @Symbolic.%uN.builtin (%uN.builtin) = bind_name x, %x.param -// CHECK:STDOUT: %return.param: ref @Symbolic.%uN.builtin (%uN.builtin) = out_param runtime_param1 -// CHECK:STDOUT: %return: ref @Symbolic.%uN.builtin (%uN.builtin) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned" [from "types.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%n.param_patt: %u64.builtin) -> %u64.builtin { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %u64.builtin = name_ref n, %n -// CHECK:STDOUT: return %n.ref -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @G(%n.param_patt: %u13.builtin) -> %u13.builtin { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %n.ref: %u13.builtin = name_ref n, %n -// CHECK:STDOUT: return %n.ref -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type" [from "types.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Symbolic(%N.loc14_13.1: Core.IntLiteral) { -// CHECK:STDOUT: %N.loc14_13.2: Core.IntLiteral = bind_symbolic_name N, 0 [symbolic = %N.loc14_13.2 (constants.%N)] -// CHECK:STDOUT: %N.patt.loc14_13.2: Core.IntLiteral = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc14_13.2 (constants.%N.patt)] -// CHECK:STDOUT: %uN.builtin: type = int_type unsigned, %N.loc14_13.2 [symbolic = %uN.builtin (constants.%uN.builtin)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Symbolic.%uN.builtin (%uN.builtin) [symbolic = %require_complete (constants.%require_complete)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: Core.IntLiteral, %x.param_patt: @Symbolic.%uN.builtin (%uN.builtin)) -> @Symbolic.%uN.builtin (%uN.builtin) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %x.ref: @Symbolic.%uN.builtin (%uN.builtin) = name_ref x, %x -// CHECK:STDOUT: return %x.ref -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Symbolic(constants.%N) { -// CHECK:STDOUT: %N.loc14_13.2 => constants.%N -// CHECK:STDOUT: %N.patt.loc14_13.2 => constants.%N -// CHECK:STDOUT: %uN.builtin => constants.%uN.builtin -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_zero_size.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, UInt, loaded [template = constants.%UInt] -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 -// CHECK:STDOUT: .UInt = imports.%import_ref.2 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .n = %n -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %n.var: ref = var n -// CHECK:STDOUT: %n: ref = bind_name n, %n.var -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned" [from "types.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_negative_size.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: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, UInt, loaded [template = constants.%UInt] -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.3 -// CHECK:STDOUT: .ImplicitAs = %import_ref.7 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 -// CHECK:STDOUT: .UInt = imports.%import_ref.2 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .n = %n -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %n.patt: %i32 = binding_pattern n -// CHECK:STDOUT: %n.param_patt: %i32 = value_param_pattern %n.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %n.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %n: %i32 = bind_name n, %n.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %n.var: ref = var n -// CHECK:STDOUT: %n: ref = bind_name n, %n.var -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%n.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned" [from "types.carbon"]; -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_oversized.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %UInt.type: type = fn_type @UInt [template] -// CHECK:STDOUT: %UInt: %UInt.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref.1 = import_ref Main//types, IntLiteral, unloaded -// CHECK:STDOUT: %import_ref.2: %UInt.type = import_ref Main//types, UInt, loaded [template = constants.%UInt] -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .IntLiteral = imports.%import_ref.1 -// CHECK:STDOUT: .UInt = imports.%import_ref.2 -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .m = %m -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %m.var: ref = var m -// CHECK:STDOUT: %m: ref = bind_name m, %m.var -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @UInt(%n.param_patt: Core.IntLiteral) -> type = "int.make_type_unsigned" [from "types.carbon"]; -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/neq.carbon b/toolchain/check/testdata/builtins/int/neq.carbon index a593d58007a43..702010fba3aaf 100644 --- a/toolchain/check/testdata/builtins/int/neq.carbon +++ b/toolchain/check/testdata/builtins/int/neq.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/neq.carbon @@ -20,225 +22,6 @@ fn F(true_: True, false_: False) { true_ as (if Neq(1, 2) then True else False); } -fn RuntimeCall(a: i32, b: i32) -> bool { +fn RuntimeCallIsValid(a: i32, b: i32) -> bool { return Neq(a, b); } - -// CHECK:STDOUT: --- int_neq.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: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %Neq.type: type = fn_type @Neq [template] -// CHECK:STDOUT: %Neq: %Neq.type = struct_value () [template] -// CHECK:STDOUT: %True: type = class_type @True [template] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %False: type = class_type @False [template] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %false: bool = bool_literal false [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: %true: bool = bool_literal true [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.6 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Neq = %Neq.decl -// CHECK:STDOUT: .True = %True.decl -// CHECK:STDOUT: .False = %False.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Neq.decl: %Neq.type = fn_decl @Neq [template = constants.%Neq] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc2_27.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc2_27.2: type = converted %bool.make_type, %.loc2_27.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %True.decl: type = class_decl @True [template = constants.%True] {} {} -// CHECK:STDOUT: %False.decl: type = class_decl @False [template = constants.%False] {} {} -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] { -// CHECK:STDOUT: %true_.patt: %True = binding_pattern true_ -// CHECK:STDOUT: %true_.param_patt: %True = value_param_pattern %true_.patt, runtime_param0 -// CHECK:STDOUT: %false_.patt: %False = binding_pattern false_ -// CHECK:STDOUT: %false_.param_patt: %False = value_param_pattern %false_.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %true_.param: %True = value_param runtime_param0 -// CHECK:STDOUT: %True.ref.loc7: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: %true_: %True = bind_name true_, %true_.param -// CHECK:STDOUT: %false_.param: %False = value_param runtime_param1 -// CHECK:STDOUT: %False.ref.loc7: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: %false_: %False = bind_name false_, %false_.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc12_35.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc12_35.2: type = converted %bool.make_type, %.loc12_35.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc12_19: type = splice_block %i32.loc12_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc12_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc12_27: type = splice_block %i32.loc12_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc12_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc12_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @True { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%True -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @False { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%False -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Neq(%a.param_patt: %i32, %b.param_patt: %i32) -> bool = "int.neq"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F(%true_.param_patt: %True, %false_.param_patt: %False) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %false_.ref: %False = name_ref false_, %false_ -// CHECK:STDOUT: %Neq.ref.loc8: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %int_1.loc8_21: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_1.loc8_24: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_21: = bound_method %int_1.loc8_21, %impl.elem0.loc8_21 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc8_21: = specific_function %Convert.bound.loc8_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc8_21: init %i32 = call %Convert.specific_fn.loc8_21(%int_1.loc8_21) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_21.1: %i32 = value_of_initializer %int.convert_checked.loc8_21 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_21.2: %i32 = converted %int_1.loc8_21, %.loc8_21.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_24: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_24: = bound_method %int_1.loc8_24, %impl.elem0.loc8_24 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc8_24: = specific_function %Convert.bound.loc8_24, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc8_24: init %i32 = call %Convert.specific_fn.loc8_24(%int_1.loc8_24) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_24.1: %i32 = value_of_initializer %int.convert_checked.loc8_24 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_24.2: %i32 = converted %int_1.loc8_24, %.loc8_24.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.neq.loc8: init bool = call %Neq.ref.loc8(%.loc8_21.2, %.loc8_24.2) [template = constants.%false] -// CHECK:STDOUT: %.loc8_14.1: bool = value_of_initializer %int.neq.loc8 [template = constants.%false] -// CHECK:STDOUT: %.loc8_14.2: bool = converted %int.neq.loc8, %.loc8_14.1 [template = constants.%false] -// CHECK:STDOUT: if %.loc8_14.2 br !if.expr.then.loc8 else br !if.expr.else.loc8 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc8: -// CHECK:STDOUT: %True.ref.loc8: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc8(%True.ref.loc8) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc8: -// CHECK:STDOUT: %False.ref.loc8: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc8(%False.ref.loc8) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc8: -// CHECK:STDOUT: %.loc8_14.3: type = block_arg !if.expr.result.loc8 [template = constants.%False] -// CHECK:STDOUT: %true_.ref: %True = name_ref true_, %true_ -// CHECK:STDOUT: %Neq.ref.loc9: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %impl.elem0.loc9_20: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_20: = bound_method %int_1.loc9, %impl.elem0.loc9_20 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_20: = specific_function %Convert.bound.loc9_20, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_20: init %i32 = call %Convert.specific_fn.loc9_20(%int_1.loc9) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_20.1: %i32 = value_of_initializer %int.convert_checked.loc9_20 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_20.2: %i32 = converted %int_1.loc9, %.loc9_20.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc9_23: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_23: = bound_method %int_2, %impl.elem0.loc9_23 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_23: = specific_function %Convert.bound.loc9_23, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_23: init %i32 = call %Convert.specific_fn.loc9_23(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_23.1: %i32 = value_of_initializer %int.convert_checked.loc9_23 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc9_23.2: %i32 = converted %int_2, %.loc9_23.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.neq.loc9: init bool = call %Neq.ref.loc9(%.loc9_20.2, %.loc9_23.2) [template = constants.%true] -// CHECK:STDOUT: %.loc9_13.1: bool = value_of_initializer %int.neq.loc9 [template = constants.%true] -// CHECK:STDOUT: %.loc9_13.2: bool = converted %int.neq.loc9, %.loc9_13.1 [template = constants.%true] -// CHECK:STDOUT: if %.loc9_13.2 br !if.expr.then.loc9 else br !if.expr.else.loc9 -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.then.loc9: -// CHECK:STDOUT: %True.ref.loc9: type = name_ref True, file.%True.decl [template = constants.%True] -// CHECK:STDOUT: br !if.expr.result.loc9(%True.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.else.loc9: -// CHECK:STDOUT: %False.ref.loc9: type = name_ref False, file.%False.decl [template = constants.%False] -// CHECK:STDOUT: br !if.expr.result.loc9(%False.ref.loc9) -// CHECK:STDOUT: -// CHECK:STDOUT: !if.expr.result.loc9: -// CHECK:STDOUT: %.loc9_13.3: type = block_arg !if.expr.result.loc9 [template = constants.%True] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Neq.ref: %Neq.type = name_ref Neq, file.%Neq.decl [template = constants.%Neq] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.neq: init bool = call %Neq.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc13_19.1: bool = value_of_initializer %int.neq -// CHECK:STDOUT: %.loc13_19.2: bool = converted %int.neq, %.loc13_19.1 -// CHECK:STDOUT: return %.loc13_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/or.carbon b/toolchain/check/testdata/builtins/int/or.carbon index 83817e6a1c833..9dbd3cca8b7ef 100644 --- a/toolchain/check/testdata/builtins/int/or.carbon +++ b/toolchain/check/testdata/builtins/int/or.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/or.carbon @@ -15,114 +17,6 @@ fn Or(a: i32, b: i32) -> i32 = "int.or"; var arr: [i32; Or(12, 10)]; let arr_p: [i32; 14]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Or(a, b); } - -// CHECK:STDOUT: --- int_or.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: %Or.type: type = fn_type @Or [template] -// CHECK:STDOUT: %Or: %Or.type = struct_value () [template] -// CHECK:STDOUT: %int_14.2: Core.IntLiteral = int_value 14 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_14.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Or = %Or.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Or.decl: %Or.type = fn_decl @Or [template = constants.%Or] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_10: type = splice_block %i32.loc2_10 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_10: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_10: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_18: type = splice_block %i32.loc2_18 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Or(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.or"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Or.ref: %Or.type = name_ref Or, file.%Or.decl [template = constants.%Or] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.or: init %i32 = call %Or.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_18.1: %i32 = value_of_initializer %int.or -// CHECK:STDOUT: %.loc8_18.2: %i32 = converted %int.or, %.loc8_18.1 -// CHECK:STDOUT: return %.loc8_18.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/right_shift.carbon b/toolchain/check/testdata/builtins/int/right_shift.carbon index b97ad19732e20..ead0fec1966a4 100644 --- a/toolchain/check/testdata/builtins/int/right_shift.carbon +++ b/toolchain/check/testdata/builtins/int/right_shift.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/right_shift.carbon @@ -15,7 +17,7 @@ fn RightShift(a: i32, b: i32) -> i32 = "int.right_shift"; var arr: [i32; RightShift(22, 2)]; let arr_p: [i32; 5]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return RightShift(a, b); } @@ -63,396 +65,3 @@ let size_3: i32 = RightShift(1, 33); // CHECK:STDERR: let negative: i32 = RightShift(1, Negate(1)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~ let negative: i32 = RightShift(1, Negate(1)); - -// CHECK:STDOUT: --- int_right_shift.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: %RightShift.type.1: type = fn_type @RightShift.1 [template] -// CHECK:STDOUT: %RightShift: %RightShift.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_5.2: Core.IntLiteral = int_value 5 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_5.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .RightShift = %RightShift.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %RightShift.decl: %RightShift.type.1 = fn_decl @RightShift.1 [template = constants.%RightShift] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_18: type = splice_block %i32.loc2_18 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_26: type = splice_block %i32.loc2_26 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %RightShift.ref: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.right_shift: init %i32 = call %RightShift.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_26.1: %i32 = value_of_initializer %int.right_shift -// CHECK:STDOUT: %.loc8_26.2: %i32 = converted %int.right_shift, %.loc8_26.1 -// CHECK:STDOUT: return %.loc8_26.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- arith_shift.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: %RightShift.type.1: type = fn_type @RightShift.1 [template] -// CHECK:STDOUT: %RightShift: %RightShift.type.1 = struct_value () [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %array_type.1: type = array_type %int_1.1, %i32 [template] -// CHECK:STDOUT: %ptr.1: type = ptr_type %array_type.1 [template] -// CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %array_type.2: type = array_type %int_3.2, %i32 [template] -// CHECK:STDOUT: %ptr.2: type = ptr_type %array_type.2 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .RightShift = %RightShift.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .arr1 = %arr1 -// CHECK:STDOUT: .arr1_p = @__global_init.%arr1_p -// CHECK:STDOUT: .arr2 = %arr2 -// CHECK:STDOUT: .arr2_p = @__global_init.%arr2_p -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %RightShift.decl: %RightShift.type.1 = fn_decl @RightShift.1 [template = constants.%RightShift] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc6_18: type = splice_block %i32.loc6_18 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc6_18: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc6_26: type = splice_block %i32.loc6_26 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc6_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7: type = splice_block %i32.loc7_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr1.var: ref %array_type.1 = var arr1 -// CHECK:STDOUT: %arr1: ref %array_type.1 = bind_name arr1, %arr1.var -// CHECK:STDOUT: %arr2.var: ref %array_type.2 = var arr2 -// CHECK:STDOUT: %arr2: ref %array_type.2 = bind_name arr2, %arr2.var -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr1.ref: ref %array_type.1 = name_ref arr1, file.%arr1 -// CHECK:STDOUT: %addr.loc11: %ptr.1 = addr_of %arr1.ref -// CHECK:STDOUT: %arr1_p: %ptr.1 = bind_name arr1_p, %addr.loc11 -// CHECK:STDOUT: %arr2.ref: ref %array_type.2 = name_ref arr2, file.%arr2 -// CHECK:STDOUT: %addr.loc15: %ptr.2 = addr_of %arr2.ref -// CHECK:STDOUT: %arr2_p: %ptr.2 = bind_name arr2_p, %addr.loc15 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_bad_shift.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32.1: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32.1) [template] -// CHECK:STDOUT: %RightShift.type.1: type = fn_type @RightShift.1 [template] -// CHECK:STDOUT: %RightShift: %RightShift.type.1 = struct_value () [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_31.1: Core.IntLiteral = int_value 31 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32.1) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32.1) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_31.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32.1) [template] -// CHECK:STDOUT: %int_31.2: %i32 = int_value 31 [template] -// CHECK:STDOUT: %int_0: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32.1) [template] -// CHECK:STDOUT: %int_32.2: %i32 = int_value 32 [template] -// CHECK:STDOUT: %int_33.1: Core.IntLiteral = int_value 33 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_33.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32.1) [template] -// CHECK:STDOUT: %int_33.2: %i32 = int_value 33 [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .RightShift = %RightShift.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .size_1 = @__global_init.%size_1 -// CHECK:STDOUT: .size_2 = @__global_init.%size_2 -// CHECK:STDOUT: .size_3 = @__global_init.%size_3 -// CHECK:STDOUT: .negative = @__global_init.%negative -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %RightShift.decl: %RightShift.type.1 = fn_decl @RightShift.1 [template = constants.%RightShift] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_34: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc4_34: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_18: type = splice_block %i32.loc4_18 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_18: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc4_18: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_26: type = splice_block %i32.loc4_26 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_26: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc4_26: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc5: type = splice_block %i32.loc5_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_14: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %i32.loc5_14: type = class_type @Int, @Int(constants.%int_32.1) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RightShift.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.right_shift"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %RightShift.ref.loc8: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %int_1.loc8: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_31: Core.IntLiteral = int_value 31 [template = constants.%int_31.1] -// CHECK:STDOUT: %impl.elem0.loc8_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_30: = bound_method %int_1.loc8, %impl.elem0.loc8_30 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc8_30: = specific_function %Convert.bound.loc8_30, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc8_30: init %i32 = call %Convert.specific_fn.loc8_30(%int_1.loc8) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_30.1: %i32 = value_of_initializer %int.convert_checked.loc8_30 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_1.loc8, %.loc8_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc8_33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_33: = bound_method %int_31, %impl.elem0.loc8_33 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc8_33: = specific_function %Convert.bound.loc8_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc8_33: init %i32 = call %Convert.specific_fn.loc8_33(%int_31) [template = constants.%int_31.2] -// CHECK:STDOUT: %.loc8_33.1: %i32 = value_of_initializer %int.convert_checked.loc8_33 [template = constants.%int_31.2] -// CHECK:STDOUT: %.loc8_33.2: %i32 = converted %int_31, %.loc8_33.1 [template = constants.%int_31.2] -// CHECK:STDOUT: %int.right_shift.loc8: init %i32 = call %RightShift.ref.loc8(%.loc8_30.2, %.loc8_33.2) [template = constants.%int_0] -// CHECK:STDOUT: %.loc8_36.1: %i32 = value_of_initializer %int.right_shift.loc8 [template = constants.%int_0] -// CHECK:STDOUT: %.loc8_36.2: %i32 = converted %int.right_shift.loc8, %.loc8_36.1 [template = constants.%int_0] -// CHECK:STDOUT: %size_1: %i32 = bind_name size_1, %.loc8_36.2 -// CHECK:STDOUT: %RightShift.ref.loc13: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32.1] -// CHECK:STDOUT: %impl.elem0.loc13_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_30: = bound_method %int_1.loc13, %impl.elem0.loc13_30 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc13_30: = specific_function %Convert.bound.loc13_30, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc13_30: init %i32 = call %Convert.specific_fn.loc13_30(%int_1.loc13) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_30.1: %i32 = value_of_initializer %int.convert_checked.loc13_30 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc13_30.2: %i32 = converted %int_1.loc13, %.loc13_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc13_33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc13_33: = bound_method %int_32, %impl.elem0.loc13_33 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc13_33: = specific_function %Convert.bound.loc13_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc13_33: init %i32 = call %Convert.specific_fn.loc13_33(%int_32) [template = constants.%int_32.2] -// CHECK:STDOUT: %.loc13_33.1: %i32 = value_of_initializer %int.convert_checked.loc13_33 [template = constants.%int_32.2] -// CHECK:STDOUT: %.loc13_33.2: %i32 = converted %int_32, %.loc13_33.1 [template = constants.%int_32.2] -// CHECK:STDOUT: %int.right_shift.loc13: init %i32 = call %RightShift.ref.loc13(%.loc13_30.2, %.loc13_33.2) [template = ] -// CHECK:STDOUT: %.loc13_36.1: %i32 = value_of_initializer %int.right_shift.loc13 [template = ] -// CHECK:STDOUT: %.loc13_36.2: %i32 = converted %int.right_shift.loc13, %.loc13_36.1 [template = ] -// CHECK:STDOUT: %size_2: %i32 = bind_name size_2, %.loc13_36.2 -// CHECK:STDOUT: %RightShift.ref.loc18: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %int_1.loc18: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_33: Core.IntLiteral = int_value 33 [template = constants.%int_33.1] -// CHECK:STDOUT: %impl.elem0.loc18_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc18_30: = bound_method %int_1.loc18, %impl.elem0.loc18_30 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc18_30: = specific_function %Convert.bound.loc18_30, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc18_30: init %i32 = call %Convert.specific_fn.loc18_30(%int_1.loc18) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc18_30.1: %i32 = value_of_initializer %int.convert_checked.loc18_30 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc18_30.2: %i32 = converted %int_1.loc18, %.loc18_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc18_33: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc18_33: = bound_method %int_33, %impl.elem0.loc18_33 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %Convert.specific_fn.loc18_33: = specific_function %Convert.bound.loc18_33, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.4] -// CHECK:STDOUT: %int.convert_checked.loc18_33: init %i32 = call %Convert.specific_fn.loc18_33(%int_33) [template = constants.%int_33.2] -// CHECK:STDOUT: %.loc18_33.1: %i32 = value_of_initializer %int.convert_checked.loc18_33 [template = constants.%int_33.2] -// CHECK:STDOUT: %.loc18_33.2: %i32 = converted %int_33, %.loc18_33.1 [template = constants.%int_33.2] -// CHECK:STDOUT: %int.right_shift.loc18: init %i32 = call %RightShift.ref.loc18(%.loc18_30.2, %.loc18_33.2) [template = ] -// CHECK:STDOUT: %.loc18_36.1: %i32 = value_of_initializer %int.right_shift.loc18 [template = ] -// CHECK:STDOUT: %.loc18_36.2: %i32 = converted %int.right_shift.loc18, %.loc18_36.1 [template = ] -// CHECK:STDOUT: %size_3: %i32 = bind_name size_3, %.loc18_36.2 -// CHECK:STDOUT: %RightShift.ref.loc24: %RightShift.type.1 = name_ref RightShift, file.%RightShift.decl [template = constants.%RightShift] -// CHECK:STDOUT: %int_1.loc24_32: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc24_42: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc24_42: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc24_42: = bound_method %int_1.loc24_42, %impl.elem0.loc24_42 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc24_42: = specific_function %Convert.bound.loc24_42, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc24_42: init %i32 = call %Convert.specific_fn.loc24_42(%int_1.loc24_42) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc24_42.1: %i32 = value_of_initializer %int.convert_checked.loc24_42 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc24_42.2: %i32 = converted %int_1.loc24_42, %.loc24_42.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc24_42.2) [template = constants.%int_-1] -// CHECK:STDOUT: %impl.elem0.loc24_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc24_32: = bound_method %int_1.loc24_32, %impl.elem0.loc24_32 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc24_32: = specific_function %Convert.bound.loc24_32, @Convert.2(constants.%int_32.1) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc24_32: init %i32 = call %Convert.specific_fn.loc24_32(%int_1.loc24_32) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc24_32.1: %i32 = value_of_initializer %int.convert_checked.loc24_32 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc24_32.2: %i32 = converted %int_1.loc24_32, %.loc24_32.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc24_43.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-1] -// CHECK:STDOUT: %.loc24_43.2: %i32 = converted %int.snegate, %.loc24_43.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.right_shift.loc24: init %i32 = call %RightShift.ref.loc24(%.loc24_32.2, %.loc24_43.2) [template = ] -// CHECK:STDOUT: %.loc24_45.1: %i32 = value_of_initializer %int.right_shift.loc24 [template = ] -// CHECK:STDOUT: %.loc24_45.2: %i32 = converted %int.right_shift.loc24, %.loc24_45.1 [template = ] -// CHECK:STDOUT: %negative: %i32 = bind_name negative, %.loc24_45.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/sadd.carbon b/toolchain/check/testdata/builtins/int/sadd.carbon index 853f11cc47754..92a7a741edf4a 100644 --- a/toolchain/check/testdata/builtins/int/sadd.carbon +++ b/toolchain/check/testdata/builtins/int/sadd.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/sadd.carbon @@ -15,7 +17,7 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; var arr: [i32; Add(1, 2)]; let arr_p: [i32; 3]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Add(a, b); } @@ -65,15 +67,15 @@ var bad_return_type: [i32; BadReturnType(1, 2)]; // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2, 3)]; -fn RuntimeCallTooFew(a: i32) -> i32 { +fn RuntimeCallIsValidTooFew(a: i32) -> i32 { return TooFew(a); } -fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { +fn RuntimeCallIsValidTooMany(a: i32, b: i32, c: i32) -> i32 { return TooMany(a, b, c); } -fn RuntimeCallBadReturnType(a: i32, b: i32) -> bool { +fn RuntimeCallIsValidBadReturnType(a: i32, b: i32) -> bool { return BadReturnType(a, b); } @@ -88,503 +90,3 @@ let a: i32 = Add(0x7FFFFFFF, 0); // CHECK:STDERR: let b: i32 = Add(0x7FFFFFFF, 1); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~ let b: i32 = Add(0x7FFFFFFF, 1); - -// CHECK:STDOUT: --- int_add.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: %Add.type.1: type = fn_type @Add.1 [template] -// CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Add.decl: %Add.type.1 = fn_decl @Add.1 [template = constants.%Add] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.sadd -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.sadd, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_bad_decl.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: %TooFew.type: type = fn_type @TooFew [template] -// CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] -// CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] -// CHECK:STDOUT: %TooMany: %TooMany.type = struct_value () [template] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %BadReturnType.type: type = fn_type @BadReturnType [template] -// CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] -// CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] -// CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] -// CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] -// CHECK:STDOUT: %RuntimeCallTooMany: %RuntimeCallTooMany.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType.type: type = fn_type @RuntimeCallBadReturnType [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.6 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .TooFew = %TooFew.decl -// CHECK:STDOUT: .TooMany = %TooMany.decl -// CHECK:STDOUT: .BadReturnType = %BadReturnType.decl -// CHECK:STDOUT: .JustRight = %JustRight.decl -// CHECK:STDOUT: .too_few = %too_few -// CHECK:STDOUT: .too_many = %too_many -// CHECK:STDOUT: .bad_return_type = %bad_return_type -// CHECK:STDOUT: .bad_call = %bad_call -// CHECK:STDOUT: .RuntimeCallTooFew = %RuntimeCallTooFew.decl -// CHECK:STDOUT: .RuntimeCallTooMany = %RuntimeCallTooMany.decl -// CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc8_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc8: type = splice_block %i32.loc8_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc8_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: %i32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: %i32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc13_15: type = splice_block %i32.loc13_15 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc13_23: type = splice_block %i32.loc13_23 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 -// CHECK:STDOUT: %.loc13_31: type = splice_block %i32.loc13_31 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc18_21: type = splice_block %i32.loc18_21 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc18_29: type = splice_block %i32.loc18_29 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc18_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc19_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc19_17: type = splice_block %i32.loc19_17 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc19_25: type = splice_block %i32.loc19_25 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %too_few.var: ref = var too_few -// CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %too_many.var: ref = var too_many -// CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type -// CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %bad_call.var: ref = var bad_call -// CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var -// CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc46_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc46_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc46: type = splice_block %i32.loc46_25 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc46_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: %i32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: %i32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc50_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc50_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc50_26: type = splice_block %i32.loc50_26 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc50_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc50_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc50_34: type = splice_block %i32.loc50_34 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc50_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc50_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 -// CHECK:STDOUT: %.loc50_42: type = splice_block %i32.loc50_42 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc50_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc50_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc54_48.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc54_48.2: type = converted %bool.make_type, %.loc54_48.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc54_32: type = splice_block %i32.loc54_32 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc54_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc54_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc54_40: type = splice_block %i32.loc54_40 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc54_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc54_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew(%a.param_patt: %i32) -> %i32; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a.param_patt: %i32, %b.param_patt: %i32, %c.param_patt: %i32) -> %i32; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: %i32, %b.param_patt: %i32) -> bool; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref(%a.ref) -// CHECK:STDOUT: %.loc47_19.1: %i32 = value_of_initializer %TooFew.call -// CHECK:STDOUT: %.loc47_19.2: %i32 = converted %TooFew.call, %.loc47_19.1 -// CHECK:STDOUT: return %.loc47_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: %i32, %b.param_patt: %i32, %c.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %c.ref: %i32 = name_ref c, %c -// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%a.ref, %b.ref, %c.ref) -// CHECK:STDOUT: %.loc51_26.1: %i32 = value_of_initializer %TooMany.call -// CHECK:STDOUT: %.loc51_26.2: %i32 = converted %TooMany.call, %.loc51_26.1 -// CHECK:STDOUT: return %.loc51_26.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc55_29.1: bool = value_of_initializer %BadReturnType.call -// CHECK:STDOUT: %.loc55_29.2: bool = converted %BadReturnType.call, %.loc55_29.1 -// CHECK:STDOUT: return %.loc55_29.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_overflow.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: %Add.type.1: type = fn_type @Add.1 [template] -// CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Add.decl: %Add.type.1 = fn_decl @Add.1 [template = constants.%Add] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Add.ref.loc6: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_2147483647.loc6, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_2147483647.loc6) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_2147483647.loc6, %.loc6_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc6_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_30: = bound_method %int_0, %impl.elem0.loc6_30 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc6_30: = specific_function %Convert.bound.loc6_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc6_30: init %i32 = call %Convert.specific_fn.loc6_30(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc6_30.1: %i32 = value_of_initializer %int.convert_checked.loc6_30 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc6_30.2: %i32 = converted %int_0, %.loc6_30.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.sadd.loc6: init %i32 = call %Add.ref.loc6(%.loc6_18.2, %.loc6_30.2) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_32.1: %i32 = value_of_initializer %int.sadd.loc6 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_32.2: %i32 = converted %int.sadd.loc6, %.loc6_32.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_32.2 -// CHECK:STDOUT: %Add.ref.loc10: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %int_2147483647.loc10: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_2147483647.loc10, %impl.elem0.loc10_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_2147483647.loc10) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_2147483647.loc10, %.loc10_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc10_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_30: = bound_method %int_1, %impl.elem0.loc10_30 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc10_30: = specific_function %Convert.bound.loc10_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc10_30: init %i32 = call %Convert.specific_fn.loc10_30(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_30.1: %i32 = value_of_initializer %int.convert_checked.loc10_30 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_30.2: %i32 = converted %int_1, %.loc10_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.sadd.loc10: init %i32 = call %Add.ref.loc10(%.loc10_18.2, %.loc10_30.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc10_32.1: %i32 = value_of_initializer %int.sadd.loc10 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc10_32.2: %i32 = converted %int.sadd.loc10, %.loc10_32.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc10_32.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/sdiv.carbon b/toolchain/check/testdata/builtins/int/sdiv.carbon index 9a86c2ad1c3dd..abec5e0bce168 100644 --- a/toolchain/check/testdata/builtins/int/sdiv.carbon +++ b/toolchain/check/testdata/builtins/int/sdiv.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/sdiv.carbon @@ -15,7 +17,7 @@ fn Div(a: i32, b: i32) -> i32 = "int.sdiv"; var arr: [i32; Div(3, 2)]; let arr_p: [i32; 1]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Div(a, b); } @@ -56,448 +58,3 @@ let a: i32 = Div(1, 0); // CHECK:STDERR: let b: i32 = Div(0, 0); // CHECK:STDERR: ^~~~~~~~~ let b: i32 = Div(0, 0); - -// CHECK:STDOUT: --- int_div.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: %Div.type.1: type = fn_type @Div.1 [template] -// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.sdiv: init %i32 = call %Div.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.sdiv -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.sdiv, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_overflow.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: %Div.type.1: type = fn_type @Div.1 [template] -// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] -// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] -// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc5_11: type = splice_block %i32.loc5_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc5_19: type = splice_block %i32.loc5_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref.loc9: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_25.1: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_25.2: %i32 = converted %int_2147483647.loc9, %.loc9_25.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.snegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_46.1: %i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_46.2: %i32 = converted %int_1.loc9, %.loc9_46.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc9_47: init %i32 = call %Negate.ref.loc9_39(%.loc9_46.2) [template = constants.%int_-1] -// CHECK:STDOUT: %.loc9_36.1: %i32 = value_of_initializer %int.snegate.loc9_36 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc9_36.2: %i32 = converted %int.snegate.loc9_36, %.loc9_36.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc9_47.1: %i32 = value_of_initializer %int.snegate.loc9_47 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc9_47.2: %i32 = converted %int.snegate.loc9_47, %.loc9_47.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.sdiv.loc9: init %i32 = call %Div.ref.loc9(%.loc9_36.2, %.loc9_47.2) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.sdiv.loc9 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.sdiv.loc9, %.loc9_49.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 -// CHECK:STDOUT: %Div.ref.loc12: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_29.1: %i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_29.2: %i32 = converted %int_2147483647.loc12, %.loc12_29.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_29.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.snegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_43.1: %i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_43.2: %i32 = converted %int_1.loc12_43, %.loc12_43.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.ssub.loc12: init %i32 = call %Sub.ref.loc12(%.loc12_40.2, %.loc12_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.ssub.loc12 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.ssub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_47.1: %i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_47.2: %i32 = converted %int_1.loc12_47, %.loc12_47.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.sdiv.loc12: init %i32 = call %Div.ref.loc12(%.loc12_44.2, %.loc12_47.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.sdiv.loc12 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.sdiv.loc12, %.loc12_49.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 -// CHECK:STDOUT: %Div.ref.loc19: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Sub.ref.loc19: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc19_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc19: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc19_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc19_29: = bound_method %int_2147483647.loc19, %impl.elem0.loc19_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc19_29: = specific_function %Convert.bound.loc19_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc19_29: init %i32 = call %Convert.specific_fn.loc19_29(%int_2147483647.loc19) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc19_29.1: %i32 = value_of_initializer %int.convert_checked.loc19_29 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc19_29.2: %i32 = converted %int_2147483647.loc19, %.loc19_29.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.snegate.loc19_40: init %i32 = call %Negate.ref.loc19_22(%.loc19_29.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1.loc19_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc19_40.1: %i32 = value_of_initializer %int.snegate.loc19_40 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc19_40.2: %i32 = converted %int.snegate.loc19_40, %.loc19_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc19_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc19_43: = bound_method %int_1.loc19_43, %impl.elem0.loc19_43 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc19_43: = specific_function %Convert.bound.loc19_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc19_43: init %i32 = call %Convert.specific_fn.loc19_43(%int_1.loc19_43) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc19_43.1: %i32 = value_of_initializer %int.convert_checked.loc19_43 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc19_43.2: %i32 = converted %int_1.loc19_43, %.loc19_43.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.ssub.loc19: init %i32 = call %Sub.ref.loc19(%.loc19_40.2, %.loc19_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %Negate.ref.loc19_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc19_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc19_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc19_54: = bound_method %int_1.loc19_54, %impl.elem0.loc19_54 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc19_54: = specific_function %Convert.bound.loc19_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc19_54: init %i32 = call %Convert.specific_fn.loc19_54(%int_1.loc19_54) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc19_54.1: %i32 = value_of_initializer %int.convert_checked.loc19_54 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc19_54.2: %i32 = converted %int_1.loc19_54, %.loc19_54.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc19_55: init %i32 = call %Negate.ref.loc19_47(%.loc19_54.2) [template = constants.%int_-1] -// CHECK:STDOUT: %.loc19_44.1: %i32 = value_of_initializer %int.ssub.loc19 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc19_44.2: %i32 = converted %int.ssub.loc19, %.loc19_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc19_55.1: %i32 = value_of_initializer %int.snegate.loc19_55 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc19_55.2: %i32 = converted %int.snegate.loc19_55, %.loc19_55.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.sdiv.loc19: init %i32 = call %Div.ref.loc19(%.loc19_44.2, %.loc19_55.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc19_57.1: %i32 = value_of_initializer %int.sdiv.loc19 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc19_57.2: %i32 = converted %int.sdiv.loc19, %.loc19_57.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc19_57.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_div_by_zero.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: %Div.type.1: type = fn_type @Div.1 [template] -// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sdiv"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref.loc10: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_0.loc10: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_1, %impl.elem0.loc10_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_1, %.loc10_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_21: = bound_method %int_0.loc10, %impl.elem0.loc10_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc10_21: = specific_function %Convert.bound.loc10_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc10_21: init %i32 = call %Convert.specific_fn.loc10_21(%int_0.loc10) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc10_21.1: %i32 = value_of_initializer %int.convert_checked.loc10_21 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc10_21.2: %i32 = converted %int_0.loc10, %.loc10_21.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.sdiv.loc10: init %i32 = call %Div.ref.loc10(%.loc10_18.2, %.loc10_21.2) [template = ] -// CHECK:STDOUT: %.loc10_23.1: %i32 = value_of_initializer %int.sdiv.loc10 [template = ] -// CHECK:STDOUT: %.loc10_23.2: %i32 = converted %int.sdiv.loc10, %.loc10_23.1 [template = ] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc10_23.2 -// CHECK:STDOUT: %Div.ref.loc15: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %int_0.loc15_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_0.loc15_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc15_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_18: = bound_method %int_0.loc15_18, %impl.elem0.loc15_18 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc15_18: = specific_function %Convert.bound.loc15_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc15_18: init %i32 = call %Convert.specific_fn.loc15_18(%int_0.loc15_18) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_0.loc15_18, %.loc15_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc15_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_21: = bound_method %int_0.loc15_21, %impl.elem0.loc15_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc15_21: = specific_function %Convert.bound.loc15_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc15_21: init %i32 = call %Convert.specific_fn.loc15_21(%int_0.loc15_21) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc15_21.1: %i32 = value_of_initializer %int.convert_checked.loc15_21 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc15_21.2: %i32 = converted %int_0.loc15_21, %.loc15_21.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.sdiv.loc15: init %i32 = call %Div.ref.loc15(%.loc15_18.2, %.loc15_21.2) [template = ] -// CHECK:STDOUT: %.loc15_23.1: %i32 = value_of_initializer %int.sdiv.loc15 [template = ] -// CHECK:STDOUT: %.loc15_23.2: %i32 = converted %int.sdiv.loc15, %.loc15_23.1 [template = ] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc15_23.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/smod.carbon b/toolchain/check/testdata/builtins/int/smod.carbon index c6ae78058e84c..72f5f4f01cd1b 100644 --- a/toolchain/check/testdata/builtins/int/smod.carbon +++ b/toolchain/check/testdata/builtins/int/smod.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/smod.carbon @@ -15,7 +17,7 @@ fn Mod(a: i32, b: i32) -> i32 = "int.smod"; var arr: [i32; Mod(5, 3)]; let arr_p: [i32; 2]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Mod(a, b); } @@ -59,449 +61,3 @@ let a: i32 = Mod(1, 0); // CHECK:STDERR: let b: i32 = Mod(0, 0); // CHECK:STDERR: ^~~~~~~~~ let b: i32 = Mod(0, 0); - -// CHECK:STDOUT: --- int_div.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: %Mod.type.1: type = fn_type @Mod.1 [template] -// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_2.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_2.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.smod: init %i32 = call %Mod.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.smod -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.smod, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_overflow.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: %Mod.type.1: type = fn_type @Mod.1 [template] -// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] -// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] -// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %int_0: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc5_11: type = splice_block %i32.loc5_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc5_19: type = splice_block %i32.loc5_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref.loc9: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_25.1: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_25.2: %i32 = converted %int_2147483647.loc9, %.loc9_25.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.snegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_46.1: %i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_46.2: %i32 = converted %int_1.loc9, %.loc9_46.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc9_47: init %i32 = call %Negate.ref.loc9_39(%.loc9_46.2) [template = constants.%int_-1] -// CHECK:STDOUT: %.loc9_36.1: %i32 = value_of_initializer %int.snegate.loc9_36 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc9_36.2: %i32 = converted %int.snegate.loc9_36, %.loc9_36.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc9_47.1: %i32 = value_of_initializer %int.snegate.loc9_47 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc9_47.2: %i32 = converted %int.snegate.loc9_47, %.loc9_47.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.smod.loc9: init %i32 = call %Mod.ref.loc9(%.loc9_36.2, %.loc9_47.2) [template = constants.%int_0] -// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.smod.loc9 [template = constants.%int_0] -// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.smod.loc9, %.loc9_49.1 [template = constants.%int_0] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 -// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_29.1: %i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_29.2: %i32 = converted %int_2147483647.loc12, %.loc12_29.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.snegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_29.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.snegate.loc12 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.snegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_43.1: %i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_43.2: %i32 = converted %int_1.loc12_43, %.loc12_43.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.ssub.loc12: init %i32 = call %Sub.ref.loc12(%.loc12_40.2, %.loc12_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.ssub.loc12 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.ssub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_47.1: %i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_47.2: %i32 = converted %int_1.loc12_47, %.loc12_47.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.smod.loc12: init %i32 = call %Mod.ref.loc12(%.loc12_44.2, %.loc12_47.2) [template = constants.%int_0] -// CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.smod.loc12 [template = constants.%int_0] -// CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.smod.loc12, %.loc12_49.1 [template = constants.%int_0] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 -// CHECK:STDOUT: %Mod.ref.loc20: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Sub.ref.loc20: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc20_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc20: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc20_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc20_29: = bound_method %int_2147483647.loc20, %impl.elem0.loc20_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc20_29: = specific_function %Convert.bound.loc20_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc20_29: init %i32 = call %Convert.specific_fn.loc20_29(%int_2147483647.loc20) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc20_29.1: %i32 = value_of_initializer %int.convert_checked.loc20_29 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc20_29.2: %i32 = converted %int_2147483647.loc20, %.loc20_29.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.snegate.loc20_40: init %i32 = call %Negate.ref.loc20_22(%.loc20_29.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1.loc20_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc20_40.1: %i32 = value_of_initializer %int.snegate.loc20_40 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc20_40.2: %i32 = converted %int.snegate.loc20_40, %.loc20_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc20_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc20_43: = bound_method %int_1.loc20_43, %impl.elem0.loc20_43 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc20_43: = specific_function %Convert.bound.loc20_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc20_43: init %i32 = call %Convert.specific_fn.loc20_43(%int_1.loc20_43) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc20_43.1: %i32 = value_of_initializer %int.convert_checked.loc20_43 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc20_43.2: %i32 = converted %int_1.loc20_43, %.loc20_43.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.ssub.loc20: init %i32 = call %Sub.ref.loc20(%.loc20_40.2, %.loc20_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %Negate.ref.loc20_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc20_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc20_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc20_54: = bound_method %int_1.loc20_54, %impl.elem0.loc20_54 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc20_54: = specific_function %Convert.bound.loc20_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc20_54: init %i32 = call %Convert.specific_fn.loc20_54(%int_1.loc20_54) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc20_54.1: %i32 = value_of_initializer %int.convert_checked.loc20_54 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc20_54.2: %i32 = converted %int_1.loc20_54, %.loc20_54.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate.loc20_55: init %i32 = call %Negate.ref.loc20_47(%.loc20_54.2) [template = constants.%int_-1] -// CHECK:STDOUT: %.loc20_44.1: %i32 = value_of_initializer %int.ssub.loc20 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc20_44.2: %i32 = converted %int.ssub.loc20, %.loc20_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc20_55.1: %i32 = value_of_initializer %int.snegate.loc20_55 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc20_55.2: %i32 = converted %int.snegate.loc20_55, %.loc20_55.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.smod.loc20: init %i32 = call %Mod.ref.loc20(%.loc20_44.2, %.loc20_55.2) [template = constants.%int_0] -// CHECK:STDOUT: %.loc20_57.1: %i32 = value_of_initializer %int.smod.loc20 [template = constants.%int_0] -// CHECK:STDOUT: %.loc20_57.2: %i32 = converted %int.smod.loc20, %.loc20_57.1 [template = constants.%int_0] -// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc20_57.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_div_by_zero.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: %Mod.type.1: type = fn_type @Mod.1 [template] -// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smod"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc12_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_18: = bound_method %int_1, %impl.elem0.loc12_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_18: = specific_function %Convert.bound.loc12_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_18: init %i32 = call %Convert.specific_fn.loc12_18(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_18.1: %i32 = value_of_initializer %int.convert_checked.loc12_18 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_18.2: %i32 = converted %int_1, %.loc12_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_21: = bound_method %int_0.loc12, %impl.elem0.loc12_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_21: = specific_function %Convert.bound.loc12_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_21: init %i32 = call %Convert.specific_fn.loc12_21(%int_0.loc12) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_21.1: %i32 = value_of_initializer %int.convert_checked.loc12_21 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_21.2: %i32 = converted %int_0.loc12, %.loc12_21.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.smod.loc12: init %i32 = call %Mod.ref.loc12(%.loc12_18.2, %.loc12_21.2) [template = ] -// CHECK:STDOUT: %.loc12_23.1: %i32 = value_of_initializer %int.smod.loc12 [template = ] -// CHECK:STDOUT: %.loc12_23.2: %i32 = converted %int.smod.loc12, %.loc12_23.1 [template = ] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc12_23.2 -// CHECK:STDOUT: %Mod.ref.loc17: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %int_0.loc17_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_0.loc17_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc17_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc17_18: = bound_method %int_0.loc17_18, %impl.elem0.loc17_18 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc17_18: = specific_function %Convert.bound.loc17_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc17_18: init %i32 = call %Convert.specific_fn.loc17_18(%int_0.loc17_18) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc17_18.1: %i32 = value_of_initializer %int.convert_checked.loc17_18 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc17_18.2: %i32 = converted %int_0.loc17_18, %.loc17_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc17_21: = bound_method %int_0.loc17_21, %impl.elem0.loc17_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc17_21: = specific_function %Convert.bound.loc17_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc17_21: init %i32 = call %Convert.specific_fn.loc17_21(%int_0.loc17_21) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc17_21.1: %i32 = value_of_initializer %int.convert_checked.loc17_21 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc17_21.2: %i32 = converted %int_0.loc17_21, %.loc17_21.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.smod.loc17: init %i32 = call %Mod.ref.loc17(%.loc17_18.2, %.loc17_21.2) [template = ] -// CHECK:STDOUT: %.loc17_23.1: %i32 = value_of_initializer %int.smod.loc17 [template = ] -// CHECK:STDOUT: %.loc17_23.2: %i32 = converted %int.smod.loc17, %.loc17_23.1 [template = ] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc17_23.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/smul.carbon b/toolchain/check/testdata/builtins/int/smul.carbon index 5cf91e233671d..563d39d864353 100644 --- a/toolchain/check/testdata/builtins/int/smul.carbon +++ b/toolchain/check/testdata/builtins/int/smul.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/smul.carbon @@ -15,7 +17,7 @@ fn Mul(a: i32, b: i32) -> i32 = "int.smul"; var arr: [i32; Mul(3, 2)]; let arr_p: [i32; 6]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Mul(a, b); } @@ -30,227 +32,3 @@ let a: i32 = Mul(0x7FFF, 0x10000); // CHECK:STDERR: let b: i32 = Mul(0x8000, 0x10000); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~ let b: i32 = Mul(0x8000, 0x10000); - -// CHECK:STDOUT: --- int_mul.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: %Mul.type.1: type = fn_type @Mul.1 [template] -// CHECK:STDOUT: %Mul: %Mul.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_6.2: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_6.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Mul = %Mul.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mul.decl: %Mul.type.1 = fn_decl @Mul.1 [template = constants.%Mul] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smul"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mul.ref: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.smul: init %i32 = call %Mul.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.smul -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.smul, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_overflow.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: %Mul.type.1: type = fn_type @Mul.1 [template] -// CHECK:STDOUT: %Mul: %Mul.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_32767.1: Core.IntLiteral = int_value 32767 [template] -// CHECK:STDOUT: %int_65536.1: Core.IntLiteral = int_value 65536 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_32767.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_32767.2: %i32 = int_value 32767 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_65536.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template] -// CHECK:STDOUT: %int_2147418112: %i32 = int_value 2147418112 [template] -// CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32768.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Mul = %Mul.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mul.decl: %Mul.type.1 = fn_decl @Mul.1 [template = constants.%Mul] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.smul"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mul.ref.loc6: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %int_32767: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] -// CHECK:STDOUT: %int_65536.loc6: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_32767, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_32767) [template = constants.%int_32767.2] -// CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_32767.2] -// CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_32767, %.loc6_18.1 [template = constants.%int_32767.2] -// CHECK:STDOUT: %impl.elem0.loc6_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_26: = bound_method %int_65536.loc6, %impl.elem0.loc6_26 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc6_26: = specific_function %Convert.bound.loc6_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc6_26: init %i32 = call %Convert.specific_fn.loc6_26(%int_65536.loc6) [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc6_26.1: %i32 = value_of_initializer %int.convert_checked.loc6_26 [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc6_26.2: %i32 = converted %int_65536.loc6, %.loc6_26.1 [template = constants.%int_65536.2] -// CHECK:STDOUT: %int.smul.loc6: init %i32 = call %Mul.ref.loc6(%.loc6_18.2, %.loc6_26.2) [template = constants.%int_2147418112] -// CHECK:STDOUT: %.loc6_34.1: %i32 = value_of_initializer %int.smul.loc6 [template = constants.%int_2147418112] -// CHECK:STDOUT: %.loc6_34.2: %i32 = converted %int.smul.loc6, %.loc6_34.1 [template = constants.%int_2147418112] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_34.2 -// CHECK:STDOUT: %Mul.ref.loc10: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %int_65536.loc10: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_32768, %impl.elem0.loc10_18 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_32768) [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_32768, %.loc10_18.1 [template = constants.%int_32768.2] -// CHECK:STDOUT: %impl.elem0.loc10_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_26: = bound_method %int_65536.loc10, %impl.elem0.loc10_26 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc10_26: = specific_function %Convert.bound.loc10_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc10_26: init %i32 = call %Convert.specific_fn.loc10_26(%int_65536.loc10) [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked.loc10_26 [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc10_26.2: %i32 = converted %int_65536.loc10, %.loc10_26.1 [template = constants.%int_65536.2] -// CHECK:STDOUT: %int.smul.loc10: init %i32 = call %Mul.ref.loc10(%.loc10_18.2, %.loc10_26.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc10_34.1: %i32 = value_of_initializer %int.smul.loc10 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc10_34.2: %i32 = converted %int.smul.loc10, %.loc10_34.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc10_34.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/snegate.carbon b/toolchain/check/testdata/builtins/int/snegate.carbon index d680c18e6bcdc..a0c03f880e7c1 100644 --- a/toolchain/check/testdata/builtins/int/snegate.carbon +++ b/toolchain/check/testdata/builtins/int/snegate.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/snegate.carbon @@ -17,7 +19,7 @@ let arr_p: [i32; 123]* = &arr; let n: i32 = Negate(1); -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Negate(a); } @@ -67,7 +69,7 @@ var bad_return_type: [i32; BadReturnType(1)]; // CHECK:STDERR: var bad_call: [i32; JustRight(1, 2)]; -fn RuntimeCallTooFew(a: i32) -> i32 { +fn RuntimeCallIsValidTooFew(a: i32) -> i32 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch] // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~~~ @@ -78,7 +80,7 @@ fn RuntimeCallTooFew(a: i32) -> i32 { return TooFew(a); } -fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { +fn RuntimeCallIsValidTooMany(a: i32, b: i32, c: i32) -> i32 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 arguments passed to function expecting 2 arguments [CallArgCountMismatch] // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ @@ -89,7 +91,7 @@ fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { return TooMany(a, b, c); } -fn RuntimeCallBadReturnType(a: i32, b: i32) -> bool { +fn RuntimeCallIsValidBadReturnType(a: i32, b: i32) -> bool { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ @@ -115,499 +117,3 @@ let a: i32 = Negate(Negate(0x7FFFFFFF)); // CHECK:STDERR: let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ let b: i32 = Negate(Sub(Negate(0x7FFFFFFF), 1)); - -// CHECK:STDOUT: --- int_negate.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: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_123.1: Core.IntLiteral = int_value 123 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %array_type: type = array_type %int_123.1, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .n = @__global_init.%n -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2: type = splice_block %i32.loc2_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc9_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc9_19: type = splice_block %i32.loc9_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc9_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc9_27: type = splice_block %i32.loc9_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc9_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc9_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%a.ref) -// CHECK:STDOUT: %.loc10_19.1: %i32 = value_of_initializer %int.snegate -// CHECK:STDOUT: %.loc10_19.2: %i32 = converted %int.snegate, %.loc10_19.1 -// CHECK:STDOUT: return %.loc10_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc7_21.1: %i32 = value_of_initializer %int.convert_checked [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc7_21.2: %i32 = converted %int_1, %.loc7_21.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.snegate: init %i32 = call %Negate.ref(%.loc7_21.2) [template = constants.%int_-1] -// CHECK:STDOUT: %.loc7_23.1: %i32 = value_of_initializer %int.snegate [template = constants.%int_-1] -// CHECK:STDOUT: %.loc7_23.2: %i32 = converted %int.snegate, %.loc7_23.1 [template = constants.%int_-1] -// CHECK:STDOUT: %n: %i32 = bind_name n, %.loc7_23.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_bad_decl.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: %TooFew.type: type = fn_type @TooFew [template] -// CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] -// CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] -// CHECK:STDOUT: %TooMany: %TooMany.type = struct_value () [template] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %BadReturnType.type: type = fn_type @BadReturnType [template] -// CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] -// CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] -// CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] -// CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] -// CHECK:STDOUT: %RuntimeCallTooMany: %RuntimeCallTooMany.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType.type: type = fn_type @RuntimeCallBadReturnType [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.6 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .TooFew = %TooFew.decl -// CHECK:STDOUT: .TooMany = %TooMany.decl -// CHECK:STDOUT: .BadReturnType = %BadReturnType.decl -// CHECK:STDOUT: .JustRight = %JustRight.decl -// CHECK:STDOUT: .too_few = %too_few -// CHECK:STDOUT: .too_many = %too_many -// CHECK:STDOUT: .bad_return_type = %bad_return_type -// CHECK:STDOUT: .bad_call = %bad_call -// CHECK:STDOUT: .RuntimeCallTooFew = %RuntimeCallTooFew.decl -// CHECK:STDOUT: .RuntimeCallTooMany = %RuntimeCallTooMany.decl -// CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { -// 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: %return.param: ref %i32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc13_15: type = splice_block %i32.loc13_15 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc13_23: type = splice_block %i32.loc13_23 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc18_21: 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: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc19: type = splice_block %i32.loc19_17 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %too_few.var: ref = var too_few -// CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %too_many.var: ref = var too_many -// CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type -// CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %bad_call.var: ref = var bad_call -// CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var -// CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc46_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc46_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc46: type = splice_block %i32.loc46_25 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc46_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: %i32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: %i32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc57_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc57_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc57_26: type = splice_block %i32.loc57_26 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc57_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc57_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc57_34: type = splice_block %i32.loc57_34 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc57_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc57_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 -// CHECK:STDOUT: %.loc57_42: type = splice_block %i32.loc57_42 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc57_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc57_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type, %.loc68_48.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc68_32: type = splice_block %i32.loc68_32 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc68_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc68_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc68_40: type = splice_block %i32.loc68_40 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc68_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc68_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew() -> %i32; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: %i32) -> bool; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: %i32, %b.param_patt: %i32, %c.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %c.ref: %i32 = name_ref c, %c -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_overflow.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: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] -// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4: type = splice_block %i32.loc4_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc5_11: type = splice_block %i32.loc5_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc5_19: type = splice_block %i32.loc5_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.snegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Negate.ref.loc8_14: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Negate.ref.loc8_21: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8: = bound_method %int_2147483647.loc8, %impl.elem0.loc8 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc8: = specific_function %Convert.bound.loc8, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc8: init %i32 = call %Convert.specific_fn.loc8(%int_2147483647.loc8) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_28.1: %i32 = value_of_initializer %int.convert_checked.loc8 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_28.2: %i32 = converted %int_2147483647.loc8, %.loc8_28.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.snegate.loc8_38: init %i32 = call %Negate.ref.loc8_21(%.loc8_28.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc8_38.1: %i32 = value_of_initializer %int.snegate.loc8_38 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc8_38.2: %i32 = converted %int.snegate.loc8_38, %.loc8_38.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int.snegate.loc8_39: init %i32 = call %Negate.ref.loc8_14(%.loc8_38.2) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_40.1: %i32 = value_of_initializer %int.snegate.loc8_39 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_40.2: %i32 = converted %int.snegate.loc8_39, %.loc8_40.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc8_40.2 -// CHECK:STDOUT: %Negate.ref.loc14_14: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc14_25: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc14: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc14_32: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14_32: = bound_method %int_2147483647.loc14, %impl.elem0.loc14_32 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc14_32: = specific_function %Convert.bound.loc14_32, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc14_32: init %i32 = call %Convert.specific_fn.loc14_32(%int_2147483647.loc14) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc14_32.1: %i32 = value_of_initializer %int.convert_checked.loc14_32 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc14_32.2: %i32 = converted %int_2147483647.loc14, %.loc14_32.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.snegate.loc14_42: init %i32 = call %Negate.ref.loc14_25(%.loc14_32.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc14_42.1: %i32 = value_of_initializer %int.snegate.loc14_42 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc14_42.2: %i32 = converted %int.snegate.loc14_42, %.loc14_42.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc14_45: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14_45: = bound_method %int_1, %impl.elem0.loc14_45 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc14_45: = specific_function %Convert.bound.loc14_45, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc14_45: init %i32 = call %Convert.specific_fn.loc14_45(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc14_45.1: %i32 = value_of_initializer %int.convert_checked.loc14_45 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc14_45.2: %i32 = converted %int_1, %.loc14_45.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.ssub: init %i32 = call %Sub.ref(%.loc14_42.2, %.loc14_45.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc14_46.1: %i32 = value_of_initializer %int.ssub [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc14_46.2: %i32 = converted %int.ssub, %.loc14_46.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %int.snegate.loc14_47: init %i32 = call %Negate.ref.loc14_14(%.loc14_46.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc14_48.1: %i32 = value_of_initializer %int.snegate.loc14_47 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc14_48.2: %i32 = converted %int.snegate.loc14_47, %.loc14_48.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc14_48.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/ssub.carbon b/toolchain/check/testdata/builtins/int/ssub.carbon index d80d5d28a5ecd..c27bfe561aac8 100644 --- a/toolchain/check/testdata/builtins/int/ssub.carbon +++ b/toolchain/check/testdata/builtins/int/ssub.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/ssub.carbon @@ -15,7 +17,7 @@ fn Sub(a: i32, b: i32) -> i32 = "int.ssub"; var arr: [i32; Sub(3, 2)]; let arr_p: [i32; 1]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Sub(a, b); } @@ -31,273 +33,3 @@ let b: i32 = Sub(Sub(0, 0x7FFFFFFF), 1); // CHECK:STDERR: let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~ let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); - -// CHECK:STDOUT: --- int_sub.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: %Sub.type.1: type = fn_type @Sub.1 [template] -// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.ssub: init %i32 = call %Sub.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.ssub -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.ssub, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_overflow.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: %Sub.type.1: type = fn_type @Sub.1 [template] -// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.ssub"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Sub.ref.loc6: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %int_0.loc6: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_0.loc6, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_0.loc6) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_0.loc6, %.loc6_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc6_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_21: = bound_method %int_2147483647.loc6, %impl.elem0.loc6_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc6_21: = specific_function %Convert.bound.loc6_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc6_21: init %i32 = call %Convert.specific_fn.loc6_21(%int_2147483647.loc6) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_21.1: %i32 = value_of_initializer %int.convert_checked.loc6_21 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_21.2: %i32 = converted %int_2147483647.loc6, %.loc6_21.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.ssub.loc6: init %i32 = call %Sub.ref.loc6(%.loc6_18.2, %.loc6_21.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc6_32.1: %i32 = value_of_initializer %int.ssub.loc6 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc6_32.2: %i32 = converted %int.ssub.loc6, %.loc6_32.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_32.2 -// CHECK:STDOUT: %Sub.ref.loc7_14: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Sub.ref.loc7_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %int_0.loc7: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc7_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_22: = bound_method %int_0.loc7, %impl.elem0.loc7_22 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc7_22: = specific_function %Convert.bound.loc7_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc7_22: init %i32 = call %Convert.specific_fn.loc7_22(%int_0.loc7) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc7_22.1: %i32 = value_of_initializer %int.convert_checked.loc7_22 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc7_22.2: %i32 = converted %int_0.loc7, %.loc7_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc7_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_25: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_25 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc7_25: = specific_function %Convert.bound.loc7_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc7_25: init %i32 = call %Convert.specific_fn.loc7_25(%int_2147483647.loc7) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc7_25.1: %i32 = value_of_initializer %int.convert_checked.loc7_25 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc7_25.2: %i32 = converted %int_2147483647.loc7, %.loc7_25.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.ssub.loc7_35: init %i32 = call %Sub.ref.loc7_18(%.loc7_22.2, %.loc7_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc7_35.1: %i32 = value_of_initializer %int.ssub.loc7_35 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc7_35.2: %i32 = converted %int.ssub.loc7_35, %.loc7_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc7_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_38: = bound_method %int_1, %impl.elem0.loc7_38 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc7_38: = specific_function %Convert.bound.loc7_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc7_38: init %i32 = call %Convert.specific_fn.loc7_38(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc7_38.1: %i32 = value_of_initializer %int.convert_checked.loc7_38 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc7_38.2: %i32 = converted %int_1, %.loc7_38.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.ssub.loc7_39: init %i32 = call %Sub.ref.loc7_14(%.loc7_35.2, %.loc7_38.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc7_40.1: %i32 = value_of_initializer %int.ssub.loc7_39 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc7_40.2: %i32 = converted %int.ssub.loc7_39, %.loc7_40.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc7_40.2 -// CHECK:STDOUT: %Sub.ref.loc11_14: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Sub.ref.loc11_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %int_0.loc11: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_2147483647.loc11: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_22: = bound_method %int_0.loc11, %impl.elem0.loc11_22 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc11_22: = specific_function %Convert.bound.loc11_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc11_22: init %i32 = call %Convert.specific_fn.loc11_22(%int_0.loc11) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_22.1: %i32 = value_of_initializer %int.convert_checked.loc11_22 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc11_22.2: %i32 = converted %int_0.loc11, %.loc11_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc11_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_25: = bound_method %int_2147483647.loc11, %impl.elem0.loc11_25 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc11_25: = specific_function %Convert.bound.loc11_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc11_25: init %i32 = call %Convert.specific_fn.loc11_25(%int_2147483647.loc11) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_25.1: %i32 = value_of_initializer %int.convert_checked.loc11_25 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_25.2: %i32 = converted %int_2147483647.loc11, %.loc11_25.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.ssub.loc11_35: init %i32 = call %Sub.ref.loc11_18(%.loc11_22.2, %.loc11_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc11_35.1: %i32 = value_of_initializer %int.ssub.loc11_35 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc11_35.2: %i32 = converted %int.ssub.loc11_35, %.loc11_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc11_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_38: = bound_method %int_2, %impl.elem0.loc11_38 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %Convert.specific_fn.loc11_38: = specific_function %Convert.bound.loc11_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] -// CHECK:STDOUT: %int.convert_checked.loc11_38: init %i32 = call %Convert.specific_fn.loc11_38(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc11_38.1: %i32 = value_of_initializer %int.convert_checked.loc11_38 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc11_38.2: %i32 = converted %int_2, %.loc11_38.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.ssub.loc11_39: init %i32 = call %Sub.ref.loc11_14(%.loc11_35.2, %.loc11_38.2) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_40.1: %i32 = value_of_initializer %int.ssub.loc11_39 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_40.2: %i32 = converted %int.ssub.loc11_39, %.loc11_40.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc11_40.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/uadd.carbon b/toolchain/check/testdata/builtins/int/uadd.carbon index c6695f0488ac5..cd7ac70b6b990 100644 --- a/toolchain/check/testdata/builtins/int/uadd.carbon +++ b/toolchain/check/testdata/builtins/int/uadd.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/uadd.carbon @@ -15,7 +17,7 @@ fn Add(a: i32, b: i32) -> i32 = "int.uadd"; var arr: [i32; Add(1, 2)]; let arr_p: [i32; 3]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Add(a, b); } @@ -64,15 +66,15 @@ var bad_return_type: [i32; BadReturnType(1, 2)]; // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ var bad_call: [i32; JustRight(1, 2, 3)]; -fn RuntimeCallTooFew(a: i32) -> i32 { +fn RuntimeCallIsValidTooFew(a: i32) -> i32 { return TooFew(a); } -fn RuntimeCallTooMany(a: i32, b: i32, c: i32) -> i32 { +fn RuntimeCallIsValidTooMany(a: i32, b: i32, c: i32) -> i32 { return TooMany(a, b, c); } -fn RuntimeCallBadReturnType(a: i32, b: i32) -> bool { +fn RuntimeCallIsValidBadReturnType(a: i32, b: i32) -> bool { return BadReturnType(a, b); } @@ -85,503 +87,3 @@ fn Add(a: i32, b: i32) -> i32 = "int.uadd"; // Overflow is OK. let a: i32 = Add(0x7FFFFFFF, 0); let b: i32 = Add(0x7FFFFFFF, 1); - -// CHECK:STDOUT: --- int_add.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: %Add.type.1: type = fn_type @Add.1 [template] -// CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Add.decl: %Add.type.1 = fn_decl @Add.1 [template = constants.%Add] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.uadd"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.uadd: init %i32 = call %Add.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.uadd -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.uadd, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_bad_decl.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: %TooFew.type: type = fn_type @TooFew [template] -// CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] -// CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] -// CHECK:STDOUT: %TooMany: %TooMany.type = struct_value () [template] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %BadReturnType.type: type = fn_type @BadReturnType [template] -// CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] -// CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] -// CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] -// CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] -// CHECK:STDOUT: %RuntimeCallTooMany: %RuntimeCallTooMany.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType.type: type = fn_type @RuntimeCallBadReturnType [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.6 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .TooFew = %TooFew.decl -// CHECK:STDOUT: .TooMany = %TooMany.decl -// CHECK:STDOUT: .BadReturnType = %BadReturnType.decl -// CHECK:STDOUT: .JustRight = %JustRight.decl -// CHECK:STDOUT: .too_few = %too_few -// CHECK:STDOUT: .too_many = %too_many -// CHECK:STDOUT: .bad_return_type = %bad_return_type -// CHECK:STDOUT: .bad_call = %bad_call -// CHECK:STDOUT: .RuntimeCallTooFew = %RuntimeCallTooFew.decl -// CHECK:STDOUT: .RuntimeCallTooMany = %RuntimeCallTooMany.decl -// CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc8_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc8: type = splice_block %i32.loc8_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc8_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc8_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: %i32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: %i32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_39: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_39: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc13_15: type = splice_block %i32.loc13_15 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc13_23: type = splice_block %i32.loc13_23 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 -// CHECK:STDOUT: %.loc13_31: type = splice_block %i32.loc13_31 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc13_31: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_37.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc18_21: type = splice_block %i32.loc18_21 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc18_21: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc18_29: type = splice_block %i32.loc18_29 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc18_29: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc18_29: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc19_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc19_17: type = splice_block %i32.loc19_17 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_17: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc19_25: type = splice_block %i32.loc19_25 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc19_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %too_few.var: ref = var too_few -// CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %too_many.var: ref = var too_many -// CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type -// CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %bad_call.var: ref = var bad_call -// CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var -// CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc45_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc45_33: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc45: type = splice_block %i32.loc45_25 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc45_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc45_25: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: %i32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: %i32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param3 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc49_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc49_50: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc49_26: type = splice_block %i32.loc49_26 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc49_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc49_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc49_34: type = splice_block %i32.loc49_34 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc49_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc49_34: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: %i32 = value_param runtime_param2 -// CHECK:STDOUT: %.loc49_42: type = splice_block %i32.loc49_42 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc49_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc49_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %c: %i32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc53_48.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc53_48.2: type = converted %bool.make_type, %.loc53_48.1 [template = bool] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc53_32: type = splice_block %i32.loc53_32 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc53_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc53_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc53_40: type = splice_block %i32.loc53_40 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc53_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc53_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew(%a.param_patt: %i32) -> %i32; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a.param_patt: %i32, %b.param_patt: %i32, %c.param_patt: %i32) -> %i32; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: %i32, %b.param_patt: %i32) -> bool; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.uadd"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %TooFew.call: init %i32 = call %TooFew.ref(%a.ref) -// CHECK:STDOUT: %.loc46_19.1: %i32 = value_of_initializer %TooFew.call -// CHECK:STDOUT: %.loc46_19.2: %i32 = converted %TooFew.call, %.loc46_19.1 -// CHECK:STDOUT: return %.loc46_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: %i32, %b.param_patt: %i32, %c.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %c.ref: %i32 = name_ref c, %c -// CHECK:STDOUT: %TooMany.call: init %i32 = call %TooMany.ref(%a.ref, %b.ref, %c.ref) -// CHECK:STDOUT: %.loc50_26.1: %i32 = value_of_initializer %TooMany.call -// CHECK:STDOUT: %.loc50_26.2: %i32 = converted %TooMany.call, %.loc50_26.1 -// CHECK:STDOUT: return %.loc50_26.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: %i32, %b.param_patt: %i32) -> bool { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc54_29.1: bool = value_of_initializer %BadReturnType.call -// CHECK:STDOUT: %.loc54_29.2: bool = converted %BadReturnType.call, %.loc54_29.1 -// CHECK:STDOUT: return %.loc54_29.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- overflow.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: %Add.type.1: type = fn_type @Add.1 [template] -// CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Add = %Add.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Add.decl: %Add.type.1 = fn_decl @Add.1 [template = constants.%Add] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.uadd"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Add.ref.loc7: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc7_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_18: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc7_18: = specific_function %Convert.bound.loc7_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc7_18: init %i32 = call %Convert.specific_fn.loc7_18(%int_2147483647.loc7) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc7_18.1: %i32 = value_of_initializer %int.convert_checked.loc7_18 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc7_18.2: %i32 = converted %int_2147483647.loc7, %.loc7_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc7_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_30: = bound_method %int_0, %impl.elem0.loc7_30 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc7_30: = specific_function %Convert.bound.loc7_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc7_30: init %i32 = call %Convert.specific_fn.loc7_30(%int_0) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc7_30.1: %i32 = value_of_initializer %int.convert_checked.loc7_30 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc7_30.2: %i32 = converted %int_0, %.loc7_30.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.uadd.loc7: init %i32 = call %Add.ref.loc7(%.loc7_18.2, %.loc7_30.2) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc7_32.1: %i32 = value_of_initializer %int.uadd.loc7 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc7_32.2: %i32 = converted %int.uadd.loc7, %.loc7_32.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc7_32.2 -// CHECK:STDOUT: %Add.ref.loc8: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] -// CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc8_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_18: = bound_method %int_2147483647.loc8, %impl.elem0.loc8_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc8_18: = specific_function %Convert.bound.loc8_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc8_18: init %i32 = call %Convert.specific_fn.loc8_18(%int_2147483647.loc8) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_18.1: %i32 = value_of_initializer %int.convert_checked.loc8_18 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_18.2: %i32 = converted %int_2147483647.loc8, %.loc8_18.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %impl.elem0.loc8_30: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_30: = bound_method %int_1, %impl.elem0.loc8_30 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc8_30: = specific_function %Convert.bound.loc8_30, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc8_30: init %i32 = call %Convert.specific_fn.loc8_30(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_30.1: %i32 = value_of_initializer %int.convert_checked.loc8_30 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc8_30.2: %i32 = converted %int_1, %.loc8_30.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.uadd.loc8: init %i32 = call %Add.ref.loc8(%.loc8_18.2, %.loc8_30.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc8_32.1: %i32 = value_of_initializer %int.uadd.loc8 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc8_32.2: %i32 = converted %int.uadd.loc8, %.loc8_32.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc8_32.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/udiv.carbon b/toolchain/check/testdata/builtins/int/udiv.carbon index 605d5ac2801ee..1efe7a8938583 100644 --- a/toolchain/check/testdata/builtins/int/udiv.carbon +++ b/toolchain/check/testdata/builtins/int/udiv.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/udiv.carbon @@ -15,7 +17,7 @@ fn Div(a: i32, b: i32) -> i32 = "int.udiv"; var arr: [i32; Div(3, 2)]; let arr_p: [i32; 1]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Div(a, b); } @@ -52,449 +54,3 @@ let a: i32 = Div(1, 0); // CHECK:STDERR: let b: i32 = Div(0, 0); // CHECK:STDERR: ^~~~~~~~~ let b: i32 = Div(0, 0); - -// CHECK:STDOUT: --- int_div.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: %Div.type.1: type = fn_type @Div.1 [template] -// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.udiv: init %i32 = call %Div.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.udiv -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.udiv, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- overflow.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: %Div.type.1: type = fn_type @Div.1 [template] -// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] -// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] -// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %int_0: %i32 = int_value 0 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc5_11: type = splice_block %i32.loc5_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc5_19: type = splice_block %i32.loc5_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.unegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref.loc9: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_25.1: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_25.2: %i32 = converted %int_2147483647.loc9, %.loc9_25.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.unegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_46.1: %i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_46.2: %i32 = converted %int_1.loc9, %.loc9_46.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.unegate.loc9_47: init %i32 = call %Negate.ref.loc9_39(%.loc9_46.2) [template = constants.%int_-1] -// CHECK:STDOUT: %.loc9_36.1: %i32 = value_of_initializer %int.unegate.loc9_36 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc9_36.2: %i32 = converted %int.unegate.loc9_36, %.loc9_36.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc9_47.1: %i32 = value_of_initializer %int.unegate.loc9_47 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc9_47.2: %i32 = converted %int.unegate.loc9_47, %.loc9_47.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.udiv.loc9: init %i32 = call %Div.ref.loc9(%.loc9_36.2, %.loc9_47.2) [template = constants.%int_0] -// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.udiv.loc9 [template = constants.%int_0] -// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.udiv.loc9, %.loc9_49.1 [template = constants.%int_0] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 -// CHECK:STDOUT: %Div.ref.loc12: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_29.1: %i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_29.2: %i32 = converted %int_2147483647.loc12, %.loc12_29.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.unegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_29.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.unegate.loc12 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.unegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_43.1: %i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_43.2: %i32 = converted %int_1.loc12_43, %.loc12_43.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.usub.loc12: init %i32 = call %Sub.ref.loc12(%.loc12_40.2, %.loc12_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.usub.loc12 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.usub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_47.1: %i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_47.2: %i32 = converted %int_1.loc12_47, %.loc12_47.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.udiv.loc12: init %i32 = call %Div.ref.loc12(%.loc12_44.2, %.loc12_47.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.udiv.loc12 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.udiv.loc12, %.loc12_49.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 -// CHECK:STDOUT: %Div.ref.loc15: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %Sub.ref.loc15: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc15_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc15: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc15_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_29: = bound_method %int_2147483647.loc15, %impl.elem0.loc15_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc15_29: = specific_function %Convert.bound.loc15_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc15_29: init %i32 = call %Convert.specific_fn.loc15_29(%int_2147483647.loc15) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc15_29.1: %i32 = value_of_initializer %int.convert_checked.loc15_29 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc15_29.2: %i32 = converted %int_2147483647.loc15, %.loc15_29.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.unegate.loc15_40: init %i32 = call %Negate.ref.loc15_22(%.loc15_29.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1.loc15_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc15_40.1: %i32 = value_of_initializer %int.unegate.loc15_40 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc15_40.2: %i32 = converted %int.unegate.loc15_40, %.loc15_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc15_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_43: = bound_method %int_1.loc15_43, %impl.elem0.loc15_43 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc15_43: = specific_function %Convert.bound.loc15_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc15_43: init %i32 = call %Convert.specific_fn.loc15_43(%int_1.loc15_43) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc15_43.1: %i32 = value_of_initializer %int.convert_checked.loc15_43 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc15_43.2: %i32 = converted %int_1.loc15_43, %.loc15_43.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.usub.loc15: init %i32 = call %Sub.ref.loc15(%.loc15_40.2, %.loc15_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc15_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_54: = bound_method %int_1.loc15_54, %impl.elem0.loc15_54 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc15_54: = specific_function %Convert.bound.loc15_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc15_54: init %i32 = call %Convert.specific_fn.loc15_54(%int_1.loc15_54) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc15_54.1: %i32 = value_of_initializer %int.convert_checked.loc15_54 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc15_54.2: %i32 = converted %int_1.loc15_54, %.loc15_54.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.unegate.loc15_55: init %i32 = call %Negate.ref.loc15_47(%.loc15_54.2) [template = constants.%int_-1] -// CHECK:STDOUT: %.loc15_44.1: %i32 = value_of_initializer %int.usub.loc15 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc15_44.2: %i32 = converted %int.usub.loc15, %.loc15_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc15_55.1: %i32 = value_of_initializer %int.unegate.loc15_55 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc15_55.2: %i32 = converted %int.unegate.loc15_55, %.loc15_55.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.udiv.loc15: init %i32 = call %Div.ref.loc15(%.loc15_44.2, %.loc15_55.2) [template = constants.%int_0] -// CHECK:STDOUT: %.loc15_57.1: %i32 = value_of_initializer %int.udiv.loc15 [template = constants.%int_0] -// CHECK:STDOUT: %.loc15_57.2: %i32 = converted %int.udiv.loc15, %.loc15_57.1 [template = constants.%int_0] -// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc15_57.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_div_by_zero.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: %Div.type.1: type = fn_type @Div.1 [template] -// CHECK:STDOUT: %Div: %Div.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Div = %Div.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Div.decl: %Div.type.1 = fn_decl @Div.1 [template = constants.%Div] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Div.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.udiv"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Div.ref.loc10: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_0.loc10: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc10_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_18: = bound_method %int_1, %impl.elem0.loc10_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc10_18: = specific_function %Convert.bound.loc10_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc10_18: init %i32 = call %Convert.specific_fn.loc10_18(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_18.1: %i32 = value_of_initializer %int.convert_checked.loc10_18 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc10_18.2: %i32 = converted %int_1, %.loc10_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc10_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc10_21: = bound_method %int_0.loc10, %impl.elem0.loc10_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc10_21: = specific_function %Convert.bound.loc10_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc10_21: init %i32 = call %Convert.specific_fn.loc10_21(%int_0.loc10) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc10_21.1: %i32 = value_of_initializer %int.convert_checked.loc10_21 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc10_21.2: %i32 = converted %int_0.loc10, %.loc10_21.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.udiv.loc10: init %i32 = call %Div.ref.loc10(%.loc10_18.2, %.loc10_21.2) [template = ] -// CHECK:STDOUT: %.loc10_23.1: %i32 = value_of_initializer %int.udiv.loc10 [template = ] -// CHECK:STDOUT: %.loc10_23.2: %i32 = converted %int.udiv.loc10, %.loc10_23.1 [template = ] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc10_23.2 -// CHECK:STDOUT: %Div.ref.loc15: %Div.type.1 = name_ref Div, file.%Div.decl [template = constants.%Div] -// CHECK:STDOUT: %int_0.loc15_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_0.loc15_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc15_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_18: = bound_method %int_0.loc15_18, %impl.elem0.loc15_18 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc15_18: = specific_function %Convert.bound.loc15_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc15_18: init %i32 = call %Convert.specific_fn.loc15_18(%int_0.loc15_18) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc15_18.1: %i32 = value_of_initializer %int.convert_checked.loc15_18 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc15_18.2: %i32 = converted %int_0.loc15_18, %.loc15_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc15_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_21: = bound_method %int_0.loc15_21, %impl.elem0.loc15_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc15_21: = specific_function %Convert.bound.loc15_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc15_21: init %i32 = call %Convert.specific_fn.loc15_21(%int_0.loc15_21) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc15_21.1: %i32 = value_of_initializer %int.convert_checked.loc15_21 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc15_21.2: %i32 = converted %int_0.loc15_21, %.loc15_21.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.udiv.loc15: init %i32 = call %Div.ref.loc15(%.loc15_18.2, %.loc15_21.2) [template = ] -// CHECK:STDOUT: %.loc15_23.1: %i32 = value_of_initializer %int.udiv.loc15 [template = ] -// CHECK:STDOUT: %.loc15_23.2: %i32 = converted %int.udiv.loc15, %.loc15_23.1 [template = ] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc15_23.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/umod.carbon b/toolchain/check/testdata/builtins/int/umod.carbon index 623a0c99ee172..dc6067eb2d641 100644 --- a/toolchain/check/testdata/builtins/int/umod.carbon +++ b/toolchain/check/testdata/builtins/int/umod.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/umod.carbon @@ -15,7 +17,7 @@ fn Mod(a: i32, b: i32) -> i32 = "int.umod"; var arr: [i32; Mod(5, 3)]; let arr_p: [i32; 2]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Mod(a, b); } @@ -54,449 +56,3 @@ let a: i32 = Mod(1, 0); // CHECK:STDERR: let b: i32 = Mod(0, 0); // CHECK:STDERR: ^~~~~~~~~ let b: i32 = Mod(0, 0); - -// CHECK:STDOUT: --- int_div.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: %Mod.type.1: type = fn_type @Mod.1 [template] -// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_2.2: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_2.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.umod: init %i32 = call %Mod.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.umod -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.umod, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- overflow.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: %Mod.type.1: type = fn_type @Mod.1 [template] -// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] -// CHECK:STDOUT: %Sub.type.1: type = fn_type @Sub.1 [template] -// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-1: %i32 = int_value -1 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: %int_0: %i32 = int_value 0 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc5_11: type = splice_block %i32.loc5_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc5_19: type = splice_block %i32.loc5_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc6_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc6: type = splice_block %i32.loc6_14 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc6_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc6_14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %i32) -> %i32 = "int.unegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref.loc9: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Negate.ref.loc9_18: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc9: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc9_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_25: = bound_method %int_2147483647.loc9, %impl.elem0.loc9_25 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc9_25: = specific_function %Convert.bound.loc9_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc9_25: init %i32 = call %Convert.specific_fn.loc9_25(%int_2147483647.loc9) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_25.1: %i32 = value_of_initializer %int.convert_checked.loc9_25 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc9_25.2: %i32 = converted %int_2147483647.loc9, %.loc9_25.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.unegate.loc9_36: init %i32 = call %Negate.ref.loc9_18(%.loc9_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %Negate.ref.loc9_39: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc9: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc9_46: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc9_46: = bound_method %int_1.loc9, %impl.elem0.loc9_46 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc9_46: = specific_function %Convert.bound.loc9_46, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc9_46: init %i32 = call %Convert.specific_fn.loc9_46(%int_1.loc9) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_46.1: %i32 = value_of_initializer %int.convert_checked.loc9_46 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc9_46.2: %i32 = converted %int_1.loc9, %.loc9_46.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.unegate.loc9_47: init %i32 = call %Negate.ref.loc9_39(%.loc9_46.2) [template = constants.%int_-1] -// CHECK:STDOUT: %.loc9_36.1: %i32 = value_of_initializer %int.unegate.loc9_36 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc9_36.2: %i32 = converted %int.unegate.loc9_36, %.loc9_36.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc9_47.1: %i32 = value_of_initializer %int.unegate.loc9_47 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc9_47.2: %i32 = converted %int.unegate.loc9_47, %.loc9_47.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.umod.loc9: init %i32 = call %Mod.ref.loc9(%.loc9_36.2, %.loc9_47.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc9_49.1: %i32 = value_of_initializer %int.umod.loc9 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc9_49.2: %i32 = converted %int.umod.loc9, %.loc9_49.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc9_49.2 -// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Sub.ref.loc12: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc12: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_29: = bound_method %int_2147483647.loc12, %impl.elem0.loc12_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_29: = specific_function %Convert.bound.loc12_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_29: init %i32 = call %Convert.specific_fn.loc12_29(%int_2147483647.loc12) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_29.1: %i32 = value_of_initializer %int.convert_checked.loc12_29 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_29.2: %i32 = converted %int_2147483647.loc12, %.loc12_29.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.unegate.loc12: init %i32 = call %Negate.ref.loc12(%.loc12_29.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1.loc12_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc12_40.1: %i32 = value_of_initializer %int.unegate.loc12 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc12_40.2: %i32 = converted %int.unegate.loc12, %.loc12_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc12_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_43: = bound_method %int_1.loc12_43, %impl.elem0.loc12_43 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_43: = specific_function %Convert.bound.loc12_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_43: init %i32 = call %Convert.specific_fn.loc12_43(%int_1.loc12_43) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_43.1: %i32 = value_of_initializer %int.convert_checked.loc12_43 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_43.2: %i32 = converted %int_1.loc12_43, %.loc12_43.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.usub.loc12: init %i32 = call %Sub.ref.loc12(%.loc12_40.2, %.loc12_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %int_1.loc12_47: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc12_44.1: %i32 = value_of_initializer %int.usub.loc12 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc12_44.2: %i32 = converted %int.usub.loc12, %.loc12_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %impl.elem0.loc12_47: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_47: = bound_method %int_1.loc12_47, %impl.elem0.loc12_47 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_47: = specific_function %Convert.bound.loc12_47, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_47: init %i32 = call %Convert.specific_fn.loc12_47(%int_1.loc12_47) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_47.1: %i32 = value_of_initializer %int.convert_checked.loc12_47 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_47.2: %i32 = converted %int_1.loc12_47, %.loc12_47.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.umod.loc12: init %i32 = call %Mod.ref.loc12(%.loc12_44.2, %.loc12_47.2) [template = constants.%int_0] -// CHECK:STDOUT: %.loc12_49.1: %i32 = value_of_initializer %int.umod.loc12 [template = constants.%int_0] -// CHECK:STDOUT: %.loc12_49.2: %i32 = converted %int.umod.loc12, %.loc12_49.1 [template = constants.%int_0] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc12_49.2 -// CHECK:STDOUT: %Mod.ref.loc15: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %Sub.ref.loc15: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Negate.ref.loc15_22: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc15: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc15_29: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_29: = bound_method %int_2147483647.loc15, %impl.elem0.loc15_29 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc15_29: = specific_function %Convert.bound.loc15_29, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc15_29: init %i32 = call %Convert.specific_fn.loc15_29(%int_2147483647.loc15) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc15_29.1: %i32 = value_of_initializer %int.convert_checked.loc15_29 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc15_29.2: %i32 = converted %int_2147483647.loc15, %.loc15_29.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.unegate.loc15_40: init %i32 = call %Negate.ref.loc15_22(%.loc15_29.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1.loc15_43: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc15_40.1: %i32 = value_of_initializer %int.unegate.loc15_40 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc15_40.2: %i32 = converted %int.unegate.loc15_40, %.loc15_40.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc15_43: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_43: = bound_method %int_1.loc15_43, %impl.elem0.loc15_43 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc15_43: = specific_function %Convert.bound.loc15_43, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc15_43: init %i32 = call %Convert.specific_fn.loc15_43(%int_1.loc15_43) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc15_43.1: %i32 = value_of_initializer %int.convert_checked.loc15_43 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc15_43.2: %i32 = converted %int_1.loc15_43, %.loc15_43.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.usub.loc15: init %i32 = call %Sub.ref.loc15(%.loc15_40.2, %.loc15_43.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %Negate.ref.loc15_47: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1.loc15_54: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0.loc15_54: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_54: = bound_method %int_1.loc15_54, %impl.elem0.loc15_54 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc15_54: = specific_function %Convert.bound.loc15_54, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc15_54: init %i32 = call %Convert.specific_fn.loc15_54(%int_1.loc15_54) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc15_54.1: %i32 = value_of_initializer %int.convert_checked.loc15_54 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc15_54.2: %i32 = converted %int_1.loc15_54, %.loc15_54.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.unegate.loc15_55: init %i32 = call %Negate.ref.loc15_47(%.loc15_54.2) [template = constants.%int_-1] -// CHECK:STDOUT: %.loc15_44.1: %i32 = value_of_initializer %int.usub.loc15 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc15_44.2: %i32 = converted %int.usub.loc15, %.loc15_44.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc15_55.1: %i32 = value_of_initializer %int.unegate.loc15_55 [template = constants.%int_-1] -// CHECK:STDOUT: %.loc15_55.2: %i32 = converted %int.unegate.loc15_55, %.loc15_55.1 [template = constants.%int_-1] -// CHECK:STDOUT: %int.umod.loc15: init %i32 = call %Mod.ref.loc15(%.loc15_44.2, %.loc15_55.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc15_57.1: %i32 = value_of_initializer %int.umod.loc15 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc15_57.2: %i32 = converted %int.umod.loc15, %.loc15_57.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc15_57.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_div_by_zero.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: %Mod.type.1: type = fn_type @Mod.1 [template] -// CHECK:STDOUT: %Mod: %Mod.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Mod = %Mod.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mod.decl: %Mod.type.1 = fn_decl @Mod.1 [template = constants.%Mod] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Mod.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umod"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mod.ref.loc12: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %int_0.loc12: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc12_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_18: = bound_method %int_1, %impl.elem0.loc12_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_18: = specific_function %Convert.bound.loc12_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_18: init %i32 = call %Convert.specific_fn.loc12_18(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_18.1: %i32 = value_of_initializer %int.convert_checked.loc12_18 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc12_18.2: %i32 = converted %int_1, %.loc12_18.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %impl.elem0.loc12_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_21: = bound_method %int_0.loc12, %impl.elem0.loc12_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc12_21: = specific_function %Convert.bound.loc12_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc12_21: init %i32 = call %Convert.specific_fn.loc12_21(%int_0.loc12) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_21.1: %i32 = value_of_initializer %int.convert_checked.loc12_21 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc12_21.2: %i32 = converted %int_0.loc12, %.loc12_21.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.umod.loc12: init %i32 = call %Mod.ref.loc12(%.loc12_18.2, %.loc12_21.2) [template = ] -// CHECK:STDOUT: %.loc12_23.1: %i32 = value_of_initializer %int.umod.loc12 [template = ] -// CHECK:STDOUT: %.loc12_23.2: %i32 = converted %int.umod.loc12, %.loc12_23.1 [template = ] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc12_23.2 -// CHECK:STDOUT: %Mod.ref.loc17: %Mod.type.1 = name_ref Mod, file.%Mod.decl [template = constants.%Mod] -// CHECK:STDOUT: %int_0.loc17_18: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_0.loc17_21: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %impl.elem0.loc17_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc17_18: = bound_method %int_0.loc17_18, %impl.elem0.loc17_18 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc17_18: = specific_function %Convert.bound.loc17_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc17_18: init %i32 = call %Convert.specific_fn.loc17_18(%int_0.loc17_18) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc17_18.1: %i32 = value_of_initializer %int.convert_checked.loc17_18 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc17_18.2: %i32 = converted %int_0.loc17_18, %.loc17_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc17_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc17_21: = bound_method %int_0.loc17_21, %impl.elem0.loc17_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc17_21: = specific_function %Convert.bound.loc17_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc17_21: init %i32 = call %Convert.specific_fn.loc17_21(%int_0.loc17_21) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc17_21.1: %i32 = value_of_initializer %int.convert_checked.loc17_21 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc17_21.2: %i32 = converted %int_0.loc17_21, %.loc17_21.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %int.umod.loc17: init %i32 = call %Mod.ref.loc17(%.loc17_18.2, %.loc17_21.2) [template = ] -// CHECK:STDOUT: %.loc17_23.1: %i32 = value_of_initializer %int.umod.loc17 [template = ] -// CHECK:STDOUT: %.loc17_23.2: %i32 = converted %int.umod.loc17, %.loc17_23.1 [template = ] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc17_23.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/umul.carbon b/toolchain/check/testdata/builtins/int/umul.carbon index 3446d1bae5ebd..40d89a11cd87f 100644 --- a/toolchain/check/testdata/builtins/int/umul.carbon +++ b/toolchain/check/testdata/builtins/int/umul.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/umul.carbon @@ -15,7 +17,7 @@ fn Mul(a: i32, b: i32) -> i32 = "int.umul"; var arr: [i32; Mul(3, 2)]; let arr_p: [i32; 6]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Mul(a, b); } @@ -27,227 +29,3 @@ fn Mul(a: i32, b: i32) -> i32 = "int.umul"; let a: i32 = Mul(0x7FFF, 0x10000); let b: i32 = Mul(0x8000, 0x10000); - -// CHECK:STDOUT: --- int_mul.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: %Mul.type.1: type = fn_type @Mul.1 [template] -// CHECK:STDOUT: %Mul: %Mul.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_6.2: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_6.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Mul = %Mul.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mul.decl: %Mul.type.1 = fn_decl @Mul.1 [template = constants.%Mul] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umul"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mul.ref: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.umul: init %i32 = call %Mul.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.umul -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.umul, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- overflow.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: %Mul.type.1: type = fn_type @Mul.1 [template] -// CHECK:STDOUT: %Mul: %Mul.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_32767.1: Core.IntLiteral = int_value 32767 [template] -// CHECK:STDOUT: %int_65536.1: Core.IntLiteral = int_value 65536 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_32767.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_32767.2: %i32 = int_value 32767 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_65536.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_65536.2: %i32 = int_value 65536 [template] -// CHECK:STDOUT: %int_2147418112: %i32 = int_value 2147418112 [template] -// CHECK:STDOUT: %int_32768.1: Core.IntLiteral = int_value 32768 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_32768.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_32768.2: %i32 = int_value 32768 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Mul = %Mul.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Mul.decl: %Mul.type.1 = fn_decl @Mul.1 [template = constants.%Mul] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Mul.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.umul"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Mul.ref.loc6: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %int_32767: Core.IntLiteral = int_value 32767 [template = constants.%int_32767.1] -// CHECK:STDOUT: %int_65536.loc6: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_32767, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_32767) [template = constants.%int_32767.2] -// CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_32767.2] -// CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_32767, %.loc6_18.1 [template = constants.%int_32767.2] -// CHECK:STDOUT: %impl.elem0.loc6_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_26: = bound_method %int_65536.loc6, %impl.elem0.loc6_26 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc6_26: = specific_function %Convert.bound.loc6_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc6_26: init %i32 = call %Convert.specific_fn.loc6_26(%int_65536.loc6) [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc6_26.1: %i32 = value_of_initializer %int.convert_checked.loc6_26 [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc6_26.2: %i32 = converted %int_65536.loc6, %.loc6_26.1 [template = constants.%int_65536.2] -// CHECK:STDOUT: %int.umul.loc6: init %i32 = call %Mul.ref.loc6(%.loc6_18.2, %.loc6_26.2) [template = constants.%int_2147418112] -// CHECK:STDOUT: %.loc6_34.1: %i32 = value_of_initializer %int.umul.loc6 [template = constants.%int_2147418112] -// CHECK:STDOUT: %.loc6_34.2: %i32 = converted %int.umul.loc6, %.loc6_34.1 [template = constants.%int_2147418112] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_34.2 -// CHECK:STDOUT: %Mul.ref.loc7: %Mul.type.1 = name_ref Mul, file.%Mul.decl [template = constants.%Mul] -// CHECK:STDOUT: %int_32768: Core.IntLiteral = int_value 32768 [template = constants.%int_32768.1] -// CHECK:STDOUT: %int_65536.loc7: Core.IntLiteral = int_value 65536 [template = constants.%int_65536.1] -// CHECK:STDOUT: %impl.elem0.loc7_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_18: = bound_method %int_32768, %impl.elem0.loc7_18 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc7_18: = specific_function %Convert.bound.loc7_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc7_18: init %i32 = call %Convert.specific_fn.loc7_18(%int_32768) [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc7_18.1: %i32 = value_of_initializer %int.convert_checked.loc7_18 [template = constants.%int_32768.2] -// CHECK:STDOUT: %.loc7_18.2: %i32 = converted %int_32768, %.loc7_18.1 [template = constants.%int_32768.2] -// CHECK:STDOUT: %impl.elem0.loc7_26: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_26: = bound_method %int_65536.loc7, %impl.elem0.loc7_26 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc7_26: = specific_function %Convert.bound.loc7_26, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc7_26: init %i32 = call %Convert.specific_fn.loc7_26(%int_65536.loc7) [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc7_26.1: %i32 = value_of_initializer %int.convert_checked.loc7_26 [template = constants.%int_65536.2] -// CHECK:STDOUT: %.loc7_26.2: %i32 = converted %int_65536.loc7, %.loc7_26.1 [template = constants.%int_65536.2] -// CHECK:STDOUT: %int.umul.loc7: init %i32 = call %Mul.ref.loc7(%.loc7_18.2, %.loc7_26.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc7_34.1: %i32 = value_of_initializer %int.umul.loc7 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc7_34.2: %i32 = converted %int.umul.loc7, %.loc7_34.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc7_34.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/unegate.carbon b/toolchain/check/testdata/builtins/int/unegate.carbon index 2575e374f3657..0bbd88372f7d4 100644 --- a/toolchain/check/testdata/builtins/int/unegate.carbon +++ b/toolchain/check/testdata/builtins/int/unegate.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/unegate.carbon @@ -17,7 +19,7 @@ let arr_p: [u32; 123]* = &arr; let n: u32 = Negate(1); -fn RuntimeCall(a: u32, b: u32) -> u32 { +fn RuntimeCallIsValid(a: u32, b: u32) -> u32 { return Negate(a); } @@ -67,7 +69,7 @@ var bad_return_type: [u32; BadReturnType(1)]; // CHECK:STDERR: var bad_call: [u32; JustRight(1, 2)]; -fn RuntimeCallTooFew(a: u32) -> u32 { +fn RuntimeCallIsValidTooFew(a: u32) -> u32 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch] // CHECK:STDERR: return TooFew(a); // CHECK:STDERR: ^~~~~~~~~ @@ -78,7 +80,7 @@ fn RuntimeCallTooFew(a: u32) -> u32 { return TooFew(a); } -fn RuntimeCallTooMany(a: u32, b: u32, c: u32) -> u32 { +fn RuntimeCallIsValidTooMany(a: u32, b: u32, c: u32) -> u32 { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:10: error: 3 arguments passed to function expecting 2 arguments [CallArgCountMismatch] // CHECK:STDERR: return TooMany(a, b, c); // CHECK:STDERR: ^~~~~~~~~~~~~~~~ @@ -89,7 +91,7 @@ fn RuntimeCallTooMany(a: u32, b: u32, c: u32) -> u32 { return TooMany(a, b, c); } -fn RuntimeCallBadReturnType(a: u32, b: u32) -> bool { +fn RuntimeCallIsValidBadReturnType(a: u32, b: u32) -> bool { // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+6]]:10: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch] // CHECK:STDERR: return BadReturnType(a, b); // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~ @@ -116,687 +118,3 @@ fn F() { Test(Negate(Negate(0x8000_0000))) as Expect(0x8000_0000); Test(-(Negate(0x8000_0000))) as Expect(0x8000_0000); } - - -// CHECK:STDOUT: --- int_negate.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_123.1: Core.IntLiteral = int_value 123 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%u32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %array_type: type = array_type %int_123.1, %u32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %u32 = int_value 1 [template] -// CHECK:STDOUT: %int_4294967295: %u32 = int_value 4294967295 [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .n = @__global_init.%n -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc2_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2: type = splice_block %u32.loc2_14 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc2_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc2_14: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %u32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %u32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc9_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc9_35: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc9_19: type = splice_block %u32.loc9_19 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc9_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc9_19: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %u32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc9_27: type = splice_block %u32.loc9_27 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc9_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc9_27: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %u32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %u32) -> %u32 = "int.unegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %u32, %b.param_patt: %u32) -> %u32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %a.ref: %u32 = name_ref a, %a -// CHECK:STDOUT: %int.unegate: init %u32 = call %Negate.ref(%a.ref) -// CHECK:STDOUT: %.loc10_19.1: %u32 = value_of_initializer %int.unegate -// CHECK:STDOUT: %.loc10_19.2: %u32 = converted %int.unegate, %.loc10_19.1 -// CHECK:STDOUT: return %.loc10_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: %Negate.ref: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %impl.elem0: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound: = bound_method %int_1, %impl.elem0 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.bound, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked: init %u32 = call %Convert.specific_fn(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc7_21.1: %u32 = value_of_initializer %int.convert_checked [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc7_21.2: %u32 = converted %int_1, %.loc7_21.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.unegate: init %u32 = call %Negate.ref(%.loc7_21.2) [template = constants.%int_4294967295] -// CHECK:STDOUT: %.loc7_23.1: %u32 = value_of_initializer %int.unegate [template = constants.%int_4294967295] -// CHECK:STDOUT: %.loc7_23.2: %u32 = converted %int.unegate, %.loc7_23.1 [template = constants.%int_4294967295] -// CHECK:STDOUT: %n: %u32 = bind_name n, %.loc7_23.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_bad_decl.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] -// CHECK:STDOUT: %TooFew.type: type = fn_type @TooFew [template] -// CHECK:STDOUT: %TooFew: %TooFew.type = struct_value () [template] -// CHECK:STDOUT: %TooMany.type: type = fn_type @TooMany [template] -// CHECK:STDOUT: %TooMany: %TooMany.type = struct_value () [template] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [template] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [template] -// CHECK:STDOUT: %BadReturnType.type: type = fn_type @BadReturnType [template] -// CHECK:STDOUT: %BadReturnType: %BadReturnType.type = struct_value () [template] -// CHECK:STDOUT: %JustRight.type: type = fn_type @JustRight [template] -// CHECK:STDOUT: %JustRight: %JustRight.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooFew.type: type = fn_type @RuntimeCallTooFew [template] -// CHECK:STDOUT: %RuntimeCallTooFew: %RuntimeCallTooFew.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallTooMany.type: type = fn_type @RuntimeCallTooMany [template] -// CHECK:STDOUT: %RuntimeCallTooMany: %RuntimeCallTooMany.type = struct_value () [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType.type: type = fn_type @RuntimeCallBadReturnType [template] -// CHECK:STDOUT: %RuntimeCallBadReturnType: %RuntimeCallBadReturnType.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.1 -// CHECK:STDOUT: .Bool = %import_ref.5 -// CHECK:STDOUT: .ImplicitAs = %import_ref.6 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .TooFew = %TooFew.decl -// CHECK:STDOUT: .TooMany = %TooMany.decl -// CHECK:STDOUT: .BadReturnType = %BadReturnType.decl -// CHECK:STDOUT: .JustRight = %JustRight.decl -// CHECK:STDOUT: .too_few = %too_few -// CHECK:STDOUT: .too_many = %too_many -// CHECK:STDOUT: .bad_return_type = %bad_return_type -// CHECK:STDOUT: .bad_call = %bad_call -// CHECK:STDOUT: .RuntimeCallTooFew = %RuntimeCallTooFew.decl -// CHECK:STDOUT: .RuntimeCallTooMany = %RuntimeCallTooMany.decl -// CHECK:STDOUT: .RuntimeCallBadReturnType = %RuntimeCallBadReturnType.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %TooFew.decl: %TooFew.type = fn_decl @TooFew [template = constants.%TooFew] { -// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param0 -// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %TooMany.decl: %TooMany.type = fn_decl @TooMany [template = constants.%TooMany] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %u32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %u32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc13_31: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc13_31: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc13_15: type = splice_block %u32.loc13_15 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc13_15: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc13_15: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %u32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc13_23: type = splice_block %u32.loc13_23 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc13_23: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc13_23: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %u32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [template = constants.%BadReturnType] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc18_29.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [template = bool] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc18_21: type = splice_block %u32 [template = constants.%u32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param1 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %JustRight.decl: %JustRight.type = fn_decl @JustRight [template = constants.%JustRight] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc19_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc19_25: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc19: type = splice_block %u32.loc19_17 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc19_17: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc19_17: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %too_few.var: ref = var too_few -// CHECK:STDOUT: %too_few: ref = bind_name too_few, %too_few.var -// CHECK:STDOUT: %too_many.var: ref = var too_many -// CHECK:STDOUT: %too_many: ref = bind_name too_many, %too_many.var -// CHECK:STDOUT: %bad_return_type.var: ref = var bad_return_type -// CHECK:STDOUT: %bad_return_type: ref = bind_name bad_return_type, %bad_return_type.var -// CHECK:STDOUT: %bad_call.var: ref = var bad_call -// CHECK:STDOUT: %bad_call: ref = bind_name bad_call, %bad_call.var -// CHECK:STDOUT: %RuntimeCallTooFew.decl: %RuntimeCallTooFew.type = fn_decl @RuntimeCallTooFew [template = constants.%RuntimeCallTooFew] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc46_33: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc46_33: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc46: type = splice_block %u32.loc46_25 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc46_25: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc46_25: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallTooMany.decl: %RuntimeCallTooMany.type = fn_decl @RuntimeCallTooMany [template = constants.%RuntimeCallTooMany] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %u32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %u32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %c.patt: %u32 = binding_pattern c -// CHECK:STDOUT: %c.param_patt: %u32 = value_param_pattern %c.patt, runtime_param2 -// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param3 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc57_50: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc57_50: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc57_26: type = splice_block %u32.loc57_26 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc57_26: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc57_26: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %u32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc57_34: type = splice_block %u32.loc57_34 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc57_34: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc57_34: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %u32 = bind_name b, %b.param -// CHECK:STDOUT: %c.param: %u32 = value_param runtime_param2 -// CHECK:STDOUT: %.loc57_42: type = splice_block %u32.loc57_42 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc57_42: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc57_42: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %c: %u32 = bind_name c, %c.param -// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param3 -// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %RuntimeCallBadReturnType.decl: %RuntimeCallBadReturnType.type = fn_decl @RuntimeCallBadReturnType [template = constants.%RuntimeCallBadReturnType] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %u32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %u32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: bool = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: bool = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %bool.make_type: init type = call constants.%Bool() [template = bool] -// CHECK:STDOUT: %.loc68_48.1: type = value_of_initializer %bool.make_type [template = bool] -// CHECK:STDOUT: %.loc68_48.2: type = converted %bool.make_type, %.loc68_48.1 [template = bool] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc68_32: type = splice_block %u32.loc68_32 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc68_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc68_32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %u32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc68_40: type = splice_block %u32.loc68_40 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc68_40: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc68_40: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %u32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref bool = out_param runtime_param2 -// CHECK:STDOUT: %return: ref bool = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @TooFew() -> %u32; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @TooMany(%a.param_patt: %u32, %b.param_patt: %u32) -> %u32; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @BadReturnType(%a.param_patt: %u32) -> bool; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @JustRight(%a.param_patt: %u32) -> %u32 = "int.unegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooFew(%a.param_patt: %u32) -> %u32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [template = constants.%TooFew] -// CHECK:STDOUT: %a.ref: %u32 = name_ref a, %a -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallTooMany(%a.param_patt: %u32, %b.param_patt: %u32, %c.param_patt: %u32) -> %u32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [template = constants.%TooMany] -// CHECK:STDOUT: %a.ref: %u32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %u32 = name_ref b, %b -// CHECK:STDOUT: %c.ref: %u32 = name_ref c, %c -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCallBadReturnType(%a.param_patt: %u32, %b.param_patt: %u32) -> bool { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [template = constants.%BadReturnType] -// CHECK:STDOUT: %a.ref: %u32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %u32 = name_ref b, %b -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- overflow.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(%int_32) [template] -// CHECK:STDOUT: %Negate.type.1: type = fn_type @Negate.1 [template] -// CHECK:STDOUT: %Negate: %Negate.type.1 = struct_value () [template] -// CHECK:STDOUT: %N.2: %u32 = bind_symbolic_name N, 0 [symbolic] -// CHECK:STDOUT: %N.patt.2: %u32 = symbolic_binding_pattern N, 0 [symbolic] -// CHECK:STDOUT: %Expect.type: type = generic_class_type @Expect [template] -// CHECK:STDOUT: %Expect.generic: %Expect.type = struct_value () [template] -// CHECK:STDOUT: %Expect.1: type = class_type @Expect, @Expect(%N.2) [symbolic] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [template] -// CHECK:STDOUT: %complete_type.3: = complete_type_witness %empty_struct_type [template] -// CHECK:STDOUT: %Test.type: type = fn_type @Test [template] -// CHECK:STDOUT: %Test: %Test.type = struct_value () [template] -// CHECK:STDOUT: %require_complete.2: = require_complete_type %Expect.1 [symbolic] -// CHECK:STDOUT: %Expect.val.1: %Expect.1 = struct_value () [symbolic] -// CHECK:STDOUT: %F.type: type = fn_type @F [template] -// CHECK:STDOUT: %F: %F.type = struct_value () [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%u32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %u32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_2147483649: %u32 = int_value 2147483649 [template] -// CHECK:STDOUT: %Expect.2: type = class_type @Expect, @Expect(%int_2147483647.2) [template] -// CHECK:STDOUT: %Test.specific_fn.1: = specific_function %Test, @Test(%int_2147483647.2) [template] -// CHECK:STDOUT: %Op.type.13: type = fn_type @Op.13 [template] -// CHECK:STDOUT: %Op.type.14: type = fn_type @Op.5, @impl.11(%int_32) [template] -// CHECK:STDOUT: %Op.14: %Op.type.14 = struct_value () [template] -// CHECK:STDOUT: %interface.20: = interface_witness (%Op.14) [template] -// CHECK:STDOUT: %Op.bound.1: = bound_method %int_2147483649, %Op.14 [template] -// CHECK:STDOUT: %Op.specific_fn.1: = specific_function %Op.bound.1, @Op.5(%int_32) [template] -// CHECK:STDOUT: %int_2147483648.1: Core.IntLiteral = int_value 2147483648 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483648.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483648.2: %u32 = int_value 2147483648 [template] -// CHECK:STDOUT: %Expect.3: type = class_type @Expect, @Expect(%int_2147483648.2) [template] -// CHECK:STDOUT: %Test.specific_fn.2: = specific_function %Test, @Test(%int_2147483648.2) [template] -// CHECK:STDOUT: %Op.bound.2: = bound_method %int_2147483648.2, %Op.14 [template] -// CHECK:STDOUT: %Op.specific_fn.2: = specific_function %Op.bound.2, @Op.5(%int_32) [template] -// CHECK:STDOUT: %Expect.val.2: %Expect.2 = struct_value () [template] -// CHECK:STDOUT: %Expect.val.3: %Expect.3 = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .UInt = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: .Negate = %import_ref.193 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Negate = %Negate.decl -// CHECK:STDOUT: .Expect = %Expect.decl -// CHECK:STDOUT: .Test = %Test.decl -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Negate.decl: %Negate.type.1 = fn_decl @Negate.1 [template = constants.%Negate] { -// CHECK:STDOUT: %a.patt: %u32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %u32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %return.patt: %u32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %u32 = out_param_pattern %return.patt, runtime_param1 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_22: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc4_22: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: %a.param: %u32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4: type = splice_block %u32.loc4_14 [template = constants.%u32] { -// CHECK:STDOUT: %int_32.loc4_14: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32.loc4_14: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %u32 = bind_name a, %a.param -// CHECK:STDOUT: %return.param: ref %u32 = out_param runtime_param1 -// CHECK:STDOUT: %return: ref %u32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %Expect.decl: %Expect.type = class_decl @Expect [template = constants.%Expect.generic] { -// CHECK:STDOUT: %N.patt.loc6_14.1: %u32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_14.2 (constants.%N.patt.2)] -// CHECK:STDOUT: %N.param_patt: %u32 = value_param_pattern %N.patt.loc6_14.1, runtime_param [symbolic = %N.patt.loc6_14.2 (constants.%N.patt.2)] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %N.param: %u32 = value_param runtime_param -// CHECK:STDOUT: %.loc6: type = splice_block %u32 [template = constants.%u32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc6_14.1: %u32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc6_14.2 (constants.%N.2)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %Test.decl: %Test.type = fn_decl @Test [template = constants.%Test] { -// CHECK:STDOUT: %N.patt.loc7_9.1: %u32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc7_9.2 (constants.%N.patt.2)] -// CHECK:STDOUT: %N.param_patt: %u32 = value_param_pattern %N.patt.loc7_9.1, runtime_param [symbolic = %N.patt.loc7_9.2 (constants.%N.patt.2)] -// CHECK:STDOUT: %return.patt: @Test.%Expect.loc7_29.2 (%Expect.1) = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: @Test.%Expect.loc7_29.2 (%Expect.1) = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %Expect.ref: %Expect.type = name_ref Expect, file.%Expect.decl [template = constants.%Expect.generic] -// CHECK:STDOUT: %N.ref: %u32 = name_ref N, %N.loc7_9.1 [symbolic = %N.loc7_9.2 (constants.%N.2)] -// CHECK:STDOUT: %Expect.loc7_29.1: type = class_type @Expect, @Expect(constants.%N.2) [symbolic = %Expect.loc7_29.2 (constants.%Expect.1)] -// CHECK:STDOUT: %N.param: %u32 = value_param runtime_param -// CHECK:STDOUT: %.loc7_13: type = splice_block %u32 [template = constants.%u32] { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %u32: type = class_type @UInt, @UInt(constants.%int_32) [template = constants.%u32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.loc7_9.1: %u32 = bind_symbolic_name N, 0, %N.param [symbolic = %N.loc7_9.2 (constants.%N.2)] -// CHECK:STDOUT: %return.param: ref @Test.%Expect.loc7_29.2 (%Expect.1) = out_param runtime_param0 -// CHECK:STDOUT: %return: ref @Test.%Expect.loc7_29.2 (%Expect.1) = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {} -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic class @Expect(%N.loc6_14.1: %u32) { -// CHECK:STDOUT: %N.loc6_14.2: %u32 = bind_symbolic_name N, 0 [symbolic = %N.loc6_14.2 (constants.%N.2)] -// CHECK:STDOUT: %N.patt.loc6_14.2: %u32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc6_14.2 (constants.%N.patt.2)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: -// CHECK:STDOUT: class { -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [template = constants.%complete_type.3] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%Expect.1 -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Negate.1(%a.param_patt: %u32) -> %u32 = "int.unegate"; -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @Test(%N.loc7_9.1: %u32) { -// CHECK:STDOUT: %N.loc7_9.2: %u32 = bind_symbolic_name N, 0 [symbolic = %N.loc7_9.2 (constants.%N.2)] -// CHECK:STDOUT: %N.patt.loc7_9.2: %u32 = symbolic_binding_pattern N, 0 [symbolic = %N.patt.loc7_9.2 (constants.%N.patt.2)] -// CHECK:STDOUT: %Expect.loc7_29.2: type = class_type @Expect, @Expect(%N.loc7_9.2) [symbolic = %Expect.loc7_29.2 (constants.%Expect.1)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete: = require_complete_type @Test.%Expect.loc7_29.2 (%Expect.1) [symbolic = %require_complete (constants.%require_complete.2)] -// CHECK:STDOUT: %Expect.val: @Test.%Expect.loc7_29.2 (%Expect.1) = struct_value () [symbolic = %Expect.val (constants.%Expect.val.1)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%N.param_patt: %u32) -> %return.param_patt: @Test.%Expect.loc7_29.2 (%Expect.1) { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc7_41.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc7_41.2: init @Test.%Expect.loc7_29.2 (%Expect.1) = class_init (), %return [symbolic = %Expect.val (constants.%Expect.val.1)] -// CHECK:STDOUT: %.loc7_42: init @Test.%Expect.loc7_29.2 (%Expect.1) = converted %.loc7_41.1, %.loc7_41.2 [symbolic = %Expect.val (constants.%Expect.val.1)] -// CHECK:STDOUT: return %.loc7_42 to %return -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Test.ref.loc11: %Test.type = name_ref Test, file.%Test.decl [template = constants.%Test] -// CHECK:STDOUT: %Negate.ref.loc11_8: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Negate.ref.loc11_15: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc11_22: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc11_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_22: = bound_method %int_2147483647.loc11_22, %impl.elem0.loc11_22 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc11_22: = specific_function %Convert.bound.loc11_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc11_22: init %u32 = call %Convert.specific_fn.loc11_22(%int_2147483647.loc11_22) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_22.1: %u32 = value_of_initializer %int.convert_checked.loc11_22 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_22.2: %u32 = converted %int_2147483647.loc11_22, %.loc11_22.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.unegate.loc11_33: init %u32 = call %Negate.ref.loc11_15(%.loc11_22.2) [template = constants.%int_2147483649] -// CHECK:STDOUT: %.loc11_33.1: %u32 = value_of_initializer %int.unegate.loc11_33 [template = constants.%int_2147483649] -// CHECK:STDOUT: %.loc11_33.2: %u32 = converted %int.unegate.loc11_33, %.loc11_33.1 [template = constants.%int_2147483649] -// CHECK:STDOUT: %int.unegate.loc11_34: init %u32 = call %Negate.ref.loc11_8(%.loc11_33.2) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_35.1: %u32 = value_of_initializer %int.unegate.loc11_34 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_35.2: %u32 = converted %int.unegate.loc11_34, %.loc11_35.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %Test.specific_fn.loc11: = specific_function %Test.ref.loc11, @Test(constants.%int_2147483647.2) [template = constants.%Test.specific_fn.1] -// CHECK:STDOUT: %.loc11_35.3: ref %Expect.2 = temporary_storage -// CHECK:STDOUT: %Test.call.loc11: init %Expect.2 = call %Test.specific_fn.loc11() to %.loc11_35.3 -// CHECK:STDOUT: %Expect.ref.loc11: %Expect.type = name_ref Expect, file.%Expect.decl [template = constants.%Expect.generic] -// CHECK:STDOUT: %int_2147483647.loc11_47: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc11_58: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc11_58: = bound_method %int_2147483647.loc11_47, %impl.elem0.loc11_58 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc11_58: = specific_function %Convert.bound.loc11_58, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc11_58: init %u32 = call %Convert.specific_fn.loc11_58(%int_2147483647.loc11_47) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_58.1: %u32 = value_of_initializer %int.convert_checked.loc11_58 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc11_58.2: %u32 = converted %int_2147483647.loc11_47, %.loc11_58.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %Expect.loc11: type = class_type @Expect, @Expect(constants.%int_2147483647.2) [template = constants.%Expect.2] -// CHECK:STDOUT: %.loc11_35.4: ref %Expect.2 = temporary %.loc11_35.3, %Test.call.loc11 -// CHECK:STDOUT: %Test.ref.loc12: %Test.type = name_ref Test, file.%Test.decl [template = constants.%Test] -// CHECK:STDOUT: %Negate.ref.loc12: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483647.loc12_17: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_17: = bound_method %int_2147483647.loc12_17, %impl.elem0.loc12_17 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_17: = specific_function %Convert.bound.loc12_17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_17: init %u32 = call %Convert.specific_fn.loc12_17(%int_2147483647.loc12_17) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_17.1: %u32 = value_of_initializer %int.convert_checked.loc12_17 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_17.2: %u32 = converted %int_2147483647.loc12_17, %.loc12_17.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.unegate.loc12_28: init %u32 = call %Negate.ref.loc12(%.loc12_17.2) [template = constants.%int_2147483649] -// CHECK:STDOUT: %impl.elem0.loc12_8: %Op.type.13 = interface_witness_access constants.%interface.20, element0 [template = constants.%Op.14] -// CHECK:STDOUT: %Op.bound.loc12: = bound_method %int.unegate.loc12_28, %impl.elem0.loc12_8 [template = constants.%Op.bound.1] -// CHECK:STDOUT: %Op.specific_fn.loc12: = specific_function %Op.bound.loc12, @Op.5(constants.%int_32) [template = constants.%Op.specific_fn.1] -// CHECK:STDOUT: %.loc12_28.1: %u32 = value_of_initializer %int.unegate.loc12_28 [template = constants.%int_2147483649] -// CHECK:STDOUT: %.loc12_28.2: %u32 = converted %int.unegate.loc12_28, %.loc12_28.1 [template = constants.%int_2147483649] -// CHECK:STDOUT: %int.unegate.loc12_8: init %u32 = call %Op.specific_fn.loc12(%.loc12_28.2) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_30.1: %u32 = value_of_initializer %int.unegate.loc12_8 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_30.2: %u32 = converted %int.unegate.loc12_8, %.loc12_30.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %Test.specific_fn.loc12: = specific_function %Test.ref.loc12, @Test(constants.%int_2147483647.2) [template = constants.%Test.specific_fn.1] -// CHECK:STDOUT: %.loc12_30.3: ref %Expect.2 = temporary_storage -// CHECK:STDOUT: %Test.call.loc12: init %Expect.2 = call %Test.specific_fn.loc12() to %.loc12_30.3 -// CHECK:STDOUT: %Expect.ref.loc12: %Expect.type = name_ref Expect, file.%Expect.decl [template = constants.%Expect.generic] -// CHECK:STDOUT: %int_2147483647.loc12_42: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc12_53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc12_53: = bound_method %int_2147483647.loc12_42, %impl.elem0.loc12_53 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc12_53: = specific_function %Convert.bound.loc12_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc12_53: init %u32 = call %Convert.specific_fn.loc12_53(%int_2147483647.loc12_42) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_53.1: %u32 = value_of_initializer %int.convert_checked.loc12_53 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc12_53.2: %u32 = converted %int_2147483647.loc12_42, %.loc12_53.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %Expect.loc12: type = class_type @Expect, @Expect(constants.%int_2147483647.2) [template = constants.%Expect.2] -// CHECK:STDOUT: %.loc12_30.4: ref %Expect.2 = temporary %.loc12_30.3, %Test.call.loc12 -// CHECK:STDOUT: %Test.ref.loc14: %Test.type = name_ref Test, file.%Test.decl [template = constants.%Test] -// CHECK:STDOUT: %Negate.ref.loc14_8: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %Negate.ref.loc14_15: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483648.loc14_22: Core.IntLiteral = int_value 2147483648 [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %impl.elem0.loc14_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14_22: = bound_method %int_2147483648.loc14_22, %impl.elem0.loc14_22 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc14_22: = specific_function %Convert.bound.loc14_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc14_22: init %u32 = call %Convert.specific_fn.loc14_22(%int_2147483648.loc14_22) [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc14_22.1: %u32 = value_of_initializer %int.convert_checked.loc14_22 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc14_22.2: %u32 = converted %int_2147483648.loc14_22, %.loc14_22.1 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %int.unegate.loc14_33: init %u32 = call %Negate.ref.loc14_15(%.loc14_22.2) [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc14_33.1: %u32 = value_of_initializer %int.unegate.loc14_33 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc14_33.2: %u32 = converted %int.unegate.loc14_33, %.loc14_33.1 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %int.unegate.loc14_34: init %u32 = call %Negate.ref.loc14_8(%.loc14_33.2) [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc14_35.1: %u32 = value_of_initializer %int.unegate.loc14_34 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc14_35.2: %u32 = converted %int.unegate.loc14_34, %.loc14_35.1 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %Test.specific_fn.loc14: = specific_function %Test.ref.loc14, @Test(constants.%int_2147483648.2) [template = constants.%Test.specific_fn.2] -// CHECK:STDOUT: %.loc14_35.3: ref %Expect.3 = temporary_storage -// CHECK:STDOUT: %Test.call.loc14: init %Expect.3 = call %Test.specific_fn.loc14() to %.loc14_35.3 -// CHECK:STDOUT: %Expect.ref.loc14: %Expect.type = name_ref Expect, file.%Expect.decl [template = constants.%Expect.generic] -// CHECK:STDOUT: %int_2147483648.loc14_47: Core.IntLiteral = int_value 2147483648 [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %impl.elem0.loc14_58: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc14_58: = bound_method %int_2147483648.loc14_47, %impl.elem0.loc14_58 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc14_58: = specific_function %Convert.bound.loc14_58, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc14_58: init %u32 = call %Convert.specific_fn.loc14_58(%int_2147483648.loc14_47) [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc14_58.1: %u32 = value_of_initializer %int.convert_checked.loc14_58 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc14_58.2: %u32 = converted %int_2147483648.loc14_47, %.loc14_58.1 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %Expect.loc14: type = class_type @Expect, @Expect(constants.%int_2147483648.2) [template = constants.%Expect.3] -// CHECK:STDOUT: %.loc14_35.4: ref %Expect.3 = temporary %.loc14_35.3, %Test.call.loc14 -// CHECK:STDOUT: %Test.ref.loc15: %Test.type = name_ref Test, file.%Test.decl [template = constants.%Test] -// CHECK:STDOUT: %Negate.ref.loc15: %Negate.type.1 = name_ref Negate, file.%Negate.decl [template = constants.%Negate] -// CHECK:STDOUT: %int_2147483648.loc15_17: Core.IntLiteral = int_value 2147483648 [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %impl.elem0.loc15_17: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_17: = bound_method %int_2147483648.loc15_17, %impl.elem0.loc15_17 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc15_17: = specific_function %Convert.bound.loc15_17, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc15_17: init %u32 = call %Convert.specific_fn.loc15_17(%int_2147483648.loc15_17) [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc15_17.1: %u32 = value_of_initializer %int.convert_checked.loc15_17 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc15_17.2: %u32 = converted %int_2147483648.loc15_17, %.loc15_17.1 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %int.unegate.loc15_28: init %u32 = call %Negate.ref.loc15(%.loc15_17.2) [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %impl.elem0.loc15_8: %Op.type.13 = interface_witness_access constants.%interface.20, element0 [template = constants.%Op.14] -// CHECK:STDOUT: %Op.bound.loc15: = bound_method %int.unegate.loc15_28, %impl.elem0.loc15_8 [template = constants.%Op.bound.2] -// CHECK:STDOUT: %Op.specific_fn.loc15: = specific_function %Op.bound.loc15, @Op.5(constants.%int_32) [template = constants.%Op.specific_fn.2] -// CHECK:STDOUT: %.loc15_28.1: %u32 = value_of_initializer %int.unegate.loc15_28 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc15_28.2: %u32 = converted %int.unegate.loc15_28, %.loc15_28.1 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %int.unegate.loc15_8: init %u32 = call %Op.specific_fn.loc15(%.loc15_28.2) [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc15_30.1: %u32 = value_of_initializer %int.unegate.loc15_8 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc15_30.2: %u32 = converted %int.unegate.loc15_8, %.loc15_30.1 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %Test.specific_fn.loc15: = specific_function %Test.ref.loc15, @Test(constants.%int_2147483648.2) [template = constants.%Test.specific_fn.2] -// CHECK:STDOUT: %.loc15_30.3: ref %Expect.3 = temporary_storage -// CHECK:STDOUT: %Test.call.loc15: init %Expect.3 = call %Test.specific_fn.loc15() to %.loc15_30.3 -// CHECK:STDOUT: %Expect.ref.loc15: %Expect.type = name_ref Expect, file.%Expect.decl [template = constants.%Expect.generic] -// CHECK:STDOUT: %int_2147483648.loc15_42: Core.IntLiteral = int_value 2147483648 [template = constants.%int_2147483648.1] -// CHECK:STDOUT: %impl.elem0.loc15_53: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc15_53: = bound_method %int_2147483648.loc15_42, %impl.elem0.loc15_53 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc15_53: = specific_function %Convert.bound.loc15_53, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc15_53: init %u32 = call %Convert.specific_fn.loc15_53(%int_2147483648.loc15_42) [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc15_53.1: %u32 = value_of_initializer %int.convert_checked.loc15_53 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %.loc15_53.2: %u32 = converted %int_2147483648.loc15_42, %.loc15_53.1 [template = constants.%int_2147483648.2] -// CHECK:STDOUT: %Expect.loc15: type = class_type @Expect, @Expect(constants.%int_2147483648.2) [template = constants.%Expect.3] -// CHECK:STDOUT: %.loc15_30.4: ref %Expect.3 = temporary %.loc15_30.3, %Test.call.loc15 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Expect(constants.%N.2) { -// CHECK:STDOUT: %N.loc6_14.2 => constants.%N.2 -// CHECK:STDOUT: %N.patt.loc6_14.2 => constants.%N.2 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Expect(@Test.%N.loc7_9.2) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%N.2) { -// CHECK:STDOUT: %N.loc7_9.2 => constants.%N.2 -// CHECK:STDOUT: %N.patt.loc7_9.2 => constants.%N.2 -// CHECK:STDOUT: %Expect.loc7_29.2 => constants.%Expect.1 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%int_2147483647.2) { -// CHECK:STDOUT: %N.loc7_9.2 => constants.%int_2147483647.2 -// CHECK:STDOUT: %N.patt.loc7_9.2 => constants.%int_2147483647.2 -// CHECK:STDOUT: %Expect.loc7_29.2 => constants.%Expect.2 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.3 -// CHECK:STDOUT: %Expect.val => constants.%Expect.val.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Expect(constants.%int_2147483647.2) { -// CHECK:STDOUT: %N.loc6_14.2 => constants.%int_2147483647.2 -// CHECK:STDOUT: %N.patt.loc6_14.2 => constants.%int_2147483647.2 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Test(constants.%int_2147483648.2) { -// CHECK:STDOUT: %N.loc7_9.2 => constants.%int_2147483648.2 -// CHECK:STDOUT: %N.patt.loc7_9.2 => constants.%int_2147483648.2 -// CHECK:STDOUT: %Expect.loc7_29.2 => constants.%Expect.3 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %require_complete => constants.%complete_type.3 -// CHECK:STDOUT: %Expect.val => constants.%Expect.val.3 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Expect(constants.%int_2147483648.2) { -// CHECK:STDOUT: %N.loc6_14.2 => constants.%int_2147483648.2 -// CHECK:STDOUT: %N.patt.loc6_14.2 => constants.%int_2147483648.2 -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/usub.carbon b/toolchain/check/testdata/builtins/int/usub.carbon index 728eb51c14050..662d33f36fbac 100644 --- a/toolchain/check/testdata/builtins/int/usub.carbon +++ b/toolchain/check/testdata/builtins/int/usub.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/usub.carbon @@ -15,7 +17,7 @@ fn Sub(a: i32, b: i32) -> i32 = "int.usub"; var arr: [i32; Sub(3, 2)]; let arr_p: [i32; 1]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Sub(a, b); } @@ -28,273 +30,3 @@ fn Sub(a: i32, b: i32) -> i32 = "int.usub"; let a: i32 = Sub(0, 0x7FFFFFFF); let b: i32 = Sub(Sub(0, 0x7FFFFFFF), 1); let c: i32 = Sub(Sub(0, 0x7FFFFFFF), 2); - -// CHECK:STDOUT: --- int_sub.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: %Sub.type.1: type = fn_type @Sub.1 [template] -// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_1.2: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_1.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Sub.ref: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.usub: init %i32 = call %Sub.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.usub -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.usub, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- overflow.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: %Sub.type.1: type = fn_type @Sub.1 [template] -// CHECK:STDOUT: %Sub: %Sub.type.1 = struct_value () [template] -// CHECK:STDOUT: %int_0.1: Core.IntLiteral = int_value 0 [template] -// CHECK:STDOUT: %int_2147483647.1: Core.IntLiteral = int_value 2147483647 [template] -// CHECK:STDOUT: %Convert.type.2: type = fn_type @Convert.1, @ImplicitAs(%i32) [template] -// CHECK:STDOUT: %Convert.type.10: type = fn_type @Convert.2, @impl.1(%int_32) [template] -// CHECK:STDOUT: %Convert.10: %Convert.type.10 = struct_value () [template] -// CHECK:STDOUT: %interface.19: = interface_witness (%Convert.10) [template] -// CHECK:STDOUT: %Convert.bound.1: = bound_method %int_0.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.1: = specific_function %Convert.bound.1, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_0.2: %i32 = int_value 0 [template] -// CHECK:STDOUT: %Convert.bound.2: = bound_method %int_2147483647.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.2: = specific_function %Convert.bound.2, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2147483647.2: %i32 = int_value 2147483647 [template] -// CHECK:STDOUT: %int_-2147483647: %i32 = int_value -2147483647 [template] -// CHECK:STDOUT: %int_1.1: Core.IntLiteral = int_value 1 [template] -// CHECK:STDOUT: %Convert.bound.3: = bound_method %int_1.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.3: = specific_function %Convert.bound.3, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_1.2: %i32 = int_value 1 [template] -// CHECK:STDOUT: %int_-2147483648: %i32 = int_value -2147483648 [template] -// CHECK:STDOUT: %int_2.1: Core.IntLiteral = int_value 2 [template] -// CHECK:STDOUT: %Convert.bound.4: = bound_method %int_2.1, %Convert.10 [template] -// CHECK:STDOUT: %Convert.specific_fn.4: = specific_function %Convert.bound.4, @Convert.2(%int_32) [template] -// CHECK:STDOUT: %int_2.2: %i32 = int_value 2 [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Sub = %Sub.decl -// CHECK:STDOUT: .a = @__global_init.%a -// CHECK:STDOUT: .b = @__global_init.%b -// CHECK:STDOUT: .c = @__global_init.%c -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Sub.decl: %Sub.type.1 = fn_decl @Sub.1 [template = constants.%Sub] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc4_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc4_11: type = splice_block %i32.loc4_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc4_19: type = splice_block %i32.loc4_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc4_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Sub.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.usub"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Sub.ref.loc6: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %int_0.loc6: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_2147483647.loc6: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc6_18: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_18: = bound_method %int_0.loc6, %impl.elem0.loc6_18 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc6_18: = specific_function %Convert.bound.loc6_18, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc6_18: init %i32 = call %Convert.specific_fn.loc6_18(%int_0.loc6) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc6_18.1: %i32 = value_of_initializer %int.convert_checked.loc6_18 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc6_18.2: %i32 = converted %int_0.loc6, %.loc6_18.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc6_21: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc6_21: = bound_method %int_2147483647.loc6, %impl.elem0.loc6_21 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc6_21: = specific_function %Convert.bound.loc6_21, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc6_21: init %i32 = call %Convert.specific_fn.loc6_21(%int_2147483647.loc6) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_21.1: %i32 = value_of_initializer %int.convert_checked.loc6_21 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc6_21.2: %i32 = converted %int_2147483647.loc6, %.loc6_21.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.usub.loc6: init %i32 = call %Sub.ref.loc6(%.loc6_18.2, %.loc6_21.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc6_32.1: %i32 = value_of_initializer %int.usub.loc6 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc6_32.2: %i32 = converted %int.usub.loc6, %.loc6_32.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %a: %i32 = bind_name a, %.loc6_32.2 -// CHECK:STDOUT: %Sub.ref.loc7_14: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Sub.ref.loc7_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %int_0.loc7: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_2147483647.loc7: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc7_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_22: = bound_method %int_0.loc7, %impl.elem0.loc7_22 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc7_22: = specific_function %Convert.bound.loc7_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc7_22: init %i32 = call %Convert.specific_fn.loc7_22(%int_0.loc7) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc7_22.1: %i32 = value_of_initializer %int.convert_checked.loc7_22 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc7_22.2: %i32 = converted %int_0.loc7, %.loc7_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc7_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_25: = bound_method %int_2147483647.loc7, %impl.elem0.loc7_25 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc7_25: = specific_function %Convert.bound.loc7_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc7_25: init %i32 = call %Convert.specific_fn.loc7_25(%int_2147483647.loc7) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc7_25.1: %i32 = value_of_initializer %int.convert_checked.loc7_25 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc7_25.2: %i32 = converted %int_2147483647.loc7, %.loc7_25.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.usub.loc7_35: init %i32 = call %Sub.ref.loc7_18(%.loc7_22.2, %.loc7_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.1] -// CHECK:STDOUT: %.loc7_35.1: %i32 = value_of_initializer %int.usub.loc7_35 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc7_35.2: %i32 = converted %int.usub.loc7_35, %.loc7_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc7_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc7_38: = bound_method %int_1, %impl.elem0.loc7_38 [template = constants.%Convert.bound.3] -// CHECK:STDOUT: %Convert.specific_fn.loc7_38: = specific_function %Convert.bound.loc7_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.3] -// CHECK:STDOUT: %int.convert_checked.loc7_38: init %i32 = call %Convert.specific_fn.loc7_38(%int_1) [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc7_38.1: %i32 = value_of_initializer %int.convert_checked.loc7_38 [template = constants.%int_1.2] -// CHECK:STDOUT: %.loc7_38.2: %i32 = converted %int_1, %.loc7_38.1 [template = constants.%int_1.2] -// CHECK:STDOUT: %int.usub.loc7_39: init %i32 = call %Sub.ref.loc7_14(%.loc7_35.2, %.loc7_38.2) [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc7_40.1: %i32 = value_of_initializer %int.usub.loc7_39 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %.loc7_40.2: %i32 = converted %int.usub.loc7_39, %.loc7_40.1 [template = constants.%int_-2147483648] -// CHECK:STDOUT: %b: %i32 = bind_name b, %.loc7_40.2 -// CHECK:STDOUT: %Sub.ref.loc8_14: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %Sub.ref.loc8_18: %Sub.type.1 = name_ref Sub, file.%Sub.decl [template = constants.%Sub] -// CHECK:STDOUT: %int_0.loc8: Core.IntLiteral = int_value 0 [template = constants.%int_0.1] -// CHECK:STDOUT: %int_2147483647.loc8: Core.IntLiteral = int_value 2147483647 [template = constants.%int_2147483647.1] -// CHECK:STDOUT: %impl.elem0.loc8_22: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_22: = bound_method %int_0.loc8, %impl.elem0.loc8_22 [template = constants.%Convert.bound.1] -// CHECK:STDOUT: %Convert.specific_fn.loc8_22: = specific_function %Convert.bound.loc8_22, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.1] -// CHECK:STDOUT: %int.convert_checked.loc8_22: init %i32 = call %Convert.specific_fn.loc8_22(%int_0.loc8) [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc8_22.1: %i32 = value_of_initializer %int.convert_checked.loc8_22 [template = constants.%int_0.2] -// CHECK:STDOUT: %.loc8_22.2: %i32 = converted %int_0.loc8, %.loc8_22.1 [template = constants.%int_0.2] -// CHECK:STDOUT: %impl.elem0.loc8_25: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_25: = bound_method %int_2147483647.loc8, %impl.elem0.loc8_25 [template = constants.%Convert.bound.2] -// CHECK:STDOUT: %Convert.specific_fn.loc8_25: = specific_function %Convert.bound.loc8_25, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.2] -// CHECK:STDOUT: %int.convert_checked.loc8_25: init %i32 = call %Convert.specific_fn.loc8_25(%int_2147483647.loc8) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_25.1: %i32 = value_of_initializer %int.convert_checked.loc8_25 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_25.2: %i32 = converted %int_2147483647.loc8, %.loc8_25.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %int.usub.loc8_35: init %i32 = call %Sub.ref.loc8_18(%.loc8_22.2, %.loc8_25.2) [template = constants.%int_-2147483647] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.1] -// CHECK:STDOUT: %.loc8_35.1: %i32 = value_of_initializer %int.usub.loc8_35 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %.loc8_35.2: %i32 = converted %int.usub.loc8_35, %.loc8_35.1 [template = constants.%int_-2147483647] -// CHECK:STDOUT: %impl.elem0.loc8_38: %Convert.type.2 = interface_witness_access constants.%interface.19, element0 [template = constants.%Convert.10] -// CHECK:STDOUT: %Convert.bound.loc8_38: = bound_method %int_2, %impl.elem0.loc8_38 [template = constants.%Convert.bound.4] -// CHECK:STDOUT: %Convert.specific_fn.loc8_38: = specific_function %Convert.bound.loc8_38, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.4] -// CHECK:STDOUT: %int.convert_checked.loc8_38: init %i32 = call %Convert.specific_fn.loc8_38(%int_2) [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc8_38.1: %i32 = value_of_initializer %int.convert_checked.loc8_38 [template = constants.%int_2.2] -// CHECK:STDOUT: %.loc8_38.2: %i32 = converted %int_2, %.loc8_38.1 [template = constants.%int_2.2] -// CHECK:STDOUT: %int.usub.loc8_39: init %i32 = call %Sub.ref.loc8_14(%.loc8_35.2, %.loc8_38.2) [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_40.1: %i32 = value_of_initializer %int.usub.loc8_39 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %.loc8_40.2: %i32 = converted %int.usub.loc8_39, %.loc8_40.1 [template = constants.%int_2147483647.2] -// CHECK:STDOUT: %c: %i32 = bind_name c, %.loc8_40.2 -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int/xor.carbon b/toolchain/check/testdata/builtins/int/xor.carbon index f3503f7d002b8..5471c38e8b83f 100644 --- a/toolchain/check/testdata/builtins/int/xor.carbon +++ b/toolchain/check/testdata/builtins/int/xor.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int/xor.carbon @@ -15,114 +17,6 @@ fn Xor(a: i32, b: i32) -> i32 = "int.xor"; var arr: [i32; Xor(12, 10)]; let arr_p: [i32; 6]* = &arr; -fn RuntimeCall(a: i32, b: i32) -> i32 { +fn RuntimeCallIsValid(a: i32, b: i32) -> i32 { return Xor(a, b); } - -// CHECK:STDOUT: --- int_xor.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: %Xor.type: type = fn_type @Xor [template] -// CHECK:STDOUT: %Xor: %Xor.type = struct_value () [template] -// CHECK:STDOUT: %int_6.2: Core.IntLiteral = int_value 6 [template] -// CHECK:STDOUT: %array_type: type = array_type %int_6.2, %i32 [template] -// CHECK:STDOUT: %ptr: type = ptr_type %array_type [template] -// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] -// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: .Int = %import_ref.1 -// CHECK:STDOUT: .ImplicitAs = %import_ref.5 -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .Xor = %Xor.decl -// CHECK:STDOUT: .arr = %arr -// CHECK:STDOUT: .arr_p = @__global_init.%arr_p -// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %Xor.decl: %Xor.type = fn_decl @Xor [template = constants.%Xor] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc2_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc2_11: type = splice_block %i32.loc2_11 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_11: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc2_19: type = splice_block %i32.loc2_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc2_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc2_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %arr.var: ref %array_type = var arr -// CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var -// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { -// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a -// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 -// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b -// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 -// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc7_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 -// CHECK:STDOUT: %.loc7_19: type = splice_block %i32.loc7_19 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param -// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 -// CHECK:STDOUT: %.loc7_27: type = splice_block %i32.loc7_27 [template = constants.%i32] { -// CHECK:STDOUT: %int_32.loc7_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] -// CHECK:STDOUT: %i32.loc7_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @Xor(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.xor"; -// CHECK:STDOUT: -// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %Xor.ref: %Xor.type = name_ref Xor, file.%Xor.decl [template = constants.%Xor] -// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a -// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b -// CHECK:STDOUT: %int.xor: init %i32 = call %Xor.ref(%a.ref, %b.ref) -// CHECK:STDOUT: %.loc8_19.1: %i32 = value_of_initializer %int.xor -// CHECK:STDOUT: %.loc8_19.2: %i32 = converted %int.xor, %.loc8_19.1 -// CHECK:STDOUT: return %.loc8_19.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %arr.ref: ref %array_type = name_ref arr, file.%arr -// CHECK:STDOUT: %addr: %ptr = addr_of %arr.ref -// CHECK:STDOUT: %arr_p: %ptr = bind_name arr_p, %addr -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/builtins/int_literal/make_type.carbon b/toolchain/check/testdata/builtins/int_literal/make_type.carbon index df724bca53bac..e2e1a9a0ef779 100644 --- a/toolchain/check/testdata/builtins/int_literal/make_type.carbon +++ b/toolchain/check/testdata/builtins/int_literal/make_type.carbon @@ -2,6 +2,8 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-dump-sem-ir +// // AUTOUPDATE // TIP: To test this file alone, run: // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/int_literal/make_type.carbon @@ -21,64 +23,3 @@ library "[[@TEST_NAME]]"; import library "types"; var i: IntLiteral(); - -// CHECK:STDOUT: --- types.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .IntLiteral = %IntLiteral.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %IntLiteral.decl: %IntLiteral.type = fn_decl @IntLiteral [template = constants.%IntLiteral] { -// CHECK:STDOUT: %return.patt: type = return_slot_pattern -// CHECK:STDOUT: %return.param_patt: type = out_param_pattern %return.patt, runtime_param0 -// CHECK:STDOUT: } { -// CHECK:STDOUT: %return.param: ref type = out_param runtime_param0 -// CHECK:STDOUT: %return: ref type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type"; -// CHECK:STDOUT: -// CHECK:STDOUT: --- use_types.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %IntLiteral.type: type = fn_type @IntLiteral [template] -// CHECK:STDOUT: %IntLiteral: %IntLiteral.type = struct_value () [template] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %import_ref: %IntLiteral.type = import_ref Main//types, IntLiteral, loaded [template = constants.%IntLiteral] -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [template] { -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [template] { -// CHECK:STDOUT: .IntLiteral = imports.%import_ref -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .i = %i -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %default.import = import -// CHECK:STDOUT: %i.var: ref Core.IntLiteral = var i -// CHECK:STDOUT: %i: ref Core.IntLiteral = bind_name i, %i.var -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @IntLiteral() -> type = "int_literal.make_type" [from "types.carbon"]; -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/function/builtin/call.carbon b/toolchain/check/testdata/function/builtin/call.carbon index d30611da114ce..970039f374e07 100644 --- a/toolchain/check/testdata/function/builtin/call.carbon +++ b/toolchain/check/testdata/function/builtin/call.carbon @@ -12,6 +12,10 @@ fn Add(a: i32, b: i32) -> i32 = "int.sadd"; var arr: [i32; Add(1, 2)]; +fn RuntimeCall(a: i32, b: i32) -> i32 { + return Add(a, b); +} + // CHECK:STDOUT: --- call.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { @@ -21,6 +25,8 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: %Add: %Add.type.1 = struct_value () [template] // CHECK:STDOUT: %int_3.2: Core.IntLiteral = int_value 3 [template] // CHECK:STDOUT: %array_type: type = array_type %int_3.2, %i32 [template] +// CHECK:STDOUT: %RuntimeCall.type: type = fn_type @RuntimeCall [template] +// CHECK:STDOUT: %RuntimeCall: %RuntimeCall.type = struct_value () [template] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { @@ -37,6 +43,7 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .Add = %Add.decl // CHECK:STDOUT: .arr = %arr +// CHECK:STDOUT: .RuntimeCall = %RuntimeCall.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %Add.decl: %Add.type.1 = fn_decl @Add.1 [template = constants.%Add] { @@ -66,7 +73,43 @@ var arr: [i32; Add(1, 2)]; // CHECK:STDOUT: } // CHECK:STDOUT: %arr.var: ref %array_type = var arr // CHECK:STDOUT: %arr: ref %array_type = bind_name arr, %arr.var +// CHECK:STDOUT: %RuntimeCall.decl: %RuntimeCall.type = fn_decl @RuntimeCall [template = constants.%RuntimeCall] { +// CHECK:STDOUT: %a.patt: %i32 = binding_pattern a +// CHECK:STDOUT: %a.param_patt: %i32 = value_param_pattern %a.patt, runtime_param0 +// CHECK:STDOUT: %b.patt: %i32 = binding_pattern b +// CHECK:STDOUT: %b.param_patt: %i32 = value_param_pattern %b.patt, runtime_param1 +// CHECK:STDOUT: %return.patt: %i32 = return_slot_pattern +// CHECK:STDOUT: %return.param_patt: %i32 = out_param_pattern %return.patt, runtime_param2 +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_32.loc15_35: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_35: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: %a.param: %i32 = value_param runtime_param0 +// CHECK:STDOUT: %.loc15_19: type = splice_block %i32.loc15_19 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_19: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_19: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %a: %i32 = bind_name a, %a.param +// CHECK:STDOUT: %b.param: %i32 = value_param runtime_param1 +// CHECK:STDOUT: %.loc15_27: type = splice_block %i32.loc15_27 [template = constants.%i32] { +// CHECK:STDOUT: %int_32.loc15_27: Core.IntLiteral = int_value 32 [template = constants.%int_32] +// CHECK:STDOUT: %i32.loc15_27: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %b: %i32 = bind_name b, %b.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param runtime_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: fn @Add.1(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 = "int.sadd"; // CHECK:STDOUT: +// CHECK:STDOUT: fn @RuntimeCall(%a.param_patt: %i32, %b.param_patt: %i32) -> %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %Add.ref: %Add.type.1 = name_ref Add, file.%Add.decl [template = constants.%Add] +// CHECK:STDOUT: %a.ref: %i32 = name_ref a, %a +// CHECK:STDOUT: %b.ref: %i32 = name_ref b, %b +// CHECK:STDOUT: %int.sadd: init %i32 = call %Add.ref(%a.ref, %b.ref) +// CHECK:STDOUT: %.loc16_19.1: %i32 = value_of_initializer %int.sadd +// CHECK:STDOUT: %.loc16_19.2: %i32 = converted %int.sadd, %.loc16_19.1 +// CHECK:STDOUT: return %.loc16_19.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon b/toolchain/driver/testdata/compile/multifile_raw_and_textual_ir.carbon similarity index 98% rename from toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon rename to toolchain/driver/testdata/compile/multifile_raw_and_textual_ir.carbon index fb22d00d7cb53..33010f8bd9e95 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon +++ b/toolchain/driver/testdata/compile/multifile_raw_and_textual_ir.carbon @@ -8,9 +8,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/compile/multifile_raw_and_textual_ir.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/multifile_raw_and_textual_ir.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/compile/multifile_raw_and_textual_ir.carbon // --- a.carbon package A; diff --git a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon b/toolchain/driver/testdata/compile/multifile_raw_ir.carbon similarity index 98% rename from toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon rename to toolchain/driver/testdata/compile/multifile_raw_ir.carbon index 8e17cd105bf22..36494f4e14d65 100644 --- a/toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon +++ b/toolchain/driver/testdata/compile/multifile_raw_ir.carbon @@ -8,9 +8,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/compile/multifile_raw_ir.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/multifile_raw_ir.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/compile/multifile_raw_ir.carbon // --- a.carbon package A; diff --git a/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon b/toolchain/driver/testdata/compile/raw_and_textual_ir.carbon similarity index 98% rename from toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon rename to toolchain/driver/testdata/compile/raw_and_textual_ir.carbon index 378532c838d4b..8c60a327f3468 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon +++ b/toolchain/driver/testdata/compile/raw_and_textual_ir.carbon @@ -8,9 +8,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/compile/raw_and_textual_ir.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/raw_and_textual_ir.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/compile/raw_and_textual_ir.carbon fn Foo(n: ()) -> ((), ()) { return (n, ()); diff --git a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon b/toolchain/driver/testdata/compile/raw_ir.carbon similarity index 99% rename from toolchain/check/testdata/basics/no_prelude/raw_ir.carbon rename to toolchain/driver/testdata/compile/raw_ir.carbon index 08379ee715fd3..dc39b0cf19850 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_ir.carbon +++ b/toolchain/driver/testdata/compile/raw_ir.carbon @@ -8,9 +8,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/raw_ir.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/compile/raw_ir.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/raw_ir.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/compile/raw_ir.carbon fn Foo[T:! type](n: T) -> (T, ()) { return (n, ()); diff --git a/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon b/toolchain/driver/testdata/compile/textual_ir.carbon similarity index 96% rename from toolchain/check/testdata/basics/no_prelude/textual_ir.carbon rename to toolchain/driver/testdata/compile/textual_ir.carbon index 20d9a62ec5fbf..1e584e27a39cf 100644 --- a/toolchain/check/testdata/basics/no_prelude/textual_ir.carbon +++ b/toolchain/driver/testdata/compile/textual_ir.carbon @@ -8,9 +8,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/textual_ir.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/driver/testdata/compile/textual_ir.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/textual_ir.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/driver/testdata/compile/textual_ir.carbon fn Foo(n: ()) -> ((), ()) { return (n, ()); diff --git a/toolchain/lex/testdata/basic_syntax.carbon b/toolchain/lex/testdata/basic_syntax.carbon index 1f0b2a996a2cd..c3a64f7bcec14 100644 --- a/toolchain/lex/testdata/basic_syntax.carbon +++ b/toolchain/lex/testdata/basic_syntax.carbon @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // Dump all tokens so that we include the file start and end. -// ARGS: compile --phase=lex --dump-tokens %s +// EXTRA-ARGS: --no-omit-file-boundary-tokens // // AUTOUPDATE // TIP: To test this file alone, run: