فهرست منبع

Update builtins tests for ranges (#5512)

Updating tests in the style of
https://github.com/carbon-language/carbon-lang/pull/5455.

Notable things for builtins:

- #4748 disabled semir output in int tests, but not other tests. After
discussion with zygoloid, adding ranges just for runtime calls that seem
significant. The rest can rely on type checking to demonstrate
correctness.
- Fixes cases of things like `RuntimeCallIsValidBadReturnType` using the
wrong number of args, and being invalid as a result.
- Splits out the too few, too many, and bad return type tests -- I think
this helps highlight where the above is an issue.
- Expands use of `library "[[@TEST_NAME]]";` in tests where package
names were previously in use.

Ranges tests were already updated for splits, so not really touching
that. Also, the prelude interaction gets a little gnarly because these
also partly test prelude bits.

---------

Co-authored-by: David Blaikie <dblaikie@gmail.com>
Jon Ross-Perkins 11 ماه پیش
والد
کامیت
b310958600
64فایلهای تغییر یافته به همراه2133 افزوده شده و 5332 حذف شده
  1. 33 372
      toolchain/check/testdata/builtins/bool/eq.carbon
  2. 8 49
      toolchain/check/testdata/builtins/bool/make_type.carbon
  3. 33 370
      toolchain/check/testdata/builtins/bool/neq.carbon
  4. 11 418
      toolchain/check/testdata/builtins/float/add.carbon
  5. 31 469
      toolchain/check/testdata/builtins/float/div.carbon
  6. 8 244
      toolchain/check/testdata/builtins/float/eq.carbon
  7. 7 275
      toolchain/check/testdata/builtins/float/greater.carbon
  8. 7 275
      toolchain/check/testdata/builtins/float/greater_eq.carbon
  9. 7 275
      toolchain/check/testdata/builtins/float/less.carbon
  10. 7 275
      toolchain/check/testdata/builtins/float/less_eq.carbon
  11. 18 257
      toolchain/check/testdata/builtins/float/make_type.carbon
  12. 33 431
      toolchain/check/testdata/builtins/float/mul.carbon
  13. 35 392
      toolchain/check/testdata/builtins/float/negate.carbon
  14. 10 244
      toolchain/check/testdata/builtins/float/neq.carbon
  15. 33 431
      toolchain/check/testdata/builtins/float/sub.carbon
  16. 32 1
      toolchain/check/testdata/builtins/int/and.carbon
  17. 36 4
      toolchain/check/testdata/builtins/int/and_assign.carbon
  18. 31 1
      toolchain/check/testdata/builtins/int/complement.carbon
  19. 79 1
      toolchain/check/testdata/builtins/int/convert.carbon
  20. 128 1
      toolchain/check/testdata/builtins/int/convert_checked.carbon
  21. 28 2
      toolchain/check/testdata/builtins/int/eq.carbon
  22. 27 1
      toolchain/check/testdata/builtins/int/greater.carbon
  23. 27 1
      toolchain/check/testdata/builtins/int/greater_eq.carbon
  24. 53 1
      toolchain/check/testdata/builtins/int/left_shift.carbon
  25. 42 1
      toolchain/check/testdata/builtins/int/left_shift_assign.carbon
  26. 27 1
      toolchain/check/testdata/builtins/int/less.carbon
  27. 27 1
      toolchain/check/testdata/builtins/int/less_eq.carbon
  28. 34 3
      toolchain/check/testdata/builtins/int/make_type_signed.carbon
  29. 36 4
      toolchain/check/testdata/builtins/int/make_type_unsigned.carbon
  30. 27 1
      toolchain/check/testdata/builtins/int/neq.carbon
  31. 32 1
      toolchain/check/testdata/builtins/int/or.carbon
  32. 27 1
      toolchain/check/testdata/builtins/int/or_assign.carbon
  33. 53 1
      toolchain/check/testdata/builtins/int/right_shift.carbon
  34. 42 1
      toolchain/check/testdata/builtins/int/right_shift_assign.carbon
  35. 91 50
      toolchain/check/testdata/builtins/int/sadd.carbon
  36. 1 1
      toolchain/check/testdata/builtins/int/sadd_assign.carbon
  37. 36 3
      toolchain/check/testdata/builtins/int/sdiv.carbon
  38. 27 1
      toolchain/check/testdata/builtins/int/sdiv_assign.carbon
  39. 36 3
      toolchain/check/testdata/builtins/int/smod.carbon
  40. 27 1
      toolchain/check/testdata/builtins/int/smod_assign.carbon
  41. 28 2
      toolchain/check/testdata/builtins/int/smul.carbon
  42. 27 1
      toolchain/check/testdata/builtins/int/smul_assign.carbon
  43. 85 57
      toolchain/check/testdata/builtins/int/snegate.carbon
  44. 35 2
      toolchain/check/testdata/builtins/int/ssub.carbon
  45. 27 1
      toolchain/check/testdata/builtins/int/ssub_assign.carbon
  46. 86 36
      toolchain/check/testdata/builtins/int/uadd.carbon
  47. 27 1
      toolchain/check/testdata/builtins/int/uadd_assign.carbon
  48. 36 3
      toolchain/check/testdata/builtins/int/udiv.carbon
  49. 27 1
      toolchain/check/testdata/builtins/int/udiv_assign.carbon
  50. 36 3
      toolchain/check/testdata/builtins/int/umod.carbon
  51. 27 1
      toolchain/check/testdata/builtins/int/umod_assign.carbon
  52. 35 2
      toolchain/check/testdata/builtins/int/umul.carbon
  53. 27 1
      toolchain/check/testdata/builtins/int/umul_assign.carbon
  54. 85 57
      toolchain/check/testdata/builtins/int/unegate.carbon
  55. 35 2
      toolchain/check/testdata/builtins/int/usub.carbon
  56. 27 1
      toolchain/check/testdata/builtins/int/usub_assign.carbon
  57. 32 1
      toolchain/check/testdata/builtins/int/xor.carbon
  58. 27 1
      toolchain/check/testdata/builtins/int/xor_assign.carbon
  59. 1 1
      toolchain/check/testdata/builtins/int_literal/make_type.carbon
  60. 20 108
      toolchain/check/testdata/builtins/no_prelude/no_op.carbon
  61. 23 51
      toolchain/check/testdata/builtins/print/char.carbon
  62. 12 37
      toolchain/check/testdata/builtins/print/int.carbon
  63. 81 0
      toolchain/check/testdata/builtins/read/char.carbon
  64. 0 98
      toolchain/check/testdata/builtins/read/int.carbon

+ 33 - 372
toolchain/check/testdata/builtins/bool/eq.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/bool/eq.carbon
@@ -19,7 +21,9 @@ class C(B:! bool) {}
 fn True() -> C(true);
 fn False() -> C(false);
 
+//@dump-sem-ir-begin
 var a: C(Eq(true, true)) = True();
+//@dump-sem-ir-end
 var b: C(Eq(true, false)) = False();
 var c: C(Eq(false, true)) = False();
 var d: C(Eq(false, false)) = True();
@@ -33,7 +37,9 @@ class C(B:! bool) {}
 fn True() -> C(true);
 fn False() -> C(false);
 
+//@dump-sem-ir-begin
 var a: C(true == true) = True();
+//@dump-sem-ir-end
 var b: C(true == false) = False();
 var c: C(false == true) = False();
 var d: C(false == false) = True();
@@ -41,255 +47,58 @@ var d: C(false == false) = True();
 // CHECK:STDOUT: --- builtin_call.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
 // CHECK:STDOUT:   %Eq.type: type = fn_type @Eq [concrete]
 // CHECK:STDOUT:   %Eq: %Eq.type = struct_value () [concrete]
-// CHECK:STDOUT:   %B: bool = bind_symbolic_name B, 0 [symbolic]
 // CHECK:STDOUT:   %C.type: type = generic_class_type @C [concrete]
 // CHECK:STDOUT:   %C.generic: %C.type = struct_value () [concrete]
-// CHECK:STDOUT:   %C.342: type = class_type @C, @C(%B) [symbolic]
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
 // CHECK:STDOUT:   %true: bool = bool_literal true [concrete]
 // CHECK:STDOUT:   %C.a14: type = class_type @C, @C(%true) [concrete]
 // CHECK:STDOUT:   %pattern_type.cc5: type = pattern_type %C.a14 [concrete]
 // CHECK:STDOUT:   %True.type: type = fn_type @True [concrete]
 // CHECK:STDOUT:   %True: %True.type = struct_value () [concrete]
-// CHECK:STDOUT:   %false: bool = bool_literal false [concrete]
-// CHECK:STDOUT:   %C.2ba: type = class_type @C, @C(%false) [concrete]
-// CHECK:STDOUT:   %pattern_type.d8f: type = pattern_type %C.2ba [concrete]
-// CHECK:STDOUT:   %False.type: type = fn_type @False [concrete]
-// CHECK:STDOUT:   %False: %False.type = struct_value () [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .Eq = %Eq.decl
-// CHECK:STDOUT:     .C = %C.decl
-// CHECK:STDOUT:     .True = %True.decl
-// CHECK:STDOUT:     .False = %False.decl
-// CHECK:STDOUT:     .a = %a
-// CHECK:STDOUT:     .b = %b
-// CHECK:STDOUT:     .c = %c
-// CHECK:STDOUT:     .d = %d
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Eq.decl: %Eq.type = fn_decl @Eq [concrete = constants.%Eq] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.831 = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.831 = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.831 = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.831 = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type.loc4_28: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc4_28.1: type = value_of_initializer %bool.make_type.loc4_28 [concrete = bool]
-// CHECK:STDOUT:     %.loc4_28.2: type = converted %bool.make_type.loc4_28, %.loc4_28.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: bool = value_param call_param0
-// CHECK:STDOUT:     %.loc4_10.1: type = splice_block %.loc4_10.3 [concrete = bool] {
-// CHECK:STDOUT:       %bool.make_type.loc4_10: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:       %.loc4_10.2: type = value_of_initializer %bool.make_type.loc4_10 [concrete = bool]
-// CHECK:STDOUT:       %.loc4_10.3: type = converted %bool.make_type.loc4_10, %.loc4_10.2 [concrete = bool]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: bool = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: bool = value_param call_param1
-// CHECK:STDOUT:     %.loc4_19.1: type = splice_block %.loc4_19.3 [concrete = bool] {
-// CHECK:STDOUT:       %bool.make_type.loc4_19: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:       %.loc4_19.2: type = value_of_initializer %bool.make_type.loc4_19 [concrete = bool]
-// CHECK:STDOUT:       %.loc4_19.3: type = converted %bool.make_type.loc4_19, %.loc4_19.2 [concrete = bool]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: bool = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
-// CHECK:STDOUT:     %B.patt: %pattern_type.831 = symbolic_binding_pattern B, 0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %.loc6_13.1: type = splice_block %.loc6_13.3 [concrete = bool] {
-// CHECK:STDOUT:       %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:       %.loc6_13.2: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:       %.loc6_13.3: type = converted %bool.make_type, %.loc6_13.2 [concrete = bool]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %B.loc6_9.1: bool = bind_symbolic_name B, 0 [symbolic = %B.loc6_9.2 (constants.%B)]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %True.decl: %True.type = fn_decl @True [concrete = constants.%True] {
-// CHECK:STDOUT:     %return.patt: %pattern_type.cc5 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.cc5 = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %true: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %C: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:     %return.param: ref %C.a14 = out_param call_param0
-// CHECK:STDOUT:     %return: ref %C.a14 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %False.decl: %False.type = fn_decl @False [concrete = constants.%False] {
-// CHECK:STDOUT:     %return.patt: %pattern_type.d8f = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.d8f = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %false: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %C: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:     %return.param: ref %C.2ba = out_param call_param0
-// CHECK:STDOUT:     %return: ref %C.2ba = return_slot %return.param
-// CHECK:STDOUT:   }
 // CHECK:STDOUT:   name_binding_decl {
 // CHECK:STDOUT:     %a.patt: %pattern_type.cc5 = binding_pattern a [concrete]
 // CHECK:STDOUT:     %a.var_patt: %pattern_type.cc5 = var_pattern %a.patt [concrete]
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %a.var: ref %C.a14 = var %a.var_patt [concrete]
-// CHECK:STDOUT:   %.loc11_24.1: type = splice_block %C.loc11 [concrete = constants.%C.a14] {
-// CHECK:STDOUT:     %C.ref.loc11: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %Eq.ref.loc11: %Eq.type = name_ref Eq, %Eq.decl [concrete = constants.%Eq]
-// CHECK:STDOUT:     %true.loc11_13: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %true.loc11_19: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %bool.eq.loc11: init bool = call %Eq.ref.loc11(%true.loc11_13, %true.loc11_19) [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc11_24.2: bool = value_of_initializer %bool.eq.loc11 [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc11_24.3: bool = converted %bool.eq.loc11, %.loc11_24.2 [concrete = constants.%true]
-// CHECK:STDOUT:     %C.loc11: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %a: ref %C.a14 = bind_name a, %a.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %b.patt: %pattern_type.d8f = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.var_patt: %pattern_type.d8f = var_pattern %b.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %b.var: ref %C.2ba = var %b.var_patt [concrete]
-// CHECK:STDOUT:   %.loc12_25.1: type = splice_block %C.loc12 [concrete = constants.%C.2ba] {
+// CHECK:STDOUT:   %.loc12_24.1: type = splice_block %C.loc12 [concrete = constants.%C.a14] {
 // CHECK:STDOUT:     %C.ref.loc12: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
 // CHECK:STDOUT:     %Eq.ref.loc12: %Eq.type = name_ref Eq, %Eq.decl [concrete = constants.%Eq]
-// CHECK:STDOUT:     %true.loc12: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %false.loc12: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %bool.eq.loc12: init bool = call %Eq.ref.loc12(%true.loc12, %false.loc12) [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc12_25.2: bool = value_of_initializer %bool.eq.loc12 [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc12_25.3: bool = converted %bool.eq.loc12, %.loc12_25.2 [concrete = constants.%false]
-// CHECK:STDOUT:     %C.loc12: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %b: ref %C.2ba = bind_name b, %b.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %c.patt: %pattern_type.d8f = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.var_patt: %pattern_type.d8f = var_pattern %c.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %c.var: ref %C.2ba = var %c.var_patt [concrete]
-// CHECK:STDOUT:   %.loc13_25.1: type = splice_block %C.loc13 [concrete = constants.%C.2ba] {
-// CHECK:STDOUT:     %C.ref.loc13: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %Eq.ref.loc13: %Eq.type = name_ref Eq, %Eq.decl [concrete = constants.%Eq]
-// CHECK:STDOUT:     %false.loc13: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %true.loc13: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %bool.eq.loc13: init bool = call %Eq.ref.loc13(%false.loc13, %true.loc13) [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc13_25.2: bool = value_of_initializer %bool.eq.loc13 [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc13_25.3: bool = converted %bool.eq.loc13, %.loc13_25.2 [concrete = constants.%false]
-// CHECK:STDOUT:     %C.loc13: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %c: ref %C.2ba = bind_name c, %c.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %d.patt: %pattern_type.cc5 = binding_pattern d [concrete]
-// CHECK:STDOUT:     %d.var_patt: %pattern_type.cc5 = var_pattern %d.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %d.var: ref %C.a14 = var %d.var_patt [concrete]
-// CHECK:STDOUT:   %.loc14_26.1: type = splice_block %C.loc14 [concrete = constants.%C.a14] {
-// CHECK:STDOUT:     %C.ref.loc14: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %Eq.ref.loc14: %Eq.type = name_ref Eq, %Eq.decl [concrete = constants.%Eq]
-// CHECK:STDOUT:     %false.loc14_13: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %false.loc14_20: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %bool.eq.loc14: init bool = call %Eq.ref.loc14(%false.loc14_13, %false.loc14_20) [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc14_26.2: bool = value_of_initializer %bool.eq.loc14 [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc14_26.3: bool = converted %bool.eq.loc14, %.loc14_26.2 [concrete = constants.%true]
-// CHECK:STDOUT:     %C.loc14: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %d: ref %C.a14 = bind_name d, %d.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: generic class @C(%B.loc6_9.1: bool) {
-// CHECK:STDOUT:   %B.loc6_9.2: bool = bind_symbolic_name B, 0 [symbolic = %B.loc6_9.2 (constants.%B)]
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
-// CHECK:STDOUT:
-// CHECK:STDOUT:   class {
-// CHECK:STDOUT:     %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:     %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:     complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT:   !members:
-// CHECK:STDOUT:     .Self = constants.%C.342
+// CHECK:STDOUT:     %true.loc12_13: bool = bool_literal true [concrete = constants.%true]
+// CHECK:STDOUT:     %true.loc12_19: bool = bool_literal true [concrete = constants.%true]
+// CHECK:STDOUT:     %bool.eq.loc12: init bool = call %Eq.ref.loc12(%true.loc12_13, %true.loc12_19) [concrete = constants.%true]
+// CHECK:STDOUT:     %.loc12_24.2: bool = value_of_initializer %bool.eq.loc12 [concrete = constants.%true]
+// CHECK:STDOUT:     %.loc12_24.3: bool = converted %bool.eq.loc12, %.loc12_24.2 [concrete = constants.%true]
+// CHECK:STDOUT:     %C.loc12: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
 // CHECK:STDOUT:   }
+// CHECK:STDOUT:   %a: ref %C.a14 = bind_name a, %a.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @Eq(%a.param: bool, %b.param: bool) -> bool = "bool.eq";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @True() -> %return.param: %C.a14;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @False() -> %return.param: %C.2ba;
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %True.ref.loc11: %True.type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:   %.loc11: ref %C.a14 = splice_block file.%a.var [concrete = file.%a.var] {}
-// CHECK:STDOUT:   %True.call.loc11: init %C.a14 = call %True.ref.loc11() to %.loc11
-// CHECK:STDOUT:   assign file.%a.var, %True.call.loc11
-// CHECK:STDOUT:   %False.ref.loc12: %False.type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:   %.loc12: ref %C.2ba = splice_block file.%b.var [concrete = file.%b.var] {}
-// CHECK:STDOUT:   %False.call.loc12: init %C.2ba = call %False.ref.loc12() to %.loc12
-// CHECK:STDOUT:   assign file.%b.var, %False.call.loc12
-// CHECK:STDOUT:   %False.ref.loc13: %False.type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:   %.loc13: ref %C.2ba = splice_block file.%c.var [concrete = file.%c.var] {}
-// CHECK:STDOUT:   %False.call.loc13: init %C.2ba = call %False.ref.loc13() to %.loc13
-// CHECK:STDOUT:   assign file.%c.var, %False.call.loc13
-// CHECK:STDOUT:   %True.ref.loc14: %True.type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:   %.loc14: ref %C.a14 = splice_block file.%d.var [concrete = file.%d.var] {}
-// CHECK:STDOUT:   %True.call.loc14: init %C.a14 = call %True.ref.loc14() to %.loc14
-// CHECK:STDOUT:   assign file.%d.var, %True.call.loc14
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%B) {
-// CHECK:STDOUT:   %B.loc6_9.2 => constants.%B
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%true) {
-// CHECK:STDOUT:   %B.loc6_9.2 => constants.%true
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%false) {
-// CHECK:STDOUT:   %B.loc6_9.2 => constants.%false
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %True.ref.loc12: %True.type = name_ref True, file.%True.decl [concrete = constants.%True]
+// CHECK:STDOUT:   %.loc12: ref %C.a14 = splice_block file.%a.var [concrete = file.%a.var] {}
+// CHECK:STDOUT:   %True.call.loc12: init %C.a14 = call %True.ref.loc12() to %.loc12
+// CHECK:STDOUT:   assign file.%a.var, %True.call.loc12
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: --- prelude.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %B: bool = bind_symbolic_name B, 0 [symbolic]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
 // CHECK:STDOUT:   %C.type: type = generic_class_type @C [concrete]
 // CHECK:STDOUT:   %C.generic: %C.type = struct_value () [concrete]
-// CHECK:STDOUT:   %C.342: type = class_type @C, @C(%B) [symbolic]
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
 // CHECK:STDOUT:   %true: bool = bool_literal true [concrete]
 // CHECK:STDOUT:   %C.a14: type = class_type @C, @C(%true) [concrete]
 // CHECK:STDOUT:   %pattern_type.cc5: type = pattern_type %C.a14 [concrete]
 // CHECK:STDOUT:   %True.type: type = fn_type @True [concrete]
 // CHECK:STDOUT:   %True: %True.type = struct_value () [concrete]
-// CHECK:STDOUT:   %false: bool = bool_literal false [concrete]
-// CHECK:STDOUT:   %C.2ba: type = class_type @C, @C(%false) [concrete]
-// CHECK:STDOUT:   %pattern_type.d8f: type = pattern_type %C.2ba [concrete]
-// CHECK:STDOUT:   %False.type: type = fn_type @False [concrete]
-// CHECK:STDOUT:   %False: %False.type = struct_value () [concrete]
 // CHECK:STDOUT:   %Eq.type: type = facet_type <@Eq> [concrete]
 // CHECK:STDOUT:   %Equal.type.79c: type = fn_type @Equal.1 [concrete]
 // CHECK:STDOUT:   %Eq.impl_witness: <witness> = impl_witness imports.%Eq.impl_witness_table [concrete]
@@ -298,188 +107,40 @@ var d: C(false == false) = True();
 // CHECK:STDOUT:   %Equal.type.aa3: type = fn_type @Equal.2 [concrete]
 // CHECK:STDOUT:   %Equal.6e2: %Equal.type.aa3 = struct_value () [concrete]
 // CHECK:STDOUT:   %Equal.bound.fe0: <bound method> = bound_method %true, %Equal.6e2 [concrete]
-// CHECK:STDOUT:   %Equal.bound.d3c: <bound method> = bound_method %false, %Equal.6e2 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     .Eq = %Core.Eq
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT:   %Core.Eq: type = import_ref Core//prelude/operators/comparison, Eq, loaded [concrete = constants.%Eq.type]
 // CHECK:STDOUT:   %Core.import_ref.998: %Equal.type.aa3 = import_ref Core//prelude/operators/comparison, loc29_45, loaded [concrete = constants.%Equal.6e2]
 // CHECK:STDOUT:   %Core.import_ref.fb6 = import_ref Core//prelude/operators/comparison, loc30_48, unloaded
 // CHECK:STDOUT:   %Eq.impl_witness_table = impl_witness_table (%Core.import_ref.998, %Core.import_ref.fb6), @impl.bb5 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .C = %C.decl
-// CHECK:STDOUT:     .True = %True.decl
-// CHECK:STDOUT:     .False = %False.decl
-// CHECK:STDOUT:     .a = %a
-// CHECK:STDOUT:     .b = %b
-// CHECK:STDOUT:     .c = %c
-// CHECK:STDOUT:     .d = %d
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
-// CHECK:STDOUT:     %B.patt: %pattern_type.831 = symbolic_binding_pattern B, 0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %.loc4_13.1: type = splice_block %.loc4_13.3 [concrete = bool] {
-// CHECK:STDOUT:       %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:       %.loc4_13.2: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:       %.loc4_13.3: type = converted %bool.make_type, %.loc4_13.2 [concrete = bool]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %B.loc4_9.1: bool = bind_symbolic_name B, 0 [symbolic = %B.loc4_9.2 (constants.%B)]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %True.decl: %True.type = fn_decl @True [concrete = constants.%True] {
-// CHECK:STDOUT:     %return.patt: %pattern_type.cc5 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.cc5 = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %true: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %C: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:     %return.param: ref %C.a14 = out_param call_param0
-// CHECK:STDOUT:     %return: ref %C.a14 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %False.decl: %False.type = fn_decl @False [concrete = constants.%False] {
-// CHECK:STDOUT:     %return.patt: %pattern_type.d8f = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.d8f = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %false: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %C: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:     %return.param: ref %C.2ba = out_param call_param0
-// CHECK:STDOUT:     %return: ref %C.2ba = return_slot %return.param
-// CHECK:STDOUT:   }
 // CHECK:STDOUT:   name_binding_decl {
 // CHECK:STDOUT:     %a.patt: %pattern_type.cc5 = binding_pattern a [concrete]
 // CHECK:STDOUT:     %a.var_patt: %pattern_type.cc5 = var_pattern %a.patt [concrete]
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %a.var: ref %C.a14 = var %a.var_patt [concrete]
-// CHECK:STDOUT:   %.loc9_22.1: type = splice_block %C.loc9 [concrete = constants.%C.a14] {
-// CHECK:STDOUT:     %C.ref.loc9: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %true.loc9_10: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %true.loc9_18: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %impl.elem0.loc9: %.7f7 = impl_witness_access constants.%Eq.impl_witness, element0 [concrete = constants.%Equal.6e2]
-// CHECK:STDOUT:     %bound_method.loc9: <bound method> = bound_method %true.loc9_10, %impl.elem0.loc9 [concrete = constants.%Equal.bound.fe0]
-// CHECK:STDOUT:     %bool.eq.loc9: init bool = call %bound_method.loc9(%true.loc9_10, %true.loc9_18) [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc9_22.2: bool = value_of_initializer %bool.eq.loc9 [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc9_22.3: bool = converted %bool.eq.loc9, %.loc9_22.2 [concrete = constants.%true]
-// CHECK:STDOUT:     %C.loc9: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %a: ref %C.a14 = bind_name a, %a.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %b.patt: %pattern_type.d8f = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.var_patt: %pattern_type.d8f = var_pattern %b.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %b.var: ref %C.2ba = var %b.var_patt [concrete]
-// CHECK:STDOUT:   %.loc10_23.1: type = splice_block %C.loc10 [concrete = constants.%C.2ba] {
+// CHECK:STDOUT:   %.loc10_22.1: type = splice_block %C.loc10 [concrete = constants.%C.a14] {
 // CHECK:STDOUT:     %C.ref.loc10: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %true.loc10: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %false.loc10: bool = bool_literal false [concrete = constants.%false]
+// CHECK:STDOUT:     %true.loc10_10: bool = bool_literal true [concrete = constants.%true]
+// CHECK:STDOUT:     %true.loc10_18: bool = bool_literal true [concrete = constants.%true]
 // CHECK:STDOUT:     %impl.elem0.loc10: %.7f7 = impl_witness_access constants.%Eq.impl_witness, element0 [concrete = constants.%Equal.6e2]
-// CHECK:STDOUT:     %bound_method.loc10: <bound method> = bound_method %true.loc10, %impl.elem0.loc10 [concrete = constants.%Equal.bound.fe0]
-// CHECK:STDOUT:     %bool.eq.loc10: init bool = call %bound_method.loc10(%true.loc10, %false.loc10) [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc10_23.2: bool = value_of_initializer %bool.eq.loc10 [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc10_23.3: bool = converted %bool.eq.loc10, %.loc10_23.2 [concrete = constants.%false]
-// CHECK:STDOUT:     %C.loc10: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %b: ref %C.2ba = bind_name b, %b.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %c.patt: %pattern_type.d8f = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.var_patt: %pattern_type.d8f = var_pattern %c.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %c.var: ref %C.2ba = var %c.var_patt [concrete]
-// CHECK:STDOUT:   %.loc11_23.1: type = splice_block %C.loc11 [concrete = constants.%C.2ba] {
-// CHECK:STDOUT:     %C.ref.loc11: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %false.loc11: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %true.loc11: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %impl.elem0.loc11: %.7f7 = impl_witness_access constants.%Eq.impl_witness, element0 [concrete = constants.%Equal.6e2]
-// CHECK:STDOUT:     %bound_method.loc11: <bound method> = bound_method %false.loc11, %impl.elem0.loc11 [concrete = constants.%Equal.bound.d3c]
-// CHECK:STDOUT:     %bool.eq.loc11: init bool = call %bound_method.loc11(%false.loc11, %true.loc11) [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc11_23.2: bool = value_of_initializer %bool.eq.loc11 [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc11_23.3: bool = converted %bool.eq.loc11, %.loc11_23.2 [concrete = constants.%false]
-// CHECK:STDOUT:     %C.loc11: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %c: ref %C.2ba = bind_name c, %c.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %d.patt: %pattern_type.cc5 = binding_pattern d [concrete]
-// CHECK:STDOUT:     %d.var_patt: %pattern_type.cc5 = var_pattern %d.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %d.var: ref %C.a14 = var %d.var_patt [concrete]
-// CHECK:STDOUT:   %.loc12_24.1: type = splice_block %C.loc12 [concrete = constants.%C.a14] {
-// CHECK:STDOUT:     %C.ref.loc12: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %false.loc12_10: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %false.loc12_19: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %impl.elem0.loc12: %.7f7 = impl_witness_access constants.%Eq.impl_witness, element0 [concrete = constants.%Equal.6e2]
-// CHECK:STDOUT:     %bound_method.loc12: <bound method> = bound_method %false.loc12_10, %impl.elem0.loc12 [concrete = constants.%Equal.bound.d3c]
-// CHECK:STDOUT:     %bool.eq.loc12: init bool = call %bound_method.loc12(%false.loc12_10, %false.loc12_19) [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc12_24.2: bool = value_of_initializer %bool.eq.loc12 [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc12_24.3: bool = converted %bool.eq.loc12, %.loc12_24.2 [concrete = constants.%true]
-// CHECK:STDOUT:     %C.loc12: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %d: ref %C.a14 = bind_name d, %d.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: generic class @C(%B.loc4_9.1: bool) {
-// CHECK:STDOUT:   %B.loc4_9.2: bool = bind_symbolic_name B, 0 [symbolic = %B.loc4_9.2 (constants.%B)]
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
-// CHECK:STDOUT:
-// CHECK:STDOUT:   class {
-// CHECK:STDOUT:     %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:     %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:     complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT:   !members:
-// CHECK:STDOUT:     .Self = constants.%C.342
+// CHECK:STDOUT:     %bound_method.loc10: <bound method> = bound_method %true.loc10_10, %impl.elem0.loc10 [concrete = constants.%Equal.bound.fe0]
+// CHECK:STDOUT:     %bool.eq.loc10: init bool = call %bound_method.loc10(%true.loc10_10, %true.loc10_18) [concrete = constants.%true]
+// CHECK:STDOUT:     %.loc10_22.2: bool = value_of_initializer %bool.eq.loc10 [concrete = constants.%true]
+// CHECK:STDOUT:     %.loc10_22.3: bool = converted %bool.eq.loc10, %.loc10_22.2 [concrete = constants.%true]
+// CHECK:STDOUT:     %C.loc10: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
 // CHECK:STDOUT:   }
+// CHECK:STDOUT:   %a: ref %C.a14 = bind_name a, %a.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @True() -> %return.param: %C.a14;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @False() -> %return.param: %C.2ba;
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %True.ref.loc9: %True.type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:   %.loc9: ref %C.a14 = splice_block file.%a.var [concrete = file.%a.var] {}
-// CHECK:STDOUT:   %True.call.loc9: init %C.a14 = call %True.ref.loc9() to %.loc9
-// CHECK:STDOUT:   assign file.%a.var, %True.call.loc9
-// CHECK:STDOUT:   %False.ref.loc10: %False.type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:   %.loc10: ref %C.2ba = splice_block file.%b.var [concrete = file.%b.var] {}
-// CHECK:STDOUT:   %False.call.loc10: init %C.2ba = call %False.ref.loc10() to %.loc10
-// CHECK:STDOUT:   assign file.%b.var, %False.call.loc10
-// CHECK:STDOUT:   %False.ref.loc11: %False.type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:   %.loc11: ref %C.2ba = splice_block file.%c.var [concrete = file.%c.var] {}
-// CHECK:STDOUT:   %False.call.loc11: init %C.2ba = call %False.ref.loc11() to %.loc11
-// CHECK:STDOUT:   assign file.%c.var, %False.call.loc11
-// CHECK:STDOUT:   %True.ref.loc12: %True.type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:   %.loc12: ref %C.a14 = splice_block file.%d.var [concrete = file.%d.var] {}
-// CHECK:STDOUT:   %True.call.loc12: init %C.a14 = call %True.ref.loc12() to %.loc12
-// CHECK:STDOUT:   assign file.%d.var, %True.call.loc12
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%B) {
-// CHECK:STDOUT:   %B.loc4_9.2 => constants.%B
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%true) {
-// CHECK:STDOUT:   %B.loc4_9.2 => constants.%true
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%false) {
-// CHECK:STDOUT:   %B.loc4_9.2 => constants.%false
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %True.ref.loc10: %True.type = name_ref True, file.%True.decl [concrete = constants.%True]
+// CHECK:STDOUT:   %.loc10: ref %C.a14 = splice_block file.%a.var [concrete = file.%a.var] {}
+// CHECK:STDOUT:   %True.call.loc10: init %C.a14 = call %True.ref.loc10() to %.loc10
+// CHECK:STDOUT:   assign file.%a.var, %True.call.loc10
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 8 - 49
toolchain/check/testdata/builtins/bool/make_type.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/bool/make_type.carbon
@@ -20,40 +22,10 @@ library "[[@TEST_NAME]]";
 
 import library "types";
 
+//@dump-sem-ir-begin
 var b: Bool() = false;
+//@dump-sem-ir-end
 
-// CHECK:STDOUT: --- types.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %pattern_type: type = pattern_type type [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .Bool = %Bool.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Bool.decl: %Bool.type = fn_decl @Bool [concrete = constants.%Bool] {
-// CHECK:STDOUT:     %return.patt: %pattern_type = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %return.param: ref type = out_param call_param0
-// CHECK:STDOUT:     %return: ref type = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Bool() -> type = "bool.make_type";
-// CHECK:STDOUT:
 // CHECK:STDOUT: --- use_types.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
@@ -65,40 +37,27 @@ var b: Bool() = false;
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
 // CHECK:STDOUT:   %Main.Bool: %Bool.type = import_ref Main//types, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Bool = imports.%Main.Bool
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .b = %b
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %default.import = import <none>
 // CHECK:STDOUT:   name_binding_decl {
 // CHECK:STDOUT:     %b.patt: %pattern_type.831 = binding_pattern b [concrete]
 // CHECK:STDOUT:     %b.var_patt: %pattern_type.831 = var_pattern %b.patt [concrete]
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %b.var: ref bool = var %b.var_patt [concrete]
-// CHECK:STDOUT:   %.loc6_13.1: type = splice_block %.loc6_13.3 [concrete = bool] {
+// CHECK:STDOUT:   %.loc7_13.1: type = splice_block %.loc7_13.3 [concrete = bool] {
 // CHECK:STDOUT:     %Bool.ref: %Bool.type = name_ref Bool, imports.%Main.Bool [concrete = constants.%Bool]
 // CHECK:STDOUT:     %bool.make_type: init type = call %Bool.ref() [concrete = bool]
-// CHECK:STDOUT:     %.loc6_13.2: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc6_13.3: type = converted %bool.make_type, %.loc6_13.2 [concrete = bool]
+// CHECK:STDOUT:     %.loc7_13.2: type = value_of_initializer %bool.make_type [concrete = bool]
+// CHECK:STDOUT:     %.loc7_13.3: type = converted %bool.make_type, %.loc7_13.2 [concrete = bool]
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %b: ref bool = bind_name b, %b.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @Bool = "bool.make_type" [from "types.carbon"];
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %false: bool = bool_literal false [concrete = constants.%false]
 // CHECK:STDOUT:   assign file.%b.var, %false
-// CHECK:STDOUT:   return
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 33 - 370
toolchain/check/testdata/builtins/bool/neq.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/bool/neq.carbon
@@ -19,7 +21,9 @@ class C(B:! bool) {}
 fn True() -> C(true);
 fn False() -> C(false);
 
+//@dump-sem-ir-begin
 var a: C(Neq(true, true)) = False();
+//@dump-sem-ir-end
 var b: C(Neq(true, false)) = True();
 var c: C(Neq(false, true)) = True();
 var d: C(Neq(false, false)) = False();
@@ -33,7 +37,9 @@ class C(B:! bool) {}
 fn True() -> C(true);
 fn False() -> C(false);
 
+//@dump-sem-ir-begin
 var a: C(true != true) = False();
+//@dump-sem-ir-end
 var b: C(true != false) = True();
 var c: C(false != true) = True();
 var d: C(false != false) = False();
@@ -41,22 +47,11 @@ var d: C(false != false) = False();
 // CHECK:STDOUT: --- builtin_call.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
 // CHECK:STDOUT:   %Neq.type: type = fn_type @Neq [concrete]
 // CHECK:STDOUT:   %Neq: %Neq.type = struct_value () [concrete]
-// CHECK:STDOUT:   %B: bool = bind_symbolic_name B, 0 [symbolic]
 // CHECK:STDOUT:   %C.type: type = generic_class_type @C [concrete]
 // CHECK:STDOUT:   %C.generic: %C.type = struct_value () [concrete]
-// CHECK:STDOUT:   %C.342: type = class_type @C, @C(%B) [symbolic]
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
 // CHECK:STDOUT:   %true: bool = bool_literal true [concrete]
-// CHECK:STDOUT:   %C.a14: type = class_type @C, @C(%true) [concrete]
-// CHECK:STDOUT:   %pattern_type.cc5: type = pattern_type %C.a14 [concrete]
-// CHECK:STDOUT:   %True.type: type = fn_type @True [concrete]
-// CHECK:STDOUT:   %True: %True.type = struct_value () [concrete]
 // CHECK:STDOUT:   %false: bool = bool_literal false [concrete]
 // CHECK:STDOUT:   %C.2ba: type = class_type @C, @C(%false) [concrete]
 // CHECK:STDOUT:   %pattern_type.d8f: type = pattern_type %C.2ba [concrete]
@@ -65,226 +60,42 @@ var d: C(false != false) = False();
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .Neq = %Neq.decl
-// CHECK:STDOUT:     .C = %C.decl
-// CHECK:STDOUT:     .True = %True.decl
-// CHECK:STDOUT:     .False = %False.decl
-// CHECK:STDOUT:     .a = %a
-// CHECK:STDOUT:     .b = %b
-// CHECK:STDOUT:     .c = %c
-// CHECK:STDOUT:     .d = %d
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Neq.decl: %Neq.type = fn_decl @Neq [concrete = constants.%Neq] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.831 = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.831 = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.831 = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.831 = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type.loc4_29: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc4_29.1: type = value_of_initializer %bool.make_type.loc4_29 [concrete = bool]
-// CHECK:STDOUT:     %.loc4_29.2: type = converted %bool.make_type.loc4_29, %.loc4_29.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: bool = value_param call_param0
-// CHECK:STDOUT:     %.loc4_11.1: type = splice_block %.loc4_11.3 [concrete = bool] {
-// CHECK:STDOUT:       %bool.make_type.loc4_11: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:       %.loc4_11.2: type = value_of_initializer %bool.make_type.loc4_11 [concrete = bool]
-// CHECK:STDOUT:       %.loc4_11.3: type = converted %bool.make_type.loc4_11, %.loc4_11.2 [concrete = bool]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: bool = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: bool = value_param call_param1
-// CHECK:STDOUT:     %.loc4_20.1: type = splice_block %.loc4_20.3 [concrete = bool] {
-// CHECK:STDOUT:       %bool.make_type.loc4_20: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:       %.loc4_20.2: type = value_of_initializer %bool.make_type.loc4_20 [concrete = bool]
-// CHECK:STDOUT:       %.loc4_20.3: type = converted %bool.make_type.loc4_20, %.loc4_20.2 [concrete = bool]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: bool = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
-// CHECK:STDOUT:     %B.patt: %pattern_type.831 = symbolic_binding_pattern B, 0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %.loc6_13.1: type = splice_block %.loc6_13.3 [concrete = bool] {
-// CHECK:STDOUT:       %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:       %.loc6_13.2: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:       %.loc6_13.3: type = converted %bool.make_type, %.loc6_13.2 [concrete = bool]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %B.loc6_9.1: bool = bind_symbolic_name B, 0 [symbolic = %B.loc6_9.2 (constants.%B)]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %True.decl: %True.type = fn_decl @True [concrete = constants.%True] {
-// CHECK:STDOUT:     %return.patt: %pattern_type.cc5 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.cc5 = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %true: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %C: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:     %return.param: ref %C.a14 = out_param call_param0
-// CHECK:STDOUT:     %return: ref %C.a14 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %False.decl: %False.type = fn_decl @False [concrete = constants.%False] {
-// CHECK:STDOUT:     %return.patt: %pattern_type.d8f = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.d8f = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %false: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %C: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:     %return.param: ref %C.2ba = out_param call_param0
-// CHECK:STDOUT:     %return: ref %C.2ba = return_slot %return.param
-// CHECK:STDOUT:   }
 // CHECK:STDOUT:   name_binding_decl {
 // CHECK:STDOUT:     %a.patt: %pattern_type.d8f = binding_pattern a [concrete]
 // CHECK:STDOUT:     %a.var_patt: %pattern_type.d8f = var_pattern %a.patt [concrete]
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %a.var: ref %C.2ba = var %a.var_patt [concrete]
-// CHECK:STDOUT:   %.loc11_25.1: type = splice_block %C.loc11 [concrete = constants.%C.2ba] {
-// CHECK:STDOUT:     %C.ref.loc11: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %Neq.ref.loc11: %Neq.type = name_ref Neq, %Neq.decl [concrete = constants.%Neq]
-// CHECK:STDOUT:     %true.loc11_14: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %true.loc11_20: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %bool.neq.loc11: init bool = call %Neq.ref.loc11(%true.loc11_14, %true.loc11_20) [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc11_25.2: bool = value_of_initializer %bool.neq.loc11 [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc11_25.3: bool = converted %bool.neq.loc11, %.loc11_25.2 [concrete = constants.%false]
-// CHECK:STDOUT:     %C.loc11: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %a: ref %C.2ba = bind_name a, %a.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %b.patt: %pattern_type.cc5 = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.var_patt: %pattern_type.cc5 = var_pattern %b.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %b.var: ref %C.a14 = var %b.var_patt [concrete]
-// CHECK:STDOUT:   %.loc12_26.1: type = splice_block %C.loc12 [concrete = constants.%C.a14] {
+// CHECK:STDOUT:   %.loc12_25.1: type = splice_block %C.loc12 [concrete = constants.%C.2ba] {
 // CHECK:STDOUT:     %C.ref.loc12: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
 // CHECK:STDOUT:     %Neq.ref.loc12: %Neq.type = name_ref Neq, %Neq.decl [concrete = constants.%Neq]
-// CHECK:STDOUT:     %true.loc12: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %false.loc12: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %bool.neq.loc12: init bool = call %Neq.ref.loc12(%true.loc12, %false.loc12) [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc12_26.2: bool = value_of_initializer %bool.neq.loc12 [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc12_26.3: bool = converted %bool.neq.loc12, %.loc12_26.2 [concrete = constants.%true]
-// CHECK:STDOUT:     %C.loc12: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %b: ref %C.a14 = bind_name b, %b.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %c.patt: %pattern_type.cc5 = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.var_patt: %pattern_type.cc5 = var_pattern %c.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %c.var: ref %C.a14 = var %c.var_patt [concrete]
-// CHECK:STDOUT:   %.loc13_26.1: type = splice_block %C.loc13 [concrete = constants.%C.a14] {
-// CHECK:STDOUT:     %C.ref.loc13: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %Neq.ref.loc13: %Neq.type = name_ref Neq, %Neq.decl [concrete = constants.%Neq]
-// CHECK:STDOUT:     %false.loc13: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %true.loc13: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %bool.neq.loc13: init bool = call %Neq.ref.loc13(%false.loc13, %true.loc13) [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc13_26.2: bool = value_of_initializer %bool.neq.loc13 [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc13_26.3: bool = converted %bool.neq.loc13, %.loc13_26.2 [concrete = constants.%true]
-// CHECK:STDOUT:     %C.loc13: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %c: ref %C.a14 = bind_name c, %c.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %d.patt: %pattern_type.d8f = binding_pattern d [concrete]
-// CHECK:STDOUT:     %d.var_patt: %pattern_type.d8f = var_pattern %d.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %d.var: ref %C.2ba = var %d.var_patt [concrete]
-// CHECK:STDOUT:   %.loc14_27.1: type = splice_block %C.loc14 [concrete = constants.%C.2ba] {
-// CHECK:STDOUT:     %C.ref.loc14: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %Neq.ref.loc14: %Neq.type = name_ref Neq, %Neq.decl [concrete = constants.%Neq]
-// CHECK:STDOUT:     %false.loc14_14: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %false.loc14_21: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %bool.neq.loc14: init bool = call %Neq.ref.loc14(%false.loc14_14, %false.loc14_21) [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc14_27.2: bool = value_of_initializer %bool.neq.loc14 [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc14_27.3: bool = converted %bool.neq.loc14, %.loc14_27.2 [concrete = constants.%false]
-// CHECK:STDOUT:     %C.loc14: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %d: ref %C.2ba = bind_name d, %d.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: generic class @C(%B.loc6_9.1: bool) {
-// CHECK:STDOUT:   %B.loc6_9.2: bool = bind_symbolic_name B, 0 [symbolic = %B.loc6_9.2 (constants.%B)]
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
-// CHECK:STDOUT:
-// CHECK:STDOUT:   class {
-// CHECK:STDOUT:     %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:     %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:     complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT:   !members:
-// CHECK:STDOUT:     .Self = constants.%C.342
+// CHECK:STDOUT:     %true.loc12_14: bool = bool_literal true [concrete = constants.%true]
+// CHECK:STDOUT:     %true.loc12_20: bool = bool_literal true [concrete = constants.%true]
+// CHECK:STDOUT:     %bool.neq.loc12: init bool = call %Neq.ref.loc12(%true.loc12_14, %true.loc12_20) [concrete = constants.%false]
+// CHECK:STDOUT:     %.loc12_25.2: bool = value_of_initializer %bool.neq.loc12 [concrete = constants.%false]
+// CHECK:STDOUT:     %.loc12_25.3: bool = converted %bool.neq.loc12, %.loc12_25.2 [concrete = constants.%false]
+// CHECK:STDOUT:     %C.loc12: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
 // CHECK:STDOUT:   }
+// CHECK:STDOUT:   %a: ref %C.2ba = bind_name a, %a.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @Neq(%a.param: bool, %b.param: bool) -> bool = "bool.neq";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @True() -> %return.param: %C.a14;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @False() -> %return.param: %C.2ba;
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %False.ref.loc11: %False.type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:   %.loc11: ref %C.2ba = splice_block file.%a.var [concrete = file.%a.var] {}
-// CHECK:STDOUT:   %False.call.loc11: init %C.2ba = call %False.ref.loc11() to %.loc11
-// CHECK:STDOUT:   assign file.%a.var, %False.call.loc11
-// CHECK:STDOUT:   %True.ref.loc12: %True.type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:   %.loc12: ref %C.a14 = splice_block file.%b.var [concrete = file.%b.var] {}
-// CHECK:STDOUT:   %True.call.loc12: init %C.a14 = call %True.ref.loc12() to %.loc12
-// CHECK:STDOUT:   assign file.%b.var, %True.call.loc12
-// CHECK:STDOUT:   %True.ref.loc13: %True.type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:   %.loc13: ref %C.a14 = splice_block file.%c.var [concrete = file.%c.var] {}
-// CHECK:STDOUT:   %True.call.loc13: init %C.a14 = call %True.ref.loc13() to %.loc13
-// CHECK:STDOUT:   assign file.%c.var, %True.call.loc13
-// CHECK:STDOUT:   %False.ref.loc14: %False.type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:   %.loc14: ref %C.2ba = splice_block file.%d.var [concrete = file.%d.var] {}
-// CHECK:STDOUT:   %False.call.loc14: init %C.2ba = call %False.ref.loc14() to %.loc14
-// CHECK:STDOUT:   assign file.%d.var, %False.call.loc14
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%B) {
-// CHECK:STDOUT:   %B.loc6_9.2 => constants.%B
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%true) {
-// CHECK:STDOUT:   %B.loc6_9.2 => constants.%true
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%false) {
-// CHECK:STDOUT:   %B.loc6_9.2 => constants.%false
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %False.ref.loc12: %False.type = name_ref False, file.%False.decl [concrete = constants.%False]
+// CHECK:STDOUT:   %.loc12: ref %C.2ba = splice_block file.%a.var [concrete = file.%a.var] {}
+// CHECK:STDOUT:   %False.call.loc12: init %C.2ba = call %False.ref.loc12() to %.loc12
+// CHECK:STDOUT:   assign file.%a.var, %False.call.loc12
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: --- prelude.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %B: bool = bind_symbolic_name B, 0 [symbolic]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
 // CHECK:STDOUT:   %C.type: type = generic_class_type @C [concrete]
 // CHECK:STDOUT:   %C.generic: %C.type = struct_value () [concrete]
-// CHECK:STDOUT:   %C.342: type = class_type @C, @C(%B) [symbolic]
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
 // CHECK:STDOUT:   %true: bool = bool_literal true [concrete]
-// CHECK:STDOUT:   %C.a14: type = class_type @C, @C(%true) [concrete]
-// CHECK:STDOUT:   %pattern_type.cc5: type = pattern_type %C.a14 [concrete]
-// CHECK:STDOUT:   %True.type: type = fn_type @True [concrete]
-// CHECK:STDOUT:   %True: %True.type = struct_value () [concrete]
 // CHECK:STDOUT:   %false: bool = bool_literal false [concrete]
 // CHECK:STDOUT:   %C.2ba: type = class_type @C, @C(%false) [concrete]
 // CHECK:STDOUT:   %pattern_type.d8f: type = pattern_type %C.2ba [concrete]
@@ -298,188 +109,40 @@ var d: C(false != false) = False();
 // CHECK:STDOUT:   %NotEqual.type.c0e: type = fn_type @NotEqual.2 [concrete]
 // CHECK:STDOUT:   %NotEqual.bf4: %NotEqual.type.c0e = struct_value () [concrete]
 // CHECK:STDOUT:   %NotEqual.bound.542: <bound method> = bound_method %true, %NotEqual.bf4 [concrete]
-// CHECK:STDOUT:   %NotEqual.bound.5a9: <bound method> = bound_method %false, %NotEqual.bf4 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     .Eq = %Core.Eq
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT:   %Core.Eq: type = import_ref Core//prelude/operators/comparison, Eq, loaded [concrete = constants.%Eq.type]
 // CHECK:STDOUT:   %Core.import_ref.85b = import_ref Core//prelude/operators/comparison, loc29_45, unloaded
 // CHECK:STDOUT:   %Core.import_ref.67a: %NotEqual.type.c0e = import_ref Core//prelude/operators/comparison, loc30_48, loaded [concrete = constants.%NotEqual.bf4]
 // CHECK:STDOUT:   %Eq.impl_witness_table = impl_witness_table (%Core.import_ref.85b, %Core.import_ref.67a), @impl.bb5 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .C = %C.decl
-// CHECK:STDOUT:     .True = %True.decl
-// CHECK:STDOUT:     .False = %False.decl
-// CHECK:STDOUT:     .a = %a
-// CHECK:STDOUT:     .b = %b
-// CHECK:STDOUT:     .c = %c
-// CHECK:STDOUT:     .d = %d
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %C.decl: %C.type = class_decl @C [concrete = constants.%C.generic] {
-// CHECK:STDOUT:     %B.patt: %pattern_type.831 = symbolic_binding_pattern B, 0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %.loc4_13.1: type = splice_block %.loc4_13.3 [concrete = bool] {
-// CHECK:STDOUT:       %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:       %.loc4_13.2: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:       %.loc4_13.3: type = converted %bool.make_type, %.loc4_13.2 [concrete = bool]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %B.loc4_9.1: bool = bind_symbolic_name B, 0 [symbolic = %B.loc4_9.2 (constants.%B)]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %True.decl: %True.type = fn_decl @True [concrete = constants.%True] {
-// CHECK:STDOUT:     %return.patt: %pattern_type.cc5 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.cc5 = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %true: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %C: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:     %return.param: ref %C.a14 = out_param call_param0
-// CHECK:STDOUT:     %return: ref %C.a14 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %False.decl: %False.type = fn_decl @False [concrete = constants.%False] {
-// CHECK:STDOUT:     %return.patt: %pattern_type.d8f = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.d8f = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %C.ref: %C.type = name_ref C, file.%C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %false: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %C: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:     %return.param: ref %C.2ba = out_param call_param0
-// CHECK:STDOUT:     %return: ref %C.2ba = return_slot %return.param
-// CHECK:STDOUT:   }
 // CHECK:STDOUT:   name_binding_decl {
 // CHECK:STDOUT:     %a.patt: %pattern_type.d8f = binding_pattern a [concrete]
 // CHECK:STDOUT:     %a.var_patt: %pattern_type.d8f = var_pattern %a.patt [concrete]
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %a.var: ref %C.2ba = var %a.var_patt [concrete]
-// CHECK:STDOUT:   %.loc9_22.1: type = splice_block %C.loc9 [concrete = constants.%C.2ba] {
-// CHECK:STDOUT:     %C.ref.loc9: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %true.loc9_10: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %true.loc9_18: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %impl.elem1.loc9: %.f66 = impl_witness_access constants.%Eq.impl_witness, element1 [concrete = constants.%NotEqual.bf4]
-// CHECK:STDOUT:     %bound_method.loc9: <bound method> = bound_method %true.loc9_10, %impl.elem1.loc9 [concrete = constants.%NotEqual.bound.542]
-// CHECK:STDOUT:     %bool.neq.loc9: init bool = call %bound_method.loc9(%true.loc9_10, %true.loc9_18) [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc9_22.2: bool = value_of_initializer %bool.neq.loc9 [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc9_22.3: bool = converted %bool.neq.loc9, %.loc9_22.2 [concrete = constants.%false]
-// CHECK:STDOUT:     %C.loc9: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %a: ref %C.2ba = bind_name a, %a.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %b.patt: %pattern_type.cc5 = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.var_patt: %pattern_type.cc5 = var_pattern %b.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %b.var: ref %C.a14 = var %b.var_patt [concrete]
-// CHECK:STDOUT:   %.loc10_23.1: type = splice_block %C.loc10 [concrete = constants.%C.a14] {
+// CHECK:STDOUT:   %.loc10_22.1: type = splice_block %C.loc10 [concrete = constants.%C.2ba] {
 // CHECK:STDOUT:     %C.ref.loc10: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %true.loc10: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %false.loc10: bool = bool_literal false [concrete = constants.%false]
+// CHECK:STDOUT:     %true.loc10_10: bool = bool_literal true [concrete = constants.%true]
+// CHECK:STDOUT:     %true.loc10_18: bool = bool_literal true [concrete = constants.%true]
 // CHECK:STDOUT:     %impl.elem1.loc10: %.f66 = impl_witness_access constants.%Eq.impl_witness, element1 [concrete = constants.%NotEqual.bf4]
-// CHECK:STDOUT:     %bound_method.loc10: <bound method> = bound_method %true.loc10, %impl.elem1.loc10 [concrete = constants.%NotEqual.bound.542]
-// CHECK:STDOUT:     %bool.neq.loc10: init bool = call %bound_method.loc10(%true.loc10, %false.loc10) [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc10_23.2: bool = value_of_initializer %bool.neq.loc10 [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc10_23.3: bool = converted %bool.neq.loc10, %.loc10_23.2 [concrete = constants.%true]
-// CHECK:STDOUT:     %C.loc10: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %b: ref %C.a14 = bind_name b, %b.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %c.patt: %pattern_type.cc5 = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.var_patt: %pattern_type.cc5 = var_pattern %c.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %c.var: ref %C.a14 = var %c.var_patt [concrete]
-// CHECK:STDOUT:   %.loc11_23.1: type = splice_block %C.loc11 [concrete = constants.%C.a14] {
-// CHECK:STDOUT:     %C.ref.loc11: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %false.loc11: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %true.loc11: bool = bool_literal true [concrete = constants.%true]
-// CHECK:STDOUT:     %impl.elem1.loc11: %.f66 = impl_witness_access constants.%Eq.impl_witness, element1 [concrete = constants.%NotEqual.bf4]
-// CHECK:STDOUT:     %bound_method.loc11: <bound method> = bound_method %false.loc11, %impl.elem1.loc11 [concrete = constants.%NotEqual.bound.5a9]
-// CHECK:STDOUT:     %bool.neq.loc11: init bool = call %bound_method.loc11(%false.loc11, %true.loc11) [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc11_23.2: bool = value_of_initializer %bool.neq.loc11 [concrete = constants.%true]
-// CHECK:STDOUT:     %.loc11_23.3: bool = converted %bool.neq.loc11, %.loc11_23.2 [concrete = constants.%true]
-// CHECK:STDOUT:     %C.loc11: type = class_type @C, @C(constants.%true) [concrete = constants.%C.a14]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %c: ref %C.a14 = bind_name c, %c.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %d.patt: %pattern_type.d8f = binding_pattern d [concrete]
-// CHECK:STDOUT:     %d.var_patt: %pattern_type.d8f = var_pattern %d.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %d.var: ref %C.2ba = var %d.var_patt [concrete]
-// CHECK:STDOUT:   %.loc12_24.1: type = splice_block %C.loc12 [concrete = constants.%C.2ba] {
-// CHECK:STDOUT:     %C.ref.loc12: %C.type = name_ref C, %C.decl [concrete = constants.%C.generic]
-// CHECK:STDOUT:     %false.loc12_10: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %false.loc12_19: bool = bool_literal false [concrete = constants.%false]
-// CHECK:STDOUT:     %impl.elem1.loc12: %.f66 = impl_witness_access constants.%Eq.impl_witness, element1 [concrete = constants.%NotEqual.bf4]
-// CHECK:STDOUT:     %bound_method.loc12: <bound method> = bound_method %false.loc12_10, %impl.elem1.loc12 [concrete = constants.%NotEqual.bound.5a9]
-// CHECK:STDOUT:     %bool.neq.loc12: init bool = call %bound_method.loc12(%false.loc12_10, %false.loc12_19) [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc12_24.2: bool = value_of_initializer %bool.neq.loc12 [concrete = constants.%false]
-// CHECK:STDOUT:     %.loc12_24.3: bool = converted %bool.neq.loc12, %.loc12_24.2 [concrete = constants.%false]
-// CHECK:STDOUT:     %C.loc12: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %d: ref %C.2ba = bind_name d, %d.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: generic class @C(%B.loc4_9.1: bool) {
-// CHECK:STDOUT:   %B.loc4_9.2: bool = bind_symbolic_name B, 0 [symbolic = %B.loc4_9.2 (constants.%B)]
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
-// CHECK:STDOUT:
-// CHECK:STDOUT:   class {
-// CHECK:STDOUT:     %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:     %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:     complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT:   !members:
-// CHECK:STDOUT:     .Self = constants.%C.342
+// CHECK:STDOUT:     %bound_method.loc10: <bound method> = bound_method %true.loc10_10, %impl.elem1.loc10 [concrete = constants.%NotEqual.bound.542]
+// CHECK:STDOUT:     %bool.neq.loc10: init bool = call %bound_method.loc10(%true.loc10_10, %true.loc10_18) [concrete = constants.%false]
+// CHECK:STDOUT:     %.loc10_22.2: bool = value_of_initializer %bool.neq.loc10 [concrete = constants.%false]
+// CHECK:STDOUT:     %.loc10_22.3: bool = converted %bool.neq.loc10, %.loc10_22.2 [concrete = constants.%false]
+// CHECK:STDOUT:     %C.loc10: type = class_type @C, @C(constants.%false) [concrete = constants.%C.2ba]
 // CHECK:STDOUT:   }
+// CHECK:STDOUT:   %a: ref %C.2ba = bind_name a, %a.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @True() -> %return.param: %C.a14;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @False() -> %return.param: %C.2ba;
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %False.ref.loc9: %False.type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:   %.loc9: ref %C.2ba = splice_block file.%a.var [concrete = file.%a.var] {}
-// CHECK:STDOUT:   %False.call.loc9: init %C.2ba = call %False.ref.loc9() to %.loc9
-// CHECK:STDOUT:   assign file.%a.var, %False.call.loc9
-// CHECK:STDOUT:   %True.ref.loc10: %True.type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:   %.loc10: ref %C.a14 = splice_block file.%b.var [concrete = file.%b.var] {}
-// CHECK:STDOUT:   %True.call.loc10: init %C.a14 = call %True.ref.loc10() to %.loc10
-// CHECK:STDOUT:   assign file.%b.var, %True.call.loc10
-// CHECK:STDOUT:   %True.ref.loc11: %True.type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:   %.loc11: ref %C.a14 = splice_block file.%c.var [concrete = file.%c.var] {}
-// CHECK:STDOUT:   %True.call.loc11: init %C.a14 = call %True.ref.loc11() to %.loc11
-// CHECK:STDOUT:   assign file.%c.var, %True.call.loc11
-// CHECK:STDOUT:   %False.ref.loc12: %False.type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:   %.loc12: ref %C.2ba = splice_block file.%d.var [concrete = file.%d.var] {}
-// CHECK:STDOUT:   %False.call.loc12: init %C.2ba = call %False.ref.loc12() to %.loc12
-// CHECK:STDOUT:   assign file.%d.var, %False.call.loc12
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%B) {
-// CHECK:STDOUT:   %B.loc4_9.2 => constants.%B
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%true) {
-// CHECK:STDOUT:   %B.loc4_9.2 => constants.%true
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: specific @C(constants.%false) {
-// CHECK:STDOUT:   %B.loc4_9.2 => constants.%false
-// CHECK:STDOUT:
-// CHECK:STDOUT: !definition:
+// CHECK:STDOUT:   %False.ref.loc10: %False.type = name_ref False, file.%False.decl [concrete = constants.%False]
+// CHECK:STDOUT:   %.loc10: ref %C.2ba = splice_block file.%a.var [concrete = file.%a.var] {}
+// CHECK:STDOUT:   %False.call.loc10: init %C.2ba = call %False.ref.loc10() to %.loc10
+// CHECK:STDOUT:   assign file.%a.var, %False.call.loc10
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 11 - 418
toolchain/check/testdata/builtins/float/add.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/add.carbon
@@ -10,17 +12,21 @@
 
 // --- float_add.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Add(a: f64, b: f64) -> f64 = "float.add";
 
 fn RuntimeCallIsValid(a: f64, b: f64) -> f64 {
+  //@dump-sem-ir-begin
   return Add(a, b);
+  //@dump-sem-ir-end
 }
 
 var x: f64 = Add(2.2, 2.3);
 
 // --- fail_bad_decl.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
 // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.add" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.add";
@@ -54,439 +60,26 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool {
 // CHECK:STDOUT: --- float_add.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
 // CHECK:STDOUT:   %Add.type: type = fn_type @Add [concrete]
 // CHECK:STDOUT:   %Add: %Add.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float.9f7: f64 = float_literal 2.2000000000000002 [concrete]
-// CHECK:STDOUT:   %float.930: f64 = float_literal 2.3000000000000003 [concrete]
-// CHECK:STDOUT:   %float.750: f64 = float_literal 4.5 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .Add = %Add.decl
-// CHECK:STDOUT:     .RuntimeCallIsValid = %RuntimeCallIsValid.decl
-// CHECK:STDOUT:     .x = %x
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Add.decl: %Add.type = fn_decl @Add [concrete = constants.%Add] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc2_27: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc2_27: init type = call constants.%Float(%int_64.loc2_27) [concrete = f64]
-// CHECK:STDOUT:     %.loc2_27.1: type = value_of_initializer %float.make_type.loc2_27 [concrete = f64]
-// CHECK:STDOUT:     %.loc2_27.2: type = converted %float.make_type.loc2_27, %.loc2_27.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc2_11.1: type = splice_block %.loc2_11.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_11: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_11.2: type = value_of_initializer %float.make_type.loc2_11 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_11.3: type = converted %float.make_type.loc2_11, %.loc2_11.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc2_19.1: type = splice_block %.loc2_19.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_19: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_19.2: type = value_of_initializer %float.make_type.loc2_19 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_19.3: type = converted %float.make_type.loc2_19, %.loc2_19.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [concrete = constants.%RuntimeCallIsValid] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc4_42: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc4_42: init type = call constants.%Float(%int_64.loc4_42) [concrete = f64]
-// CHECK:STDOUT:     %.loc4_42.1: type = value_of_initializer %float.make_type.loc4_42 [concrete = f64]
-// CHECK:STDOUT:     %.loc4_42.2: type = converted %float.make_type.loc4_42, %.loc4_42.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc4_26.1: type = splice_block %.loc4_26.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc4_26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc4_26: init type = call constants.%Float(%int_64.loc4_26) [concrete = f64]
-// CHECK:STDOUT:       %.loc4_26.2: type = value_of_initializer %float.make_type.loc4_26 [concrete = f64]
-// CHECK:STDOUT:       %.loc4_26.3: type = converted %float.make_type.loc4_26, %.loc4_26.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc4_34.1: type = splice_block %.loc4_34.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc4_34: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc4_34: init type = call constants.%Float(%int_64.loc4_34) [concrete = f64]
-// CHECK:STDOUT:       %.loc4_34.2: type = value_of_initializer %float.make_type.loc4_34 [concrete = f64]
-// CHECK:STDOUT:       %.loc4_34.3: type = converted %float.make_type.loc4_34, %.loc4_34.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %x.patt: %pattern_type.3de = binding_pattern x [concrete]
-// CHECK:STDOUT:     %x.var_patt: %pattern_type.3de = var_pattern %x.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %x.var: ref f64 = var %x.var_patt [concrete]
-// CHECK:STDOUT:   %.loc8_8.1: type = splice_block %.loc8_8.3 [concrete = f64] {
-// CHECK:STDOUT:     %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type: init type = call constants.%Float(%int_64) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_8.2: type = value_of_initializer %float.make_type [concrete = f64]
-// CHECK:STDOUT:     %.loc8_8.3: type = converted %float.make_type, %.loc8_8.2 [concrete = f64]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %x: ref f64 = bind_name x, %x.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Add(%a.param: f64, %b.param: f64) -> f64 = "float.add";
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: f64, %b.param: f64) -> f64 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Add.ref: %Add.type = name_ref Add, file.%Add.decl [concrete = constants.%Add]
 // CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
 // CHECK:STDOUT:   %float.add: init f64 = call %Add.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc5_19.1: f64 = value_of_initializer %float.add
-// CHECK:STDOUT:   %.loc5_19.2: f64 = converted %float.add, %.loc5_19.1
-// CHECK:STDOUT:   return %.loc5_19.2
+// CHECK:STDOUT:   %.loc8_19.1: f64 = value_of_initializer %float.add
+// CHECK:STDOUT:   %.loc8_19.2: f64 = converted %float.add, %.loc8_19.1
+// CHECK:STDOUT:   return %.loc8_19.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %Add.ref: %Add.type = name_ref Add, file.%Add.decl [concrete = constants.%Add]
-// CHECK:STDOUT:   %float.loc8_18: f64 = float_literal 2.2000000000000002 [concrete = constants.%float.9f7]
-// CHECK:STDOUT:   %float.loc8_23: f64 = float_literal 2.3000000000000003 [concrete = constants.%float.930]
-// CHECK:STDOUT:   %float.add: init f64 = call %Add.ref(%float.loc8_18, %float.loc8_23) [concrete = constants.%float.750]
-// CHECK:STDOUT:   assign file.%x.var, %float.add
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: --- fail_bad_decl.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %TooFew.type: type = fn_type @TooFew [concrete]
-// CHECK:STDOUT:   %TooFew: %TooFew.type = struct_value () [concrete]
-// CHECK:STDOUT:   %TooMany.type: type = fn_type @TooMany [concrete]
-// CHECK:STDOUT:   %TooMany: %TooMany.type = struct_value () [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
-// CHECK:STDOUT:   %BadReturnType.type: type = fn_type @BadReturnType [concrete]
-// CHECK:STDOUT:   %BadReturnType: %BadReturnType.type = struct_value () [concrete]
-// CHECK:STDOUT:   %JustRight.type: type = fn_type @JustRight [concrete]
-// CHECK:STDOUT:   %JustRight: %JustRight.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew.type: type = fn_type @RuntimeCallIsValidTooFew [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew: %RuntimeCallIsValidTooFew.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany.type: type = fn_type @RuntimeCallIsValidTooMany [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany: %RuntimeCallIsValidTooMany.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType.type: type = fn_type @RuntimeCallIsValidBadReturnType [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType: %RuntimeCallIsValidBadReturnType.type = struct_value () [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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:     .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 [concrete = constants.%TooFew] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc8_22: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc8_22: init type = call constants.%Float(%int_64.loc8_22) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_22.1: type = value_of_initializer %float.make_type.loc8_22 [concrete = f64]
-// CHECK:STDOUT:     %.loc8_22.2: type = converted %float.make_type.loc8_22, %.loc8_22.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc8_14.1: type = splice_block %.loc8_14.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc8_14: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [concrete = f64]
-// CHECK:STDOUT:       %.loc8_14.2: type = value_of_initializer %float.make_type.loc8_14 [concrete = f64]
-// CHECK:STDOUT:       %.loc8_14.3: type = converted %float.make_type.loc8_14, %.loc8_14.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %TooMany.decl: %TooMany.type = fn_decl @TooMany [concrete = constants.%TooMany] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %c.patt: %pattern_type.3de = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.param_patt: %pattern_type.3de = value_param_pattern %c.patt, call_param2 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param3 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc13_39: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc13_39: init type = call constants.%Float(%int_64.loc13_39) [concrete = f64]
-// CHECK:STDOUT:     %.loc13_39.1: type = value_of_initializer %float.make_type.loc13_39 [concrete = f64]
-// CHECK:STDOUT:     %.loc13_39.2: type = converted %float.make_type.loc13_39, %.loc13_39.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc13_15.1: type = splice_block %.loc13_15.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_15.2: type = value_of_initializer %float.make_type.loc13_15 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_15.3: type = converted %float.make_type.loc13_15, %.loc13_15.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc13_23.1: type = splice_block %.loc13_23.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_23: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_23.2: type = value_of_initializer %float.make_type.loc13_23 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_23.3: type = converted %float.make_type.loc13_23, %.loc13_23.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %c.param: f64 = value_param call_param2
-// CHECK:STDOUT:     %.loc13_31.1: type = splice_block %.loc13_31.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_31: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_31.2: type = value_of_initializer %float.make_type.loc13_31 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_31.3: type = converted %float.make_type.loc13_31, %.loc13_31.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %c: f64 = bind_name c, %c.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param3
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [concrete = constants.%BadReturnType] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc18_37.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc18_21.1: type = splice_block %.loc18_21.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc18_21: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc18_21: init type = call constants.%Float(%int_64.loc18_21) [concrete = f64]
-// CHECK:STDOUT:       %.loc18_21.2: type = value_of_initializer %float.make_type.loc18_21 [concrete = f64]
-// CHECK:STDOUT:       %.loc18_21.3: type = converted %float.make_type.loc18_21, %.loc18_21.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc18_29.1: type = splice_block %.loc18_29.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc18_29: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc18_29: init type = call constants.%Float(%int_64.loc18_29) [concrete = f64]
-// CHECK:STDOUT:       %.loc18_29.2: type = value_of_initializer %float.make_type.loc18_29 [concrete = f64]
-// CHECK:STDOUT:       %.loc18_29.3: type = converted %float.make_type.loc18_29, %.loc18_29.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %JustRight.decl: %JustRight.type = fn_decl @JustRight [concrete = constants.%JustRight] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc19_33: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc19_33: init type = call constants.%Float(%int_64.loc19_33) [concrete = f64]
-// CHECK:STDOUT:     %.loc19_33.1: type = value_of_initializer %float.make_type.loc19_33 [concrete = f64]
-// CHECK:STDOUT:     %.loc19_33.2: type = converted %float.make_type.loc19_33, %.loc19_33.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc19_17.1: type = splice_block %.loc19_17.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc19_17: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc19_17: init type = call constants.%Float(%int_64.loc19_17) [concrete = f64]
-// CHECK:STDOUT:       %.loc19_17.2: type = value_of_initializer %float.make_type.loc19_17 [concrete = f64]
-// CHECK:STDOUT:       %.loc19_17.3: type = converted %float.make_type.loc19_17, %.loc19_17.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc19_25.1: type = splice_block %.loc19_25.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc19_25: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc19_25: init type = call constants.%Float(%int_64.loc19_25) [concrete = f64]
-// CHECK:STDOUT:       %.loc19_25.2: type = value_of_initializer %float.make_type.loc19_25 [concrete = f64]
-// CHECK:STDOUT:       %.loc19_25.3: type = converted %float.make_type.loc19_25, %.loc19_25.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew.decl: %RuntimeCallIsValidTooFew.type = fn_decl @RuntimeCallIsValidTooFew [concrete = constants.%RuntimeCallIsValidTooFew] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc21_40: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc21_40: init type = call constants.%Float(%int_64.loc21_40) [concrete = f64]
-// CHECK:STDOUT:     %.loc21_40.1: type = value_of_initializer %float.make_type.loc21_40 [concrete = f64]
-// CHECK:STDOUT:     %.loc21_40.2: type = converted %float.make_type.loc21_40, %.loc21_40.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc21_32.1: type = splice_block %.loc21_32.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc21_32: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc21_32: init type = call constants.%Float(%int_64.loc21_32) [concrete = f64]
-// CHECK:STDOUT:       %.loc21_32.2: type = value_of_initializer %float.make_type.loc21_32 [concrete = f64]
-// CHECK:STDOUT:       %.loc21_32.3: type = converted %float.make_type.loc21_32, %.loc21_32.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany.decl: %RuntimeCallIsValidTooMany.type = fn_decl @RuntimeCallIsValidTooMany [concrete = constants.%RuntimeCallIsValidTooMany] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %c.patt: %pattern_type.3de = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.param_patt: %pattern_type.3de = value_param_pattern %c.patt, call_param2 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param3 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc25_57: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc25_57: init type = call constants.%Float(%int_64.loc25_57) [concrete = f64]
-// CHECK:STDOUT:     %.loc25_57.1: type = value_of_initializer %float.make_type.loc25_57 [concrete = f64]
-// CHECK:STDOUT:     %.loc25_57.2: type = converted %float.make_type.loc25_57, %.loc25_57.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc25_33.1: type = splice_block %.loc25_33.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_33: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_33: init type = call constants.%Float(%int_64.loc25_33) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_33.2: type = value_of_initializer %float.make_type.loc25_33 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_33.3: type = converted %float.make_type.loc25_33, %.loc25_33.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc25_41.1: type = splice_block %.loc25_41.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_41: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_41: init type = call constants.%Float(%int_64.loc25_41) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_41.2: type = value_of_initializer %float.make_type.loc25_41 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_41.3: type = converted %float.make_type.loc25_41, %.loc25_41.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %c.param: f64 = value_param call_param2
-// CHECK:STDOUT:     %.loc25_49.1: type = splice_block %.loc25_49.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_49: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_49: init type = call constants.%Float(%int_64.loc25_49) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_49.2: type = value_of_initializer %float.make_type.loc25_49 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_49.3: type = converted %float.make_type.loc25_49, %.loc25_49.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %c: f64 = bind_name c, %c.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param3
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType.decl: %RuntimeCallIsValidBadReturnType.type = fn_decl @RuntimeCallIsValidBadReturnType [concrete = constants.%RuntimeCallIsValidBadReturnType] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc29_55.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc29_55.2: type = converted %bool.make_type, %.loc29_55.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc29_39.1: type = splice_block %.loc29_39.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc29_39: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc29_39: init type = call constants.%Float(%int_64.loc29_39) [concrete = f64]
-// CHECK:STDOUT:       %.loc29_39.2: type = value_of_initializer %float.make_type.loc29_39 [concrete = f64]
-// CHECK:STDOUT:       %.loc29_39.3: type = converted %float.make_type.loc29_39, %.loc29_39.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc29_47.1: type = splice_block %.loc29_47.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc29_47: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc29_47: init type = call constants.%Float(%int_64.loc29_47) [concrete = f64]
-// CHECK:STDOUT:       %.loc29_47.2: type = value_of_initializer %float.make_type.loc29_47 [concrete = f64]
-// CHECK:STDOUT:       %.loc29_47.3: type = converted %float.make_type.loc29_47, %.loc29_47.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @TooFew(%a.param: f64) -> f64;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @TooMany(%a.param: f64, %b.param: f64, %c.param: f64) -> f64;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @BadReturnType(%a.param: f64, %b.param: f64) -> bool;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @JustRight(%a.param: f64, %b.param: f64) -> f64 = "float.add";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidTooFew(%a.param: f64) -> f64 {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [concrete = constants.%TooFew]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %TooFew.call: init f64 = call %TooFew.ref(%a.ref)
-// CHECK:STDOUT:   %.loc22_19.1: f64 = value_of_initializer %TooFew.call
-// CHECK:STDOUT:   %.loc22_19.2: f64 = converted %TooFew.call, %.loc22_19.1
-// CHECK:STDOUT:   return %.loc22_19.2
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param: f64, %b.param: f64, %c.param: f64) -> f64 {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [concrete = constants.%TooMany]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
-// CHECK:STDOUT:   %c.ref: f64 = name_ref c, %c
-// CHECK:STDOUT:   %TooMany.call: init f64 = call %TooMany.ref(%a.ref, %b.ref, %c.ref)
-// CHECK:STDOUT:   %.loc26_26.1: f64 = value_of_initializer %TooMany.call
-// CHECK:STDOUT:   %.loc26_26.2: f64 = converted %TooMany.call, %.loc26_26.1
-// CHECK:STDOUT:   return %.loc26_26.2
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param: f64, %b.param: f64) -> bool {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [concrete = constants.%BadReturnType]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
-// CHECK:STDOUT:   %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc30_29.1: bool = value_of_initializer %BadReturnType.call
-// CHECK:STDOUT:   %.loc30_29.2: bool = converted %BadReturnType.call, %.loc30_29.1
-// CHECK:STDOUT:   return %.loc30_29.2
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 31 - 469
toolchain/check/testdata/builtins/float/div.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/div.carbon
@@ -10,45 +12,56 @@
 
 // --- float_div.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Div(a: f64, b: f64) -> f64 = "float.div";
 
 fn RuntimeCallIsValid(a: f64, b: f64) -> f64 {
+  //@dump-sem-ir-begin
   return Div(a, b);
+  //@dump-sem-ir-end
 }
 
 var a: f64 = Div(10.0, 2.5);
 let b: f64 = Div(1.0, 0.0);
 let c: f64 = Div(0.0, 0.0);
 
-// --- fail_bad_decl.carbon
+// --- fail_too_few.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.div" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.div" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.div";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn TooFew(a: f64) -> f64 = "float.div";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.div" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.div";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.div";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.div" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.div";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn BadReturnType(a: f64, b: f64) -> bool = "float.div";
-fn JustRight(a: f64, b: f64) -> f64 = "float.div";
 
 fn RuntimeCallIsValidTooFew(a: f64) -> f64 {
   return TooFew(a);
 }
 
+// --- fail_too_many.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.div" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.div";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.div";
+
 fn RuntimeCallIsValidTooMany(a: f64, b: f64, c: f64) -> f64 {
   return TooMany(a, b, c);
 }
 
+// --- fail_bad_return_type.carbon
+
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.div" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.div";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn BadReturnType(a: f64, b: f64) -> bool = "float.div";
+
 fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool {
   return BadReturnType(a, b);
 }
@@ -56,477 +69,26 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool {
 // CHECK:STDOUT: --- float_div.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
 // CHECK:STDOUT:   %Div.type: type = fn_type @Div [concrete]
 // CHECK:STDOUT:   %Div: %Div.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float.9a5: f64 = float_literal 10 [concrete]
-// CHECK:STDOUT:   %float.33c: f64 = float_literal 2.5 [concrete]
-// CHECK:STDOUT:   %float.a5c: f64 = float_literal 4 [concrete]
-// CHECK:STDOUT:   %float.f4e: f64 = float_literal 1 [concrete]
-// CHECK:STDOUT:   %float.555: f64 = float_literal 0 [concrete]
-// CHECK:STDOUT:   %float.bd4: f64 = float_literal +Inf [concrete]
-// CHECK:STDOUT:   %float.8b7: f64 = float_literal NaN [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .Div = %Div.decl
-// CHECK:STDOUT:     .RuntimeCallIsValid = %RuntimeCallIsValid.decl
-// CHECK:STDOUT:     .a = %a
-// CHECK:STDOUT:     .b = %b
-// CHECK:STDOUT:     .c = %c
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Div.decl: %Div.type = fn_decl @Div [concrete = constants.%Div] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc2_27: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc2_27: init type = call constants.%Float(%int_64.loc2_27) [concrete = f64]
-// CHECK:STDOUT:     %.loc2_27.1: type = value_of_initializer %float.make_type.loc2_27 [concrete = f64]
-// CHECK:STDOUT:     %.loc2_27.2: type = converted %float.make_type.loc2_27, %.loc2_27.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc2_11.1: type = splice_block %.loc2_11.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_11: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_11.2: type = value_of_initializer %float.make_type.loc2_11 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_11.3: type = converted %float.make_type.loc2_11, %.loc2_11.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc2_19.1: type = splice_block %.loc2_19.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_19: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_19.2: type = value_of_initializer %float.make_type.loc2_19 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_19.3: type = converted %float.make_type.loc2_19, %.loc2_19.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [concrete = constants.%RuntimeCallIsValid] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc4_42: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc4_42: init type = call constants.%Float(%int_64.loc4_42) [concrete = f64]
-// CHECK:STDOUT:     %.loc4_42.1: type = value_of_initializer %float.make_type.loc4_42 [concrete = f64]
-// CHECK:STDOUT:     %.loc4_42.2: type = converted %float.make_type.loc4_42, %.loc4_42.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc4_26.1: type = splice_block %.loc4_26.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc4_26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc4_26: init type = call constants.%Float(%int_64.loc4_26) [concrete = f64]
-// CHECK:STDOUT:       %.loc4_26.2: type = value_of_initializer %float.make_type.loc4_26 [concrete = f64]
-// CHECK:STDOUT:       %.loc4_26.3: type = converted %float.make_type.loc4_26, %.loc4_26.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc4_34.1: type = splice_block %.loc4_34.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc4_34: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc4_34: init type = call constants.%Float(%int_64.loc4_34) [concrete = f64]
-// CHECK:STDOUT:       %.loc4_34.2: type = value_of_initializer %float.make_type.loc4_34 [concrete = f64]
-// CHECK:STDOUT:       %.loc4_34.3: type = converted %float.make_type.loc4_34, %.loc4_34.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.var_patt: %pattern_type.3de = var_pattern %a.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %a.var: ref f64 = var %a.var_patt [concrete]
-// CHECK:STDOUT:   %.loc8_8.1: type = splice_block %.loc8_8.3 [concrete = f64] {
-// CHECK:STDOUT:     %int_64.loc8: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc8: init type = call constants.%Float(%int_64.loc8) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_8.2: type = value_of_initializer %float.make_type.loc8 [concrete = f64]
-// CHECK:STDOUT:     %.loc8_8.3: type = converted %float.make_type.loc8, %.loc8_8.2 [concrete = f64]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %a: ref f64 = bind_name a, %a.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %.loc9_8.1: type = splice_block %.loc9_8.3 [concrete = f64] {
-// CHECK:STDOUT:     %int_64.loc9: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc9: init type = call constants.%Float(%int_64.loc9) [concrete = f64]
-// CHECK:STDOUT:     %.loc9_8.2: type = value_of_initializer %float.make_type.loc9 [concrete = f64]
-// CHECK:STDOUT:     %.loc9_8.3: type = converted %float.make_type.loc9, %.loc9_8.2 [concrete = f64]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %.loc9_26.1: ref f64 = temporary_storage
-// CHECK:STDOUT:   %.loc9_26.2: ref f64 = temporary %.loc9_26.1, @__global_init.%float.div.loc9
-// CHECK:STDOUT:   %b: ref f64 = bind_name b, %.loc9_26.2
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %c.patt: %pattern_type.3de = binding_pattern c [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %.loc10_8.1: type = splice_block %.loc10_8.3 [concrete = f64] {
-// CHECK:STDOUT:     %int_64.loc10: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc10: init type = call constants.%Float(%int_64.loc10) [concrete = f64]
-// CHECK:STDOUT:     %.loc10_8.2: type = value_of_initializer %float.make_type.loc10 [concrete = f64]
-// CHECK:STDOUT:     %.loc10_8.3: type = converted %float.make_type.loc10, %.loc10_8.2 [concrete = f64]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %.loc10_26.1: ref f64 = temporary_storage
-// CHECK:STDOUT:   %.loc10_26.2: ref f64 = temporary %.loc10_26.1, @__global_init.%float.div.loc10
-// CHECK:STDOUT:   %c: ref f64 = bind_name c, %.loc10_26.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @Div(%a.param: f64, %b.param: f64) -> f64 = "float.div";
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: f64, %b.param: f64) -> f64 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Div.ref: %Div.type = name_ref Div, file.%Div.decl [concrete = constants.%Div]
 // CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
 // CHECK:STDOUT:   %float.div: init f64 = call %Div.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc5_19.1: f64 = value_of_initializer %float.div
-// CHECK:STDOUT:   %.loc5_19.2: f64 = converted %float.div, %.loc5_19.1
-// CHECK:STDOUT:   return %.loc5_19.2
+// CHECK:STDOUT:   %.loc8_19.1: f64 = value_of_initializer %float.div
+// CHECK:STDOUT:   %.loc8_19.2: f64 = converted %float.div, %.loc8_19.1
+// CHECK:STDOUT:   return %.loc8_19.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %Div.ref.loc8: %Div.type = name_ref Div, file.%Div.decl [concrete = constants.%Div]
-// CHECK:STDOUT:   %float.loc8_18: f64 = float_literal 10 [concrete = constants.%float.9a5]
-// CHECK:STDOUT:   %float.loc8_24: f64 = float_literal 2.5 [concrete = constants.%float.33c]
-// CHECK:STDOUT:   %float.div.loc8: init f64 = call %Div.ref.loc8(%float.loc8_18, %float.loc8_24) [concrete = constants.%float.a5c]
-// CHECK:STDOUT:   assign file.%a.var, %float.div.loc8
-// CHECK:STDOUT:   %Div.ref.loc9: %Div.type = name_ref Div, file.%Div.decl [concrete = constants.%Div]
-// CHECK:STDOUT:   %float.loc9_18: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc9_23: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %float.div.loc9: init f64 = call %Div.ref.loc9(%float.loc9_18, %float.loc9_23) [concrete = constants.%float.bd4]
-// CHECK:STDOUT:   %Div.ref.loc10: %Div.type = name_ref Div, file.%Div.decl [concrete = constants.%Div]
-// CHECK:STDOUT:   %float.loc10_18: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %float.loc10_23: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %float.div.loc10: init f64 = call %Div.ref.loc10(%float.loc10_18, %float.loc10_23) [concrete = constants.%float.8b7]
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: --- fail_bad_decl.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %TooFew.type: type = fn_type @TooFew [concrete]
-// CHECK:STDOUT:   %TooFew: %TooFew.type = struct_value () [concrete]
-// CHECK:STDOUT:   %TooMany.type: type = fn_type @TooMany [concrete]
-// CHECK:STDOUT:   %TooMany: %TooMany.type = struct_value () [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
-// CHECK:STDOUT:   %BadReturnType.type: type = fn_type @BadReturnType [concrete]
-// CHECK:STDOUT:   %BadReturnType: %BadReturnType.type = struct_value () [concrete]
-// CHECK:STDOUT:   %JustRight.type: type = fn_type @JustRight [concrete]
-// CHECK:STDOUT:   %JustRight: %JustRight.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew.type: type = fn_type @RuntimeCallIsValidTooFew [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew: %RuntimeCallIsValidTooFew.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany.type: type = fn_type @RuntimeCallIsValidTooMany [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany: %RuntimeCallIsValidTooMany.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType.type: type = fn_type @RuntimeCallIsValidBadReturnType [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType: %RuntimeCallIsValidBadReturnType.type = struct_value () [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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:     .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 [concrete = constants.%TooFew] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc8_22: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc8_22: init type = call constants.%Float(%int_64.loc8_22) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_22.1: type = value_of_initializer %float.make_type.loc8_22 [concrete = f64]
-// CHECK:STDOUT:     %.loc8_22.2: type = converted %float.make_type.loc8_22, %.loc8_22.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc8_14.1: type = splice_block %.loc8_14.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc8_14: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [concrete = f64]
-// CHECK:STDOUT:       %.loc8_14.2: type = value_of_initializer %float.make_type.loc8_14 [concrete = f64]
-// CHECK:STDOUT:       %.loc8_14.3: type = converted %float.make_type.loc8_14, %.loc8_14.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %TooMany.decl: %TooMany.type = fn_decl @TooMany [concrete = constants.%TooMany] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %c.patt: %pattern_type.3de = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.param_patt: %pattern_type.3de = value_param_pattern %c.patt, call_param2 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param3 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc13_39: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc13_39: init type = call constants.%Float(%int_64.loc13_39) [concrete = f64]
-// CHECK:STDOUT:     %.loc13_39.1: type = value_of_initializer %float.make_type.loc13_39 [concrete = f64]
-// CHECK:STDOUT:     %.loc13_39.2: type = converted %float.make_type.loc13_39, %.loc13_39.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc13_15.1: type = splice_block %.loc13_15.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_15.2: type = value_of_initializer %float.make_type.loc13_15 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_15.3: type = converted %float.make_type.loc13_15, %.loc13_15.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc13_23.1: type = splice_block %.loc13_23.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_23: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_23.2: type = value_of_initializer %float.make_type.loc13_23 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_23.3: type = converted %float.make_type.loc13_23, %.loc13_23.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %c.param: f64 = value_param call_param2
-// CHECK:STDOUT:     %.loc13_31.1: type = splice_block %.loc13_31.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_31: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_31.2: type = value_of_initializer %float.make_type.loc13_31 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_31.3: type = converted %float.make_type.loc13_31, %.loc13_31.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %c: f64 = bind_name c, %c.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param3
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [concrete = constants.%BadReturnType] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc18_37.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc18_21.1: type = splice_block %.loc18_21.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc18_21: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc18_21: init type = call constants.%Float(%int_64.loc18_21) [concrete = f64]
-// CHECK:STDOUT:       %.loc18_21.2: type = value_of_initializer %float.make_type.loc18_21 [concrete = f64]
-// CHECK:STDOUT:       %.loc18_21.3: type = converted %float.make_type.loc18_21, %.loc18_21.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc18_29.1: type = splice_block %.loc18_29.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc18_29: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc18_29: init type = call constants.%Float(%int_64.loc18_29) [concrete = f64]
-// CHECK:STDOUT:       %.loc18_29.2: type = value_of_initializer %float.make_type.loc18_29 [concrete = f64]
-// CHECK:STDOUT:       %.loc18_29.3: type = converted %float.make_type.loc18_29, %.loc18_29.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %JustRight.decl: %JustRight.type = fn_decl @JustRight [concrete = constants.%JustRight] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc19_33: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc19_33: init type = call constants.%Float(%int_64.loc19_33) [concrete = f64]
-// CHECK:STDOUT:     %.loc19_33.1: type = value_of_initializer %float.make_type.loc19_33 [concrete = f64]
-// CHECK:STDOUT:     %.loc19_33.2: type = converted %float.make_type.loc19_33, %.loc19_33.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc19_17.1: type = splice_block %.loc19_17.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc19_17: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc19_17: init type = call constants.%Float(%int_64.loc19_17) [concrete = f64]
-// CHECK:STDOUT:       %.loc19_17.2: type = value_of_initializer %float.make_type.loc19_17 [concrete = f64]
-// CHECK:STDOUT:       %.loc19_17.3: type = converted %float.make_type.loc19_17, %.loc19_17.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc19_25.1: type = splice_block %.loc19_25.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc19_25: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc19_25: init type = call constants.%Float(%int_64.loc19_25) [concrete = f64]
-// CHECK:STDOUT:       %.loc19_25.2: type = value_of_initializer %float.make_type.loc19_25 [concrete = f64]
-// CHECK:STDOUT:       %.loc19_25.3: type = converted %float.make_type.loc19_25, %.loc19_25.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew.decl: %RuntimeCallIsValidTooFew.type = fn_decl @RuntimeCallIsValidTooFew [concrete = constants.%RuntimeCallIsValidTooFew] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc21_40: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc21_40: init type = call constants.%Float(%int_64.loc21_40) [concrete = f64]
-// CHECK:STDOUT:     %.loc21_40.1: type = value_of_initializer %float.make_type.loc21_40 [concrete = f64]
-// CHECK:STDOUT:     %.loc21_40.2: type = converted %float.make_type.loc21_40, %.loc21_40.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc21_32.1: type = splice_block %.loc21_32.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc21_32: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc21_32: init type = call constants.%Float(%int_64.loc21_32) [concrete = f64]
-// CHECK:STDOUT:       %.loc21_32.2: type = value_of_initializer %float.make_type.loc21_32 [concrete = f64]
-// CHECK:STDOUT:       %.loc21_32.3: type = converted %float.make_type.loc21_32, %.loc21_32.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany.decl: %RuntimeCallIsValidTooMany.type = fn_decl @RuntimeCallIsValidTooMany [concrete = constants.%RuntimeCallIsValidTooMany] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %c.patt: %pattern_type.3de = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.param_patt: %pattern_type.3de = value_param_pattern %c.patt, call_param2 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param3 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc25_57: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc25_57: init type = call constants.%Float(%int_64.loc25_57) [concrete = f64]
-// CHECK:STDOUT:     %.loc25_57.1: type = value_of_initializer %float.make_type.loc25_57 [concrete = f64]
-// CHECK:STDOUT:     %.loc25_57.2: type = converted %float.make_type.loc25_57, %.loc25_57.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc25_33.1: type = splice_block %.loc25_33.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_33: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_33: init type = call constants.%Float(%int_64.loc25_33) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_33.2: type = value_of_initializer %float.make_type.loc25_33 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_33.3: type = converted %float.make_type.loc25_33, %.loc25_33.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc25_41.1: type = splice_block %.loc25_41.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_41: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_41: init type = call constants.%Float(%int_64.loc25_41) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_41.2: type = value_of_initializer %float.make_type.loc25_41 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_41.3: type = converted %float.make_type.loc25_41, %.loc25_41.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %c.param: f64 = value_param call_param2
-// CHECK:STDOUT:     %.loc25_49.1: type = splice_block %.loc25_49.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_49: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_49: init type = call constants.%Float(%int_64.loc25_49) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_49.2: type = value_of_initializer %float.make_type.loc25_49 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_49.3: type = converted %float.make_type.loc25_49, %.loc25_49.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %c: f64 = bind_name c, %c.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param3
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType.decl: %RuntimeCallIsValidBadReturnType.type = fn_decl @RuntimeCallIsValidBadReturnType [concrete = constants.%RuntimeCallIsValidBadReturnType] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc29_55.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc29_55.2: type = converted %bool.make_type, %.loc29_55.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc29_39.1: type = splice_block %.loc29_39.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc29_39: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc29_39: init type = call constants.%Float(%int_64.loc29_39) [concrete = f64]
-// CHECK:STDOUT:       %.loc29_39.2: type = value_of_initializer %float.make_type.loc29_39 [concrete = f64]
-// CHECK:STDOUT:       %.loc29_39.3: type = converted %float.make_type.loc29_39, %.loc29_39.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc29_47.1: type = splice_block %.loc29_47.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc29_47: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc29_47: init type = call constants.%Float(%int_64.loc29_47) [concrete = f64]
-// CHECK:STDOUT:       %.loc29_47.2: type = value_of_initializer %float.make_type.loc29_47 [concrete = f64]
-// CHECK:STDOUT:       %.loc29_47.3: type = converted %float.make_type.loc29_47, %.loc29_47.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @TooFew(%a.param: f64) -> f64;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @TooMany(%a.param: f64, %b.param: f64, %c.param: f64) -> f64;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @BadReturnType(%a.param: f64, %b.param: f64) -> bool;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @JustRight(%a.param: f64, %b.param: f64) -> f64 = "float.div";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidTooFew(%a.param: f64) -> f64 {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [concrete = constants.%TooFew]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %TooFew.call: init f64 = call %TooFew.ref(%a.ref)
-// CHECK:STDOUT:   %.loc22_19.1: f64 = value_of_initializer %TooFew.call
-// CHECK:STDOUT:   %.loc22_19.2: f64 = converted %TooFew.call, %.loc22_19.1
-// CHECK:STDOUT:   return %.loc22_19.2
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param: f64, %b.param: f64, %c.param: f64) -> f64 {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [concrete = constants.%TooMany]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
-// CHECK:STDOUT:   %c.ref: f64 = name_ref c, %c
-// CHECK:STDOUT:   %TooMany.call: init f64 = call %TooMany.ref(%a.ref, %b.ref, %c.ref)
-// CHECK:STDOUT:   %.loc26_26.1: f64 = value_of_initializer %TooMany.call
-// CHECK:STDOUT:   %.loc26_26.2: f64 = converted %TooMany.call, %.loc26_26.1
-// CHECK:STDOUT:   return %.loc26_26.2
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param: f64, %b.param: f64) -> bool {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [concrete = constants.%BadReturnType]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
-// CHECK:STDOUT:   %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc30_29.1: bool = value_of_initializer %BadReturnType.call
-// CHECK:STDOUT:   %.loc30_29.2: bool = converted %BadReturnType.call, %.loc30_29.1
-// CHECK:STDOUT:   return %.loc30_29.2
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 8 - 244
toolchain/check/testdata/builtins/float/eq.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/eq.carbon
@@ -21,12 +23,14 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
+  //@dump-sem-ir-begin
   return Eq(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_bad_decl.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
 // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.eq" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn WrongResult(a: f64, b: f64) -> f64 = "float.eq";
@@ -37,190 +41,11 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq";
 // CHECK:STDOUT: --- float_eq.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
 // CHECK:STDOUT:   %Eq.type: type = fn_type @Eq [concrete]
 // CHECK:STDOUT:   %Eq: %Eq.type = struct_value () [concrete]
-// CHECK:STDOUT:   %True: type = class_type @True [concrete]
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
-// CHECK:STDOUT:   %False: type = class_type @False [concrete]
-// CHECK:STDOUT:   %pattern_type.efb: type = pattern_type %True [concrete]
-// CHECK:STDOUT:   %pattern_type.4cc: type = pattern_type %False [concrete]
-// CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
-// CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float.f4e: f64 = float_literal 1 [concrete]
-// CHECK:STDOUT:   %true: bool = bool_literal true [concrete]
-// CHECK:STDOUT:   %float.be3: f64 = float_literal 2 [concrete]
-// CHECK:STDOUT:   %false: bool = bool_literal false [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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:     .RuntimeCallIsValid = %RuntimeCallIsValid.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Eq.decl: %Eq.type = fn_decl @Eq [concrete = constants.%Eq] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc2_26.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc2_26.2: type = converted %bool.make_type, %.loc2_26.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc2_10.1: type = splice_block %.loc2_10.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_10: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_10: init type = call constants.%Float(%int_64.loc2_10) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_10.2: type = value_of_initializer %float.make_type.loc2_10 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_10.3: type = converted %float.make_type.loc2_10, %.loc2_10.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc2_18.1: type = splice_block %.loc2_18.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_18: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_18: init type = call constants.%Float(%int_64.loc2_18) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_18.2: type = value_of_initializer %float.make_type.loc2_18 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_18.3: type = converted %float.make_type.loc2_18, %.loc2_18.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %True.decl: type = class_decl @True [concrete = constants.%True] {} {}
-// CHECK:STDOUT:   %False.decl: type = class_decl @False [concrete = constants.%False] {} {}
-// CHECK:STDOUT:   %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
-// CHECK:STDOUT:     %true_.patt: %pattern_type.efb = binding_pattern true_ [concrete]
-// CHECK:STDOUT:     %true_.param_patt: %pattern_type.efb = value_param_pattern %true_.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %false_.patt: %pattern_type.4cc = binding_pattern false_ [concrete]
-// CHECK:STDOUT:     %false_.param_patt: %pattern_type.4cc = value_param_pattern %false_.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %true_.param: %True = value_param call_param0
-// CHECK:STDOUT:     %True.ref.loc7: type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:     %true_: %True = bind_name true_, %true_.param
-// CHECK:STDOUT:     %false_.param: %False = value_param call_param1
-// CHECK:STDOUT:     %False.ref.loc7: type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:     %false_: %False = bind_name false_, %false_.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [concrete = constants.%RuntimeCallIsValid] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc12_42.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc12_42.2: type = converted %bool.make_type, %.loc12_42.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc12_26.1: type = splice_block %.loc12_26.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc12_26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc12_26: init type = call constants.%Float(%int_64.loc12_26) [concrete = f64]
-// CHECK:STDOUT:       %.loc12_26.2: type = value_of_initializer %float.make_type.loc12_26 [concrete = f64]
-// CHECK:STDOUT:       %.loc12_26.3: type = converted %float.make_type.loc12_26, %.loc12_26.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc12_34.1: type = splice_block %.loc12_34.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc12_34: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc12_34: init type = call constants.%Float(%int_64.loc12_34) [concrete = f64]
-// CHECK:STDOUT:       %.loc12_34.2: type = value_of_initializer %float.make_type.loc12_34 [concrete = f64]
-// CHECK:STDOUT:       %.loc12_34.3: type = converted %float.make_type.loc12_34, %.loc12_34.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @True {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%True
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @False {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%False
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Eq(%a.param: f64, %b.param: f64) -> bool = "float.eq";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @F(%true_.param: %True, %false_.param: %False) {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %true_.ref: %True = name_ref true_, %true_
-// CHECK:STDOUT:   %Eq.ref.loc8: %Eq.type = name_ref Eq, file.%Eq.decl [concrete = constants.%Eq]
-// CHECK:STDOUT:   %float.loc8_19: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc8_24: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.eq.loc8: init bool = call %Eq.ref.loc8(%float.loc8_19, %float.loc8_24) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc8_13.1: bool = value_of_initializer %float.eq.loc8 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc8_13.2: bool = converted %float.eq.loc8, %.loc8_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%True]
-// CHECK:STDOUT:   %false_.ref: %False = name_ref false_, %false_
-// CHECK:STDOUT:   %Eq.ref.loc9: %Eq.type = name_ref Eq, file.%Eq.decl [concrete = constants.%Eq]
-// CHECK:STDOUT:   %float.loc9_20: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc9_25: f64 = float_literal 2 [concrete = constants.%float.be3]
-// CHECK:STDOUT:   %float.eq.loc9: init bool = call %Eq.ref.loc9(%float.loc9_20, %float.loc9_25) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc9_14.1: bool = value_of_initializer %float.eq.loc9 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc9_14.2: bool = converted %float.eq.loc9, %.loc9_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%False]
-// CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: f64, %b.param: f64) -> bool {
@@ -229,69 +54,8 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.eq";
 // CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
 // CHECK:STDOUT:   %float.eq: init bool = call %Eq.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc13_18.1: bool = value_of_initializer %float.eq
-// CHECK:STDOUT:   %.loc13_18.2: bool = converted %float.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_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %WrongResult.type: type = fn_type @WrongResult [concrete]
-// CHECK:STDOUT:   %WrongResult: %WrongResult.type = struct_value () [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
+// CHECK:STDOUT:   %.loc14_18.1: bool = value_of_initializer %float.eq
+// CHECK:STDOUT:   %.loc14_18.2: bool = converted %float.eq, %.loc14_18.1
+// CHECK:STDOUT:   return %.loc14_18.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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 [concrete = constants.%WrongResult] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc8_35: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc8_35: init type = call constants.%Float(%int_64.loc8_35) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_35.1: type = value_of_initializer %float.make_type.loc8_35 [concrete = f64]
-// CHECK:STDOUT:     %.loc8_35.2: type = converted %float.make_type.loc8_35, %.loc8_35.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc8_19.1: type = splice_block %.loc8_19.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc8_19: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc8_19: init type = call constants.%Float(%int_64.loc8_19) [concrete = f64]
-// CHECK:STDOUT:       %.loc8_19.2: type = value_of_initializer %float.make_type.loc8_19 [concrete = f64]
-// CHECK:STDOUT:       %.loc8_19.3: type = converted %float.make_type.loc8_19, %.loc8_19.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc8_27.1: type = splice_block %.loc8_27.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc8_27: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc8_27: init type = call constants.%Float(%int_64.loc8_27) [concrete = f64]
-// CHECK:STDOUT:       %.loc8_27.2: type = value_of_initializer %float.make_type.loc8_27 [concrete = f64]
-// CHECK:STDOUT:       %.loc8_27.3: type = converted %float.make_type.loc8_27, %.loc8_27.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @WrongResult(%a.param: f64, %b.param: f64) -> f64;
-// CHECK:STDOUT:

+ 7 - 275
toolchain/check/testdata/builtins/float/greater.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/greater.carbon
@@ -25,289 +27,19 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
+  //@dump-sem-ir-begin
   return Greater(a, b);
+  //@dump-sem-ir-end
 }
 
 // CHECK:STDOUT: --- float_greater.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
 // CHECK:STDOUT:   %Greater.type: type = fn_type @Greater [concrete]
 // CHECK:STDOUT:   %Greater: %Greater.type = struct_value () [concrete]
-// CHECK:STDOUT:   %Negate.type: type = fn_type @Negate [concrete]
-// CHECK:STDOUT:   %Negate: %Negate.type = struct_value () [concrete]
-// CHECK:STDOUT:   %True: type = class_type @True [concrete]
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
-// CHECK:STDOUT:   %False: type = class_type @False [concrete]
-// CHECK:STDOUT:   %pattern_type.efb: type = pattern_type %True [concrete]
-// CHECK:STDOUT:   %pattern_type.4cc: type = pattern_type %False [concrete]
-// CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
-// CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float.f4e: f64 = float_literal 1 [concrete]
-// CHECK:STDOUT:   %float.be3: f64 = float_literal 2 [concrete]
-// CHECK:STDOUT:   %false: bool = bool_literal false [concrete]
-// CHECK:STDOUT:   %float.555: f64 = float_literal 0 [concrete]
-// CHECK:STDOUT:   %true: bool = bool_literal true [concrete]
-// CHECK:STDOUT:   %float.f51: f64 = float_literal -1 [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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:     .RuntimeCallIsValid = %RuntimeCallIsValid.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Greater.decl: %Greater.type = fn_decl @Greater [concrete = constants.%Greater] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc2_31.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc2_31.2: type = converted %bool.make_type, %.loc2_31.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc2_15.1: type = splice_block %.loc2_15.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_15: init type = call constants.%Float(%int_64.loc2_15) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_15.2: type = value_of_initializer %float.make_type.loc2_15 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_15.3: type = converted %float.make_type.loc2_15, %.loc2_15.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc2_23.1: type = splice_block %.loc2_23.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_23: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_23: init type = call constants.%Float(%int_64.loc2_23) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_23.2: type = value_of_initializer %float.make_type.loc2_23 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_23.3: type = converted %float.make_type.loc2_23, %.loc2_23.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Negate.decl: %Negate.type = fn_decl @Negate [concrete = constants.%Negate] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc3_22: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc3_22: init type = call constants.%Float(%int_64.loc3_22) [concrete = f64]
-// CHECK:STDOUT:     %.loc3_22.1: type = value_of_initializer %float.make_type.loc3_22 [concrete = f64]
-// CHECK:STDOUT:     %.loc3_22.2: type = converted %float.make_type.loc3_22, %.loc3_22.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc3_14.1: type = splice_block %.loc3_14.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc3_14: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [concrete = f64]
-// CHECK:STDOUT:       %.loc3_14.2: type = value_of_initializer %float.make_type.loc3_14 [concrete = f64]
-// CHECK:STDOUT:       %.loc3_14.3: type = converted %float.make_type.loc3_14, %.loc3_14.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %True.decl: type = class_decl @True [concrete = constants.%True] {} {}
-// CHECK:STDOUT:   %False.decl: type = class_decl @False [concrete = constants.%False] {} {}
-// CHECK:STDOUT:   %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
-// CHECK:STDOUT:     %true_.patt: %pattern_type.efb = binding_pattern true_ [concrete]
-// CHECK:STDOUT:     %true_.param_patt: %pattern_type.efb = value_param_pattern %true_.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %false_.patt: %pattern_type.4cc = binding_pattern false_ [concrete]
-// CHECK:STDOUT:     %false_.param_patt: %pattern_type.4cc = value_param_pattern %false_.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %true_.param: %True = value_param call_param0
-// CHECK:STDOUT:     %True.ref.loc8: type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:     %true_: %True = bind_name true_, %true_.param
-// CHECK:STDOUT:     %false_.param: %False = value_param call_param1
-// CHECK:STDOUT:     %False.ref.loc8: type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:     %false_: %False = bind_name false_, %false_.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [concrete = constants.%RuntimeCallIsValid] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc16_42.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc16_42.2: type = converted %bool.make_type, %.loc16_42.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc16_26.1: type = splice_block %.loc16_26.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc16_26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc16_26: init type = call constants.%Float(%int_64.loc16_26) [concrete = f64]
-// CHECK:STDOUT:       %.loc16_26.2: type = value_of_initializer %float.make_type.loc16_26 [concrete = f64]
-// CHECK:STDOUT:       %.loc16_26.3: type = converted %float.make_type.loc16_26, %.loc16_26.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc16_34.1: type = splice_block %.loc16_34.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc16_34: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc16_34: init type = call constants.%Float(%int_64.loc16_34) [concrete = f64]
-// CHECK:STDOUT:       %.loc16_34.2: type = value_of_initializer %float.make_type.loc16_34 [concrete = f64]
-// CHECK:STDOUT:       %.loc16_34.3: type = converted %float.make_type.loc16_34, %.loc16_34.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @True {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%True
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @False {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%False
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Greater(%a.param: f64, %b.param: f64) -> bool = "float.greater";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Negate(%a.param: f64) -> f64 = "float.negate";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @F(%true_.param: %True, %false_.param: %False) {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %false_.ref.loc9: %False = name_ref false_, %false_
-// CHECK:STDOUT:   %Greater.ref.loc9: %Greater.type = name_ref Greater, file.%Greater.decl [concrete = constants.%Greater]
-// CHECK:STDOUT:   %float.loc9_25: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc9_30: f64 = float_literal 2 [concrete = constants.%float.be3]
-// CHECK:STDOUT:   %float.greater.loc9: init bool = call %Greater.ref.loc9(%float.loc9_25, %float.loc9_30) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc9_14.1: bool = value_of_initializer %float.greater.loc9 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc9_14.2: bool = converted %float.greater.loc9, %.loc9_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%False]
-// CHECK:STDOUT:   %false_.ref.loc10: %False = name_ref false_, %false_
-// CHECK:STDOUT:   %Greater.ref.loc10: %Greater.type = name_ref Greater, file.%Greater.decl [concrete = constants.%Greater]
-// CHECK:STDOUT:   %float.loc10_25: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc10_30: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.greater.loc10: init bool = call %Greater.ref.loc10(%float.loc10_25, %float.loc10_30) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc10_14.1: bool = value_of_initializer %float.greater.loc10 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc10_14.2: bool = converted %float.greater.loc10, %.loc10_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%False]
-// CHECK:STDOUT:   %true_.ref.loc11: %True = name_ref true_, %true_
-// CHECK:STDOUT:   %Greater.ref.loc11: %Greater.type = name_ref Greater, file.%Greater.decl [concrete = constants.%Greater]
-// CHECK:STDOUT:   %float.loc11_24: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc11_29: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %float.greater.loc11: init bool = call %Greater.ref.loc11(%float.loc11_24, %float.loc11_29) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc11_13.1: bool = value_of_initializer %float.greater.loc11 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc11_13.2: bool = converted %float.greater.loc11, %.loc11_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%True]
-// CHECK:STDOUT:   %false_.ref.loc12: %False = name_ref false_, %false_
-// CHECK:STDOUT:   %Greater.ref.loc12: %Greater.type = name_ref Greater, file.%Greater.decl [concrete = constants.%Greater]
-// CHECK:STDOUT:   %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
-// CHECK:STDOUT:   %float.loc12_32: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.negate.loc12: init f64 = call %Negate.ref.loc12(%float.loc12_32) [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.loc12_38: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %.loc12_35.1: f64 = value_of_initializer %float.negate.loc12 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc12_35.2: f64 = converted %float.negate.loc12, %.loc12_35.1 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.greater.loc12: init bool = call %Greater.ref.loc12(%.loc12_35.2, %float.loc12_38) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc12_14.1: bool = value_of_initializer %float.greater.loc12 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc12_14.2: bool = converted %float.greater.loc12, %.loc12_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%False]
-// CHECK:STDOUT:   %true_.ref.loc13: %True = name_ref true_, %true_
-// CHECK:STDOUT:   %Greater.ref.loc13: %Greater.type = name_ref Greater, file.%Greater.decl [concrete = constants.%Greater]
-// CHECK:STDOUT:   %float.loc13_24: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
-// CHECK:STDOUT:   %float.loc13_36: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.negate.loc13: init f64 = call %Negate.ref.loc13(%float.loc13_36) [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc13_39.1: f64 = value_of_initializer %float.negate.loc13 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc13_39.2: f64 = converted %float.negate.loc13, %.loc13_39.1 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.greater.loc13: init bool = call %Greater.ref.loc13(%float.loc13_24, %.loc13_39.2) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc13_13.1: bool = value_of_initializer %float.greater.loc13 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc13_13.2: bool = converted %float.greater.loc13, %.loc13_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%True]
-// CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: f64, %b.param: f64) -> bool {
@@ -316,8 +48,8 @@ fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
 // CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
 // CHECK:STDOUT:   %float.greater: init bool = call %Greater.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc17_23.1: bool = value_of_initializer %float.greater
-// CHECK:STDOUT:   %.loc17_23.2: bool = converted %float.greater, %.loc17_23.1
-// CHECK:STDOUT:   return %.loc17_23.2
+// CHECK:STDOUT:   %.loc18_23.1: bool = value_of_initializer %float.greater
+// CHECK:STDOUT:   %.loc18_23.2: bool = converted %float.greater, %.loc18_23.1
+// CHECK:STDOUT:   return %.loc18_23.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 7 - 275
toolchain/check/testdata/builtins/float/greater_eq.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/greater_eq.carbon
@@ -25,289 +27,19 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
+  //@dump-sem-ir-begin
   return GreaterEq(a, b);
+  //@dump-sem-ir-end
 }
 
 // CHECK:STDOUT: --- float_greater_eq.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
 // CHECK:STDOUT:   %GreaterEq.type: type = fn_type @GreaterEq [concrete]
 // CHECK:STDOUT:   %GreaterEq: %GreaterEq.type = struct_value () [concrete]
-// CHECK:STDOUT:   %Negate.type: type = fn_type @Negate [concrete]
-// CHECK:STDOUT:   %Negate: %Negate.type = struct_value () [concrete]
-// CHECK:STDOUT:   %True: type = class_type @True [concrete]
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
-// CHECK:STDOUT:   %False: type = class_type @False [concrete]
-// CHECK:STDOUT:   %pattern_type.efb: type = pattern_type %True [concrete]
-// CHECK:STDOUT:   %pattern_type.4cc: type = pattern_type %False [concrete]
-// CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
-// CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float.f4e: f64 = float_literal 1 [concrete]
-// CHECK:STDOUT:   %float.be3: f64 = float_literal 2 [concrete]
-// CHECK:STDOUT:   %false: bool = bool_literal false [concrete]
-// CHECK:STDOUT:   %true: bool = bool_literal true [concrete]
-// CHECK:STDOUT:   %float.555: f64 = float_literal 0 [concrete]
-// CHECK:STDOUT:   %float.f51: f64 = float_literal -1 [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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:     .RuntimeCallIsValid = %RuntimeCallIsValid.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %GreaterEq.decl: %GreaterEq.type = fn_decl @GreaterEq [concrete = constants.%GreaterEq] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc2_33.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc2_33.2: type = converted %bool.make_type, %.loc2_33.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc2_17.1: type = splice_block %.loc2_17.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_17: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_17: init type = call constants.%Float(%int_64.loc2_17) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_17.2: type = value_of_initializer %float.make_type.loc2_17 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_17.3: type = converted %float.make_type.loc2_17, %.loc2_17.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc2_25.1: type = splice_block %.loc2_25.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_25: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_25: init type = call constants.%Float(%int_64.loc2_25) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_25.2: type = value_of_initializer %float.make_type.loc2_25 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_25.3: type = converted %float.make_type.loc2_25, %.loc2_25.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Negate.decl: %Negate.type = fn_decl @Negate [concrete = constants.%Negate] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc3_22: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc3_22: init type = call constants.%Float(%int_64.loc3_22) [concrete = f64]
-// CHECK:STDOUT:     %.loc3_22.1: type = value_of_initializer %float.make_type.loc3_22 [concrete = f64]
-// CHECK:STDOUT:     %.loc3_22.2: type = converted %float.make_type.loc3_22, %.loc3_22.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc3_14.1: type = splice_block %.loc3_14.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc3_14: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [concrete = f64]
-// CHECK:STDOUT:       %.loc3_14.2: type = value_of_initializer %float.make_type.loc3_14 [concrete = f64]
-// CHECK:STDOUT:       %.loc3_14.3: type = converted %float.make_type.loc3_14, %.loc3_14.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %True.decl: type = class_decl @True [concrete = constants.%True] {} {}
-// CHECK:STDOUT:   %False.decl: type = class_decl @False [concrete = constants.%False] {} {}
-// CHECK:STDOUT:   %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
-// CHECK:STDOUT:     %true_.patt: %pattern_type.efb = binding_pattern true_ [concrete]
-// CHECK:STDOUT:     %true_.param_patt: %pattern_type.efb = value_param_pattern %true_.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %false_.patt: %pattern_type.4cc = binding_pattern false_ [concrete]
-// CHECK:STDOUT:     %false_.param_patt: %pattern_type.4cc = value_param_pattern %false_.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %true_.param: %True = value_param call_param0
-// CHECK:STDOUT:     %True.ref.loc8: type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:     %true_: %True = bind_name true_, %true_.param
-// CHECK:STDOUT:     %false_.param: %False = value_param call_param1
-// CHECK:STDOUT:     %False.ref.loc8: type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:     %false_: %False = bind_name false_, %false_.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [concrete = constants.%RuntimeCallIsValid] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc16_42.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc16_42.2: type = converted %bool.make_type, %.loc16_42.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc16_26.1: type = splice_block %.loc16_26.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc16_26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc16_26: init type = call constants.%Float(%int_64.loc16_26) [concrete = f64]
-// CHECK:STDOUT:       %.loc16_26.2: type = value_of_initializer %float.make_type.loc16_26 [concrete = f64]
-// CHECK:STDOUT:       %.loc16_26.3: type = converted %float.make_type.loc16_26, %.loc16_26.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc16_34.1: type = splice_block %.loc16_34.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc16_34: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc16_34: init type = call constants.%Float(%int_64.loc16_34) [concrete = f64]
-// CHECK:STDOUT:       %.loc16_34.2: type = value_of_initializer %float.make_type.loc16_34 [concrete = f64]
-// CHECK:STDOUT:       %.loc16_34.3: type = converted %float.make_type.loc16_34, %.loc16_34.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @True {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%True
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @False {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%False
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @GreaterEq(%a.param: f64, %b.param: f64) -> bool = "float.greater_eq";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Negate(%a.param: f64) -> f64 = "float.negate";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @F(%true_.param: %True, %false_.param: %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 [concrete = constants.%GreaterEq]
-// CHECK:STDOUT:   %float.loc9_27: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc9_32: f64 = float_literal 2 [concrete = constants.%float.be3]
-// CHECK:STDOUT:   %float.greater_eq.loc9: init bool = call %GreaterEq.ref.loc9(%float.loc9_27, %float.loc9_32) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc9_14.1: bool = value_of_initializer %float.greater_eq.loc9 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc9_14.2: bool = converted %float.greater_eq.loc9, %.loc9_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%GreaterEq]
-// CHECK:STDOUT:   %float.loc10_26: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc10_31: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.greater_eq.loc10: init bool = call %GreaterEq.ref.loc10(%float.loc10_26, %float.loc10_31) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc10_13.1: bool = value_of_initializer %float.greater_eq.loc10 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc10_13.2: bool = converted %float.greater_eq.loc10, %.loc10_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%GreaterEq]
-// CHECK:STDOUT:   %float.loc11_26: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc11_31: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %float.greater_eq.loc11: init bool = call %GreaterEq.ref.loc11(%float.loc11_26, %float.loc11_31) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc11_13.1: bool = value_of_initializer %float.greater_eq.loc11 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc11_13.2: bool = converted %float.greater_eq.loc11, %.loc11_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%GreaterEq]
-// CHECK:STDOUT:   %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
-// CHECK:STDOUT:   %float.loc12_34: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.negate.loc12: init f64 = call %Negate.ref.loc12(%float.loc12_34) [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.loc12_40: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %.loc12_37.1: f64 = value_of_initializer %float.negate.loc12 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc12_37.2: f64 = converted %float.negate.loc12, %.loc12_37.1 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.greater_eq.loc12: init bool = call %GreaterEq.ref.loc12(%.loc12_37.2, %float.loc12_40) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc12_14.1: bool = value_of_initializer %float.greater_eq.loc12 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc12_14.2: bool = converted %float.greater_eq.loc12, %.loc12_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%GreaterEq]
-// CHECK:STDOUT:   %float.loc13_26: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
-// CHECK:STDOUT:   %float.loc13_38: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.negate.loc13: init f64 = call %Negate.ref.loc13(%float.loc13_38) [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc13_41.1: f64 = value_of_initializer %float.negate.loc13 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc13_41.2: f64 = converted %float.negate.loc13, %.loc13_41.1 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.greater_eq.loc13: init bool = call %GreaterEq.ref.loc13(%float.loc13_26, %.loc13_41.2) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc13_13.1: bool = value_of_initializer %float.greater_eq.loc13 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc13_13.2: bool = converted %float.greater_eq.loc13, %.loc13_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%True]
-// CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: f64, %b.param: f64) -> bool {
@@ -316,8 +48,8 @@ fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
 // CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
 // CHECK:STDOUT:   %float.greater_eq: init bool = call %GreaterEq.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc17_25.1: bool = value_of_initializer %float.greater_eq
-// CHECK:STDOUT:   %.loc17_25.2: bool = converted %float.greater_eq, %.loc17_25.1
-// CHECK:STDOUT:   return %.loc17_25.2
+// CHECK:STDOUT:   %.loc18_25.1: bool = value_of_initializer %float.greater_eq
+// CHECK:STDOUT:   %.loc18_25.2: bool = converted %float.greater_eq, %.loc18_25.1
+// CHECK:STDOUT:   return %.loc18_25.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 7 - 275
toolchain/check/testdata/builtins/float/less.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/less.carbon
@@ -25,289 +27,19 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
+  //@dump-sem-ir-begin
   return Less(a, b);
+  //@dump-sem-ir-end
 }
 
 // CHECK:STDOUT: --- float_less.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
 // CHECK:STDOUT:   %Less.type: type = fn_type @Less [concrete]
 // CHECK:STDOUT:   %Less: %Less.type = struct_value () [concrete]
-// CHECK:STDOUT:   %Negate.type: type = fn_type @Negate [concrete]
-// CHECK:STDOUT:   %Negate: %Negate.type = struct_value () [concrete]
-// CHECK:STDOUT:   %True: type = class_type @True [concrete]
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
-// CHECK:STDOUT:   %False: type = class_type @False [concrete]
-// CHECK:STDOUT:   %pattern_type.efb: type = pattern_type %True [concrete]
-// CHECK:STDOUT:   %pattern_type.4cc: type = pattern_type %False [concrete]
-// CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
-// CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float.f4e: f64 = float_literal 1 [concrete]
-// CHECK:STDOUT:   %float.be3: f64 = float_literal 2 [concrete]
-// CHECK:STDOUT:   %true: bool = bool_literal true [concrete]
-// CHECK:STDOUT:   %false: bool = bool_literal false [concrete]
-// CHECK:STDOUT:   %float.555: f64 = float_literal 0 [concrete]
-// CHECK:STDOUT:   %float.f51: f64 = float_literal -1 [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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:     .RuntimeCallIsValid = %RuntimeCallIsValid.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Less.decl: %Less.type = fn_decl @Less [concrete = constants.%Less] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc2_28.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc2_28.2: type = converted %bool.make_type, %.loc2_28.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc2_12.1: type = splice_block %.loc2_12.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_12: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_12: init type = call constants.%Float(%int_64.loc2_12) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_12.2: type = value_of_initializer %float.make_type.loc2_12 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_12.3: type = converted %float.make_type.loc2_12, %.loc2_12.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc2_20.1: type = splice_block %.loc2_20.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_20: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_20: init type = call constants.%Float(%int_64.loc2_20) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_20.2: type = value_of_initializer %float.make_type.loc2_20 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_20.3: type = converted %float.make_type.loc2_20, %.loc2_20.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Negate.decl: %Negate.type = fn_decl @Negate [concrete = constants.%Negate] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc3_22: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc3_22: init type = call constants.%Float(%int_64.loc3_22) [concrete = f64]
-// CHECK:STDOUT:     %.loc3_22.1: type = value_of_initializer %float.make_type.loc3_22 [concrete = f64]
-// CHECK:STDOUT:     %.loc3_22.2: type = converted %float.make_type.loc3_22, %.loc3_22.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc3_14.1: type = splice_block %.loc3_14.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc3_14: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [concrete = f64]
-// CHECK:STDOUT:       %.loc3_14.2: type = value_of_initializer %float.make_type.loc3_14 [concrete = f64]
-// CHECK:STDOUT:       %.loc3_14.3: type = converted %float.make_type.loc3_14, %.loc3_14.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %True.decl: type = class_decl @True [concrete = constants.%True] {} {}
-// CHECK:STDOUT:   %False.decl: type = class_decl @False [concrete = constants.%False] {} {}
-// CHECK:STDOUT:   %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
-// CHECK:STDOUT:     %true_.patt: %pattern_type.efb = binding_pattern true_ [concrete]
-// CHECK:STDOUT:     %true_.param_patt: %pattern_type.efb = value_param_pattern %true_.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %false_.patt: %pattern_type.4cc = binding_pattern false_ [concrete]
-// CHECK:STDOUT:     %false_.param_patt: %pattern_type.4cc = value_param_pattern %false_.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %true_.param: %True = value_param call_param0
-// CHECK:STDOUT:     %True.ref.loc8: type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:     %true_: %True = bind_name true_, %true_.param
-// CHECK:STDOUT:     %false_.param: %False = value_param call_param1
-// CHECK:STDOUT:     %False.ref.loc8: type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:     %false_: %False = bind_name false_, %false_.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [concrete = constants.%RuntimeCallIsValid] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc16_42.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc16_42.2: type = converted %bool.make_type, %.loc16_42.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc16_26.1: type = splice_block %.loc16_26.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc16_26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc16_26: init type = call constants.%Float(%int_64.loc16_26) [concrete = f64]
-// CHECK:STDOUT:       %.loc16_26.2: type = value_of_initializer %float.make_type.loc16_26 [concrete = f64]
-// CHECK:STDOUT:       %.loc16_26.3: type = converted %float.make_type.loc16_26, %.loc16_26.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc16_34.1: type = splice_block %.loc16_34.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc16_34: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc16_34: init type = call constants.%Float(%int_64.loc16_34) [concrete = f64]
-// CHECK:STDOUT:       %.loc16_34.2: type = value_of_initializer %float.make_type.loc16_34 [concrete = f64]
-// CHECK:STDOUT:       %.loc16_34.3: type = converted %float.make_type.loc16_34, %.loc16_34.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @True {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%True
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @False {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%False
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Less(%a.param: f64, %b.param: f64) -> bool = "float.less";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Negate(%a.param: f64) -> f64 = "float.negate";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @F(%true_.param: %True, %false_.param: %False) {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %true_.ref.loc9: %True = name_ref true_, %true_
-// CHECK:STDOUT:   %Less.ref.loc9: %Less.type = name_ref Less, file.%Less.decl [concrete = constants.%Less]
-// CHECK:STDOUT:   %float.loc9_21: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc9_26: f64 = float_literal 2 [concrete = constants.%float.be3]
-// CHECK:STDOUT:   %float.less.loc9: init bool = call %Less.ref.loc9(%float.loc9_21, %float.loc9_26) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc9_13.1: bool = value_of_initializer %float.less.loc9 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc9_13.2: bool = converted %float.less.loc9, %.loc9_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%True]
-// CHECK:STDOUT:   %false_.ref.loc10: %False = name_ref false_, %false_
-// CHECK:STDOUT:   %Less.ref.loc10: %Less.type = name_ref Less, file.%Less.decl [concrete = constants.%Less]
-// CHECK:STDOUT:   %float.loc10_22: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc10_27: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.less.loc10: init bool = call %Less.ref.loc10(%float.loc10_22, %float.loc10_27) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc10_14.1: bool = value_of_initializer %float.less.loc10 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc10_14.2: bool = converted %float.less.loc10, %.loc10_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%False]
-// CHECK:STDOUT:   %false_.ref.loc11: %False = name_ref false_, %false_
-// CHECK:STDOUT:   %Less.ref.loc11: %Less.type = name_ref Less, file.%Less.decl [concrete = constants.%Less]
-// CHECK:STDOUT:   %float.loc11_22: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc11_27: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %float.less.loc11: init bool = call %Less.ref.loc11(%float.loc11_22, %float.loc11_27) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc11_14.1: bool = value_of_initializer %float.less.loc11 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc11_14.2: bool = converted %float.less.loc11, %.loc11_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%False]
-// CHECK:STDOUT:   %true_.ref.loc12: %True = name_ref true_, %true_
-// CHECK:STDOUT:   %Less.ref.loc12: %Less.type = name_ref Less, file.%Less.decl [concrete = constants.%Less]
-// CHECK:STDOUT:   %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
-// CHECK:STDOUT:   %float.loc12_28: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.negate.loc12: init f64 = call %Negate.ref.loc12(%float.loc12_28) [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.loc12_34: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %.loc12_31.1: f64 = value_of_initializer %float.negate.loc12 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc12_31.2: f64 = converted %float.negate.loc12, %.loc12_31.1 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.less.loc12: init bool = call %Less.ref.loc12(%.loc12_31.2, %float.loc12_34) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc12_13.1: bool = value_of_initializer %float.less.loc12 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc12_13.2: bool = converted %float.less.loc12, %.loc12_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%True]
-// CHECK:STDOUT:   %false_.ref.loc13: %False = name_ref false_, %false_
-// CHECK:STDOUT:   %Less.ref.loc13: %Less.type = name_ref Less, file.%Less.decl [concrete = constants.%Less]
-// CHECK:STDOUT:   %float.loc13_22: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
-// CHECK:STDOUT:   %float.loc13_34: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.negate.loc13: init f64 = call %Negate.ref.loc13(%float.loc13_34) [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc13_37.1: f64 = value_of_initializer %float.negate.loc13 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc13_37.2: f64 = converted %float.negate.loc13, %.loc13_37.1 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.less.loc13: init bool = call %Less.ref.loc13(%float.loc13_22, %.loc13_37.2) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc13_14.1: bool = value_of_initializer %float.less.loc13 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc13_14.2: bool = converted %float.less.loc13, %.loc13_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%False]
-// CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: f64, %b.param: f64) -> bool {
@@ -316,8 +48,8 @@ fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
 // CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
 // CHECK:STDOUT:   %float.less: init bool = call %Less.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc17_20.1: bool = value_of_initializer %float.less
-// CHECK:STDOUT:   %.loc17_20.2: bool = converted %float.less, %.loc17_20.1
-// CHECK:STDOUT:   return %.loc17_20.2
+// CHECK:STDOUT:   %.loc18_20.1: bool = value_of_initializer %float.less
+// CHECK:STDOUT:   %.loc18_20.2: bool = converted %float.less, %.loc18_20.1
+// CHECK:STDOUT:   return %.loc18_20.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 7 - 275
toolchain/check/testdata/builtins/float/less_eq.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/less_eq.carbon
@@ -25,289 +27,19 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
+  //@dump-sem-ir-begin
   return LessEq(a, b);
+  //@dump-sem-ir-end
 }
 
 // CHECK:STDOUT: --- float_less_eq.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
 // CHECK:STDOUT:   %LessEq.type: type = fn_type @LessEq [concrete]
 // CHECK:STDOUT:   %LessEq: %LessEq.type = struct_value () [concrete]
-// CHECK:STDOUT:   %Negate.type: type = fn_type @Negate [concrete]
-// CHECK:STDOUT:   %Negate: %Negate.type = struct_value () [concrete]
-// CHECK:STDOUT:   %True: type = class_type @True [concrete]
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
-// CHECK:STDOUT:   %False: type = class_type @False [concrete]
-// CHECK:STDOUT:   %pattern_type.efb: type = pattern_type %True [concrete]
-// CHECK:STDOUT:   %pattern_type.4cc: type = pattern_type %False [concrete]
-// CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
-// CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float.f4e: f64 = float_literal 1 [concrete]
-// CHECK:STDOUT:   %float.be3: f64 = float_literal 2 [concrete]
-// CHECK:STDOUT:   %true: bool = bool_literal true [concrete]
-// CHECK:STDOUT:   %float.555: f64 = float_literal 0 [concrete]
-// CHECK:STDOUT:   %false: bool = bool_literal false [concrete]
-// CHECK:STDOUT:   %float.f51: f64 = float_literal -1 [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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:     .RuntimeCallIsValid = %RuntimeCallIsValid.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %LessEq.decl: %LessEq.type = fn_decl @LessEq [concrete = constants.%LessEq] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc2_30.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc2_30.2: type = converted %bool.make_type, %.loc2_30.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc2_14.1: type = splice_block %.loc2_14.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_14: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_14: init type = call constants.%Float(%int_64.loc2_14) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_14.2: type = value_of_initializer %float.make_type.loc2_14 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_14.3: type = converted %float.make_type.loc2_14, %.loc2_14.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc2_22.1: type = splice_block %.loc2_22.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_22: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_22: init type = call constants.%Float(%int_64.loc2_22) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_22.2: type = value_of_initializer %float.make_type.loc2_22 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_22.3: type = converted %float.make_type.loc2_22, %.loc2_22.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Negate.decl: %Negate.type = fn_decl @Negate [concrete = constants.%Negate] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc3_22: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc3_22: init type = call constants.%Float(%int_64.loc3_22) [concrete = f64]
-// CHECK:STDOUT:     %.loc3_22.1: type = value_of_initializer %float.make_type.loc3_22 [concrete = f64]
-// CHECK:STDOUT:     %.loc3_22.2: type = converted %float.make_type.loc3_22, %.loc3_22.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc3_14.1: type = splice_block %.loc3_14.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc3_14: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc3_14: init type = call constants.%Float(%int_64.loc3_14) [concrete = f64]
-// CHECK:STDOUT:       %.loc3_14.2: type = value_of_initializer %float.make_type.loc3_14 [concrete = f64]
-// CHECK:STDOUT:       %.loc3_14.3: type = converted %float.make_type.loc3_14, %.loc3_14.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %True.decl: type = class_decl @True [concrete = constants.%True] {} {}
-// CHECK:STDOUT:   %False.decl: type = class_decl @False [concrete = constants.%False] {} {}
-// CHECK:STDOUT:   %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
-// CHECK:STDOUT:     %true_.patt: %pattern_type.efb = binding_pattern true_ [concrete]
-// CHECK:STDOUT:     %true_.param_patt: %pattern_type.efb = value_param_pattern %true_.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %false_.patt: %pattern_type.4cc = binding_pattern false_ [concrete]
-// CHECK:STDOUT:     %false_.param_patt: %pattern_type.4cc = value_param_pattern %false_.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %true_.param: %True = value_param call_param0
-// CHECK:STDOUT:     %True.ref.loc8: type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:     %true_: %True = bind_name true_, %true_.param
-// CHECK:STDOUT:     %false_.param: %False = value_param call_param1
-// CHECK:STDOUT:     %False.ref.loc8: type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:     %false_: %False = bind_name false_, %false_.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [concrete = constants.%RuntimeCallIsValid] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc16_42.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc16_42.2: type = converted %bool.make_type, %.loc16_42.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc16_26.1: type = splice_block %.loc16_26.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc16_26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc16_26: init type = call constants.%Float(%int_64.loc16_26) [concrete = f64]
-// CHECK:STDOUT:       %.loc16_26.2: type = value_of_initializer %float.make_type.loc16_26 [concrete = f64]
-// CHECK:STDOUT:       %.loc16_26.3: type = converted %float.make_type.loc16_26, %.loc16_26.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc16_34.1: type = splice_block %.loc16_34.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc16_34: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc16_34: init type = call constants.%Float(%int_64.loc16_34) [concrete = f64]
-// CHECK:STDOUT:       %.loc16_34.2: type = value_of_initializer %float.make_type.loc16_34 [concrete = f64]
-// CHECK:STDOUT:       %.loc16_34.3: type = converted %float.make_type.loc16_34, %.loc16_34.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @True {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%True
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @False {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%False
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @LessEq(%a.param: f64, %b.param: f64) -> bool = "float.less_eq";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Negate(%a.param: f64) -> f64 = "float.negate";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @F(%true_.param: %True, %false_.param: %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 [concrete = constants.%LessEq]
-// CHECK:STDOUT:   %float.loc9_23: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc9_28: f64 = float_literal 2 [concrete = constants.%float.be3]
-// CHECK:STDOUT:   %float.less_eq.loc9: init bool = call %LessEq.ref.loc9(%float.loc9_23, %float.loc9_28) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc9_13.1: bool = value_of_initializer %float.less_eq.loc9 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc9_13.2: bool = converted %float.less_eq.loc9, %.loc9_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%LessEq]
-// CHECK:STDOUT:   %float.loc10_23: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc10_28: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.less_eq.loc10: init bool = call %LessEq.ref.loc10(%float.loc10_23, %float.loc10_28) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc10_13.1: bool = value_of_initializer %float.less_eq.loc10 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc10_13.2: bool = converted %float.less_eq.loc10, %.loc10_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%LessEq]
-// CHECK:STDOUT:   %float.loc11_24: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc11_29: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %float.less_eq.loc11: init bool = call %LessEq.ref.loc11(%float.loc11_24, %float.loc11_29) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc11_14.1: bool = value_of_initializer %float.less_eq.loc11 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc11_14.2: bool = converted %float.less_eq.loc11, %.loc11_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%LessEq]
-// CHECK:STDOUT:   %Negate.ref.loc12: %Negate.type = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
-// CHECK:STDOUT:   %float.loc12_30: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.negate.loc12: init f64 = call %Negate.ref.loc12(%float.loc12_30) [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.loc12_36: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %.loc12_33.1: f64 = value_of_initializer %float.negate.loc12 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc12_33.2: f64 = converted %float.negate.loc12, %.loc12_33.1 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.less_eq.loc12: init bool = call %LessEq.ref.loc12(%.loc12_33.2, %float.loc12_36) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc12_13.1: bool = value_of_initializer %float.less_eq.loc12 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc12_13.2: bool = converted %float.less_eq.loc12, %.loc12_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%LessEq]
-// CHECK:STDOUT:   %float.loc13_24: f64 = float_literal 0 [concrete = constants.%float.555]
-// CHECK:STDOUT:   %Negate.ref.loc13: %Negate.type = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
-// CHECK:STDOUT:   %float.loc13_36: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.negate.loc13: init f64 = call %Negate.ref.loc13(%float.loc13_36) [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc13_39.1: f64 = value_of_initializer %float.negate.loc13 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %.loc13_39.2: f64 = converted %float.negate.loc13, %.loc13_39.1 [concrete = constants.%float.f51]
-// CHECK:STDOUT:   %float.less_eq.loc13: init bool = call %LessEq.ref.loc13(%float.loc13_24, %.loc13_39.2) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc13_14.1: bool = value_of_initializer %float.less_eq.loc13 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc13_14.2: bool = converted %float.less_eq.loc13, %.loc13_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%False]
-// CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: f64, %b.param: f64) -> bool {
@@ -316,8 +48,8 @@ fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
 // CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
 // CHECK:STDOUT:   %float.less_eq: init bool = call %LessEq.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc17_22.1: bool = value_of_initializer %float.less_eq
-// CHECK:STDOUT:   %.loc17_22.2: bool = converted %float.less_eq, %.loc17_22.1
-// CHECK:STDOUT:   return %.loc17_22.2
+// CHECK:STDOUT:   %.loc18_22.1: bool = value_of_initializer %float.less_eq
+// CHECK:STDOUT:   %.loc18_22.2: bool = converted %float.less_eq, %.loc18_22.1
+// CHECK:STDOUT:   return %.loc18_22.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 18 - 257
toolchain/check/testdata/builtins/float/make_type.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/make_type.carbon
@@ -23,7 +25,9 @@ import library "types";
 var f: Float(64) = 0.0;
 
 fn GetFloat(dyn_size: i32) -> type {
+  //@dump-sem-ir-begin
   return Float(dyn_size);
+  //@dump-sem-ir-end
 }
 
 // --- fail_invalid_size.carbon
@@ -33,292 +37,49 @@ library "[[@TEST_NAME]]";
 import library "types";
 
 // CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+4]]:20: error: bit width must be 64 [CompileTimeFloatBitWidth]
-// CHECK:STDERR: var invalid_float: Float(32);
-// CHECK:STDERR:                    ^~~~~~~~~
+// CHECK:STDERR: var invalid_float: Float(931);
+// CHECK:STDERR:                    ^~~~~~~~~~
 // CHECK:STDERR:
-var invalid_float: Float(32);
+var invalid_float: Float(931);
+
+// --- fail_dyn_size.carbon
+
+library "[[@TEST_NAME]]";
+
+import library "types";
 
 var dyn_size: i32 = 64;
-// CHECK:STDERR: fail_invalid_size.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure]
+// CHECK:STDERR: fail_dyn_size.carbon:[[@LINE+4]]:10: error: cannot evaluate type expression [TypeExprEvaluationFailure]
 // CHECK:STDERR: var dyn: Float(dyn_size);
 // CHECK:STDERR:          ^~~~~~~~~~~~~~~
 // CHECK:STDERR:
 var dyn: Float(dyn_size);
 
-// CHECK:STDOUT: --- types.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
-// CHECK:STDOUT:   %Int.type: type = generic_class_type @Int [concrete]
-// CHECK:STDOUT:   %Int.generic: %Int.type = struct_value () [concrete]
-// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
-// CHECK:STDOUT:   %pattern_type.7ce: type = pattern_type %i32 [concrete]
-// CHECK:STDOUT:   %pattern_type.98f: type = pattern_type type [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Int = %Core.Int
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .Float = %Float.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Float.decl: %Float.type = fn_decl @Float [concrete = constants.%Float] {
-// CHECK:STDOUT:     %size.patt: %pattern_type.7ce = binding_pattern size [concrete]
-// CHECK:STDOUT:     %size.param_patt: %pattern_type.7ce = value_param_pattern %size.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.98f = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.98f = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %size.param: %i32 = value_param call_param0
-// CHECK:STDOUT:     %.loc4: type = splice_block %i32 [concrete = constants.%i32] {
-// CHECK:STDOUT:       %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
-// CHECK:STDOUT:       %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %size: %i32 = bind_name size, %size.param
-// CHECK:STDOUT:     %return.param: ref type = out_param call_param1
-// CHECK:STDOUT:     %return: ref type = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Float(%size.param: %i32) -> type = "float.make_type";
-// CHECK:STDOUT:
 // CHECK:STDOUT: --- use_types.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
 // CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.98f: type = pattern_type type [concrete]
 // CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
-// CHECK:STDOUT:   %Int.type: type = generic_class_type @Int [concrete]
-// CHECK:STDOUT:   %Int.generic: %Int.type = struct_value () [concrete]
 // CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
-// CHECK:STDOUT:   %pattern_type.501: type = pattern_type %i32 [concrete]
-// CHECK:STDOUT:   %int_64.fab: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
-// CHECK:STDOUT:   %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
-// CHECK:STDOUT:   %ImplicitAs.type.9ba: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
-// CHECK:STDOUT:   %Convert.type.6da: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
-// CHECK:STDOUT:   %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
-// CHECK:STDOUT:   %Convert.type.0b2: type = fn_type @Convert.2, @impl.c81(%To.c80) [symbolic]
-// CHECK:STDOUT:   %Convert.6d7: %Convert.type.0b2 = struct_value () [symbolic]
-// CHECK:STDOUT:   %ImplicitAs.impl_witness.e34: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.e36, @impl.c81(%int_32) [concrete]
-// CHECK:STDOUT:   %Convert.type.ed5: type = fn_type @Convert.2, @impl.c81(%int_32) [concrete]
-// CHECK:STDOUT:   %Convert.16d: %Convert.type.ed5 = struct_value () [concrete]
-// CHECK:STDOUT:   %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.e34) [concrete]
-// CHECK:STDOUT:   %.d6a: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [concrete]
-// CHECK:STDOUT:   %Convert.bound: <bound method> = bound_method %int_64.fab, %Convert.16d [concrete]
-// CHECK:STDOUT:   %Convert.specific_fn: <specific function> = specific_function %Convert.16d, @Convert.2(%int_32) [concrete]
-// CHECK:STDOUT:   %bound_method: <bound method> = bound_method %int_64.fab, %Convert.specific_fn [concrete]
-// CHECK:STDOUT:   %int_64.198: %i32 = int_value 64 [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %float: f64 = float_literal 0 [concrete]
-// CHECK:STDOUT:   %GetFloat.type: type = fn_type @GetFloat [concrete]
-// CHECK:STDOUT:   %GetFloat: %GetFloat.type = struct_value () [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
 // CHECK:STDOUT:   %Main.Float: %Float.type = import_ref Main//types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .ImplicitAs = %Core.ImplicitAs
-// CHECK:STDOUT:     .Int = %Core.Int
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
-// CHECK:STDOUT:   %Core.import_ref.a86: @impl.c81.%Convert.type (%Convert.type.0b2) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.c81.%Convert (constants.%Convert.6d7)]
-// CHECK:STDOUT:   %ImplicitAs.impl_witness_table.e36 = impl_witness_table (%Core.import_ref.a86), @impl.c81 [concrete]
-// CHECK:STDOUT:   %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Float = imports.%Main.Float
-// CHECK:STDOUT:     .Core = imports.%Core.ece
-// CHECK:STDOUT:     .f = %f
-// CHECK:STDOUT:     .GetFloat = %GetFloat.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %default.import = import <none>
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %f.patt: %pattern_type.3de = binding_pattern f [concrete]
-// CHECK:STDOUT:     %f.var_patt: %pattern_type.3de = var_pattern %f.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %f.var: ref f64 = var %f.var_patt [concrete]
-// CHECK:STDOUT:   %.loc6_16.1: type = splice_block %.loc6_16.3 [concrete = f64] {
-// CHECK:STDOUT:     %Float.ref: %Float.type = name_ref Float, imports.%Main.Float [concrete = constants.%Float]
-// CHECK:STDOUT:     %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64.fab]
-// CHECK:STDOUT:     %impl.elem0: %.d6a = impl_witness_access constants.%ImplicitAs.impl_witness.e34, element0 [concrete = constants.%Convert.16d]
-// CHECK:STDOUT:     %bound_method.loc6_14.1: <bound method> = bound_method %int_64, %impl.elem0 [concrete = constants.%Convert.bound]
-// CHECK:STDOUT:     %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
-// CHECK:STDOUT:     %bound_method.loc6_14.2: <bound method> = bound_method %int_64, %specific_fn [concrete = constants.%bound_method]
-// CHECK:STDOUT:     %int.convert_checked: init %i32 = call %bound_method.loc6_14.2(%int_64) [concrete = constants.%int_64.198]
-// CHECK:STDOUT:     %.loc6_14.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_64.198]
-// CHECK:STDOUT:     %.loc6_14.2: %i32 = converted %int_64, %.loc6_14.1 [concrete = constants.%int_64.198]
-// CHECK:STDOUT:     %float.make_type: init type = call %Float.ref(%.loc6_14.2) [concrete = f64]
-// CHECK:STDOUT:     %.loc6_16.2: type = value_of_initializer %float.make_type [concrete = f64]
-// CHECK:STDOUT:     %.loc6_16.3: type = converted %float.make_type, %.loc6_16.2 [concrete = f64]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %f: ref f64 = bind_name f, %f.var
-// CHECK:STDOUT:   %GetFloat.decl: %GetFloat.type = fn_decl @GetFloat [concrete = constants.%GetFloat] {
-// CHECK:STDOUT:     %dyn_size.patt: %pattern_type.501 = binding_pattern dyn_size [concrete]
-// CHECK:STDOUT:     %dyn_size.param_patt: %pattern_type.501 = value_param_pattern %dyn_size.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.98f = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.98f = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %dyn_size.param: %i32 = value_param call_param0
-// CHECK:STDOUT:     %.loc8: type = splice_block %i32 [concrete = constants.%i32] {
-// CHECK:STDOUT:       %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
-// CHECK:STDOUT:       %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %dyn_size: %i32 = bind_name dyn_size, %dyn_size.param
-// CHECK:STDOUT:     %return.param: ref type = out_param call_param1
-// CHECK:STDOUT:     %return: ref type = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Float = "float.make_type" [from "types.carbon"];
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @GetFloat(%dyn_size.param: %i32) -> type {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Float.ref: %Float.type = name_ref Float, imports.%Main.Float [concrete = constants.%Float]
 // CHECK:STDOUT:   %dyn_size.ref: %i32 = name_ref dyn_size, %dyn_size
 // CHECK:STDOUT:   %float.make_type: init type = call %Float.ref(%dyn_size.ref)
-// CHECK:STDOUT:   %.loc9_25.1: type = value_of_initializer %float.make_type
-// CHECK:STDOUT:   %.loc9_25.2: type = converted %float.make_type, %.loc9_25.1
-// CHECK:STDOUT:   return %.loc9_25.2
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @__global_init() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %float: f64 = float_literal 0 [concrete = constants.%float]
-// CHECK:STDOUT:   assign file.%f.var, %float
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: --- fail_invalid_size.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %int_32.be0: Core.IntLiteral = int_value 32 [concrete]
-// CHECK:STDOUT:   %Int.type: type = generic_class_type @Int [concrete]
-// CHECK:STDOUT:   %Int.generic: %Int.type = struct_value () [concrete]
-// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32.be0) [concrete]
-// CHECK:STDOUT:   %pattern_type.501: type = pattern_type %i32 [concrete]
-// CHECK:STDOUT:   %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
-// CHECK:STDOUT:   %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
-// CHECK:STDOUT:   %ImplicitAs.type.9ba: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
-// CHECK:STDOUT:   %Convert.type.6da: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
-// CHECK:STDOUT:   %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
-// CHECK:STDOUT:   %Convert.type.0b2: type = fn_type @Convert.2, @impl.c81(%To.c80) [symbolic]
-// CHECK:STDOUT:   %Convert.6d7: %Convert.type.0b2 = struct_value () [symbolic]
-// CHECK:STDOUT:   %ImplicitAs.impl_witness.e34: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.e36, @impl.c81(%int_32.be0) [concrete]
-// CHECK:STDOUT:   %Convert.type.ed5: type = fn_type @Convert.2, @impl.c81(%int_32.be0) [concrete]
-// CHECK:STDOUT:   %Convert.16d: %Convert.type.ed5 = struct_value () [concrete]
-// CHECK:STDOUT:   %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.e34) [concrete]
-// CHECK:STDOUT:   %.d6a: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [concrete]
-// CHECK:STDOUT:   %Convert.bound.cce: <bound method> = bound_method %int_32.be0, %Convert.16d [concrete]
-// CHECK:STDOUT:   %Convert.specific_fn: <specific function> = specific_function %Convert.16d, @Convert.2(%int_32.be0) [concrete]
-// CHECK:STDOUT:   %bound_method.480: <bound method> = bound_method %int_32.be0, %Convert.specific_fn [concrete]
-// CHECK:STDOUT:   %int_32.4de: %i32 = int_value 32 [concrete]
-// CHECK:STDOUT:   %int_64.fab: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Convert.bound.575: <bound method> = bound_method %int_64.fab, %Convert.16d [concrete]
-// CHECK:STDOUT:   %bound_method.767: <bound method> = bound_method %int_64.fab, %Convert.specific_fn [concrete]
-// CHECK:STDOUT:   %int_64.198: %i32 = int_value 64 [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Main.Float: %Float.type = import_ref Main//types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.ece: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .ImplicitAs = %Core.ImplicitAs
-// CHECK:STDOUT:     .Int = %Core.Int
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic]
-// CHECK:STDOUT:   %Core.import_ref.a86: @impl.c81.%Convert.type (%Convert.type.0b2) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.c81.%Convert (constants.%Convert.6d7)]
-// CHECK:STDOUT:   %ImplicitAs.impl_witness_table.e36 = impl_witness_table (%Core.import_ref.a86), @impl.c81 [concrete]
-// CHECK:STDOUT:   %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
+// CHECK:STDOUT:   %.loc10_25.1: type = value_of_initializer %float.make_type
+// CHECK:STDOUT:   %.loc10_25.2: type = converted %float.make_type, %.loc10_25.1
+// CHECK:STDOUT:   return %.loc10_25.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Float = imports.%Main.Float
-// CHECK:STDOUT:     .Core = imports.%Core.ece
-// CHECK:STDOUT:     .invalid_float = %invalid_float
-// CHECK:STDOUT:     .dyn_size = %dyn_size
-// CHECK:STDOUT:     .dyn = %dyn
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %default.import = import <none>
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %invalid_float.patt: <error> = binding_pattern invalid_float [concrete]
-// CHECK:STDOUT:     %invalid_float.var_patt: <error> = var_pattern %invalid_float.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %invalid_float.var: ref <error> = var %invalid_float.var_patt [concrete = <error>]
-// CHECK:STDOUT:   %.loc10_28.1: type = splice_block %.loc10_28.3 [concrete = <error>] {
-// CHECK:STDOUT:     %Float.ref.loc10: %Float.type = name_ref Float, imports.%Main.Float [concrete = constants.%Float]
-// CHECK:STDOUT:     %int_32.loc10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32.be0]
-// CHECK:STDOUT:     %impl.elem0: %.d6a = impl_witness_access constants.%ImplicitAs.impl_witness.e34, element0 [concrete = constants.%Convert.16d]
-// CHECK:STDOUT:     %bound_method.loc10_26.1: <bound method> = bound_method %int_32.loc10, %impl.elem0 [concrete = constants.%Convert.bound.cce]
-// CHECK:STDOUT:     %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32.be0) [concrete = constants.%Convert.specific_fn]
-// CHECK:STDOUT:     %bound_method.loc10_26.2: <bound method> = bound_method %int_32.loc10, %specific_fn [concrete = constants.%bound_method.480]
-// CHECK:STDOUT:     %int.convert_checked: init %i32 = call %bound_method.loc10_26.2(%int_32.loc10) [concrete = constants.%int_32.4de]
-// CHECK:STDOUT:     %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_32.4de]
-// CHECK:STDOUT:     %.loc10_26.2: %i32 = converted %int_32.loc10, %.loc10_26.1 [concrete = constants.%int_32.4de]
-// CHECK:STDOUT:     %float.make_type.loc10: init type = call %Float.ref.loc10(%.loc10_26.2) [concrete = <error>]
-// CHECK:STDOUT:     %.loc10_28.2: type = value_of_initializer %float.make_type.loc10 [concrete = <error>]
-// CHECK:STDOUT:     %.loc10_28.3: type = converted %float.make_type.loc10, %.loc10_28.2 [concrete = <error>]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %invalid_float: <error> = bind_name invalid_float, <error>
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %dyn_size.patt: %pattern_type.501 = binding_pattern dyn_size [concrete]
-// CHECK:STDOUT:     %dyn_size.var_patt: %pattern_type.501 = var_pattern %dyn_size.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %dyn_size.var: ref %i32 = var %dyn_size.var_patt [concrete]
-// CHECK:STDOUT:   %.loc12: type = splice_block %i32 [concrete = constants.%i32] {
-// CHECK:STDOUT:     %int_32.loc12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32.be0]
-// CHECK:STDOUT:     %i32: type = class_type @Int, @Int(constants.%int_32.be0) [concrete = constants.%i32]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %dyn_size: ref %i32 = bind_name dyn_size, %dyn_size.var
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %dyn.patt: <error> = binding_pattern dyn [concrete]
-// CHECK:STDOUT:     %dyn.var_patt: <error> = var_pattern %dyn.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %dyn.var: ref <error> = var %dyn.var_patt [concrete = <error>]
-// CHECK:STDOUT:   %.1: <error> = splice_block <error> [concrete = <error>] {
-// CHECK:STDOUT:     %Float.ref.loc17: %Float.type = name_ref Float, imports.%Main.Float [concrete = constants.%Float]
-// CHECK:STDOUT:     %dyn_size.ref: ref %i32 = name_ref dyn_size, %dyn_size
-// CHECK:STDOUT:     %.loc17_16: %i32 = bind_value %dyn_size.ref
-// CHECK:STDOUT:     %float.make_type.loc17: init type = call %Float.ref.loc17(%.loc17_16)
-// CHECK:STDOUT:     %.loc17_24.1: type = value_of_initializer %float.make_type.loc17
-// CHECK:STDOUT:     %.loc17_24.2: type = converted %float.make_type.loc17, %.loc17_24.1
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %dyn: <error> = bind_name dyn, <error>
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Float = "float.make_type" [from "types.carbon"];
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64.fab]
-// CHECK:STDOUT:   %impl.elem0: %.d6a = impl_witness_access constants.%ImplicitAs.impl_witness.e34, element0 [concrete = constants.%Convert.16d]
-// CHECK:STDOUT:   %bound_method.loc12_1.1: <bound method> = bound_method %int_64, %impl.elem0 [concrete = constants.%Convert.bound.575]
-// CHECK:STDOUT:   %specific_fn: <specific function> = specific_function %impl.elem0, @Convert.2(constants.%int_32.be0) [concrete = constants.%Convert.specific_fn]
-// CHECK:STDOUT:   %bound_method.loc12_1.2: <bound method> = bound_method %int_64, %specific_fn [concrete = constants.%bound_method.767]
-// CHECK:STDOUT:   %int.convert_checked: init %i32 = call %bound_method.loc12_1.2(%int_64) [concrete = constants.%int_64.198]
-// CHECK:STDOUT:   %.loc12: init %i32 = converted %int_64, %int.convert_checked [concrete = constants.%int_64.198]
-// CHECK:STDOUT:   assign file.%dyn_size.var, %.loc12
-// CHECK:STDOUT:   return
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 33 - 431
toolchain/check/testdata/builtins/float/mul.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/mul.carbon
@@ -10,43 +12,56 @@
 
 // --- mul_sub.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Mul(a: f64, b: f64) -> f64 = "float.mul";
 
 fn RuntimeCallIsValid(a: f64, b: f64) -> f64 {
+  //@dump-sem-ir-begin
   return Mul(a, b);
+  //@dump-sem-ir-end
 }
 
 var x: f64 = Mul(2.0, 0.5);
 
-// --- fail_bad_decl.carbon
+// --- fail_too_few.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.mul" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.mul" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.mul";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn TooFew(a: f64) -> f64 = "float.mul";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.mul" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.mul";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.mul";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.mul" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.mul";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn BadReturnType(a: f64, b: f64) -> bool = "float.mul";
-fn JustRight(a: f64, b: f64) -> f64 = "float.mul";
 
 fn RuntimeCallIsValidTooFew(a: f64) -> f64 {
   return TooFew(a);
 }
 
+// --- fail_too_many.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.mul" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.mul";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.mul";
+
 fn RuntimeCallIsValidTooMany(a: f64, b: f64, c: f64) -> f64 {
   return TooMany(a, b, c);
 }
 
+// --- fail_bad_return_type.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.mul" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.mul";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn BadReturnType(a: f64, b: f64) -> bool = "float.mul";
+
 fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool {
   return BadReturnType(a, b);
 }
@@ -54,439 +69,26 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool {
 // CHECK:STDOUT: --- mul_sub.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
 // CHECK:STDOUT:   %Mul.type: type = fn_type @Mul [concrete]
 // CHECK:STDOUT:   %Mul: %Mul.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float.be3: f64 = float_literal 2 [concrete]
-// CHECK:STDOUT:   %float.c22: f64 = float_literal 0.5 [concrete]
-// CHECK:STDOUT:   %float.f4e: f64 = float_literal 1 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .Mul = %Mul.decl
-// CHECK:STDOUT:     .RuntimeCallIsValid = %RuntimeCallIsValid.decl
-// CHECK:STDOUT:     .x = %x
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Mul.decl: %Mul.type = fn_decl @Mul [concrete = constants.%Mul] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc2_27: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc2_27: init type = call constants.%Float(%int_64.loc2_27) [concrete = f64]
-// CHECK:STDOUT:     %.loc2_27.1: type = value_of_initializer %float.make_type.loc2_27 [concrete = f64]
-// CHECK:STDOUT:     %.loc2_27.2: type = converted %float.make_type.loc2_27, %.loc2_27.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc2_11.1: type = splice_block %.loc2_11.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_11: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_11.2: type = value_of_initializer %float.make_type.loc2_11 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_11.3: type = converted %float.make_type.loc2_11, %.loc2_11.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc2_19.1: type = splice_block %.loc2_19.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_19: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_19.2: type = value_of_initializer %float.make_type.loc2_19 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_19.3: type = converted %float.make_type.loc2_19, %.loc2_19.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [concrete = constants.%RuntimeCallIsValid] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc4_42: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc4_42: init type = call constants.%Float(%int_64.loc4_42) [concrete = f64]
-// CHECK:STDOUT:     %.loc4_42.1: type = value_of_initializer %float.make_type.loc4_42 [concrete = f64]
-// CHECK:STDOUT:     %.loc4_42.2: type = converted %float.make_type.loc4_42, %.loc4_42.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc4_26.1: type = splice_block %.loc4_26.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc4_26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc4_26: init type = call constants.%Float(%int_64.loc4_26) [concrete = f64]
-// CHECK:STDOUT:       %.loc4_26.2: type = value_of_initializer %float.make_type.loc4_26 [concrete = f64]
-// CHECK:STDOUT:       %.loc4_26.3: type = converted %float.make_type.loc4_26, %.loc4_26.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc4_34.1: type = splice_block %.loc4_34.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc4_34: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc4_34: init type = call constants.%Float(%int_64.loc4_34) [concrete = f64]
-// CHECK:STDOUT:       %.loc4_34.2: type = value_of_initializer %float.make_type.loc4_34 [concrete = f64]
-// CHECK:STDOUT:       %.loc4_34.3: type = converted %float.make_type.loc4_34, %.loc4_34.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %x.patt: %pattern_type.3de = binding_pattern x [concrete]
-// CHECK:STDOUT:     %x.var_patt: %pattern_type.3de = var_pattern %x.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %x.var: ref f64 = var %x.var_patt [concrete]
-// CHECK:STDOUT:   %.loc8_8.1: type = splice_block %.loc8_8.3 [concrete = f64] {
-// CHECK:STDOUT:     %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type: init type = call constants.%Float(%int_64) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_8.2: type = value_of_initializer %float.make_type [concrete = f64]
-// CHECK:STDOUT:     %.loc8_8.3: type = converted %float.make_type, %.loc8_8.2 [concrete = f64]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %x: ref f64 = bind_name x, %x.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Mul(%a.param: f64, %b.param: f64) -> f64 = "float.mul";
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: f64, %b.param: f64) -> f64 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [concrete = constants.%Mul]
 // CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
 // CHECK:STDOUT:   %float.mul: init f64 = call %Mul.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc5_19.1: f64 = value_of_initializer %float.mul
-// CHECK:STDOUT:   %.loc5_19.2: f64 = converted %float.mul, %.loc5_19.1
-// CHECK:STDOUT:   return %.loc5_19.2
+// CHECK:STDOUT:   %.loc8_19.1: f64 = value_of_initializer %float.mul
+// CHECK:STDOUT:   %.loc8_19.2: f64 = converted %float.mul, %.loc8_19.1
+// CHECK:STDOUT:   return %.loc8_19.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %Mul.ref: %Mul.type = name_ref Mul, file.%Mul.decl [concrete = constants.%Mul]
-// CHECK:STDOUT:   %float.loc8_18: f64 = float_literal 2 [concrete = constants.%float.be3]
-// CHECK:STDOUT:   %float.loc8_23: f64 = float_literal 0.5 [concrete = constants.%float.c22]
-// CHECK:STDOUT:   %float.mul: init f64 = call %Mul.ref(%float.loc8_18, %float.loc8_23) [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   assign file.%x.var, %float.mul
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: --- fail_bad_decl.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %TooFew.type: type = fn_type @TooFew [concrete]
-// CHECK:STDOUT:   %TooFew: %TooFew.type = struct_value () [concrete]
-// CHECK:STDOUT:   %TooMany.type: type = fn_type @TooMany [concrete]
-// CHECK:STDOUT:   %TooMany: %TooMany.type = struct_value () [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
-// CHECK:STDOUT:   %BadReturnType.type: type = fn_type @BadReturnType [concrete]
-// CHECK:STDOUT:   %BadReturnType: %BadReturnType.type = struct_value () [concrete]
-// CHECK:STDOUT:   %JustRight.type: type = fn_type @JustRight [concrete]
-// CHECK:STDOUT:   %JustRight: %JustRight.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew.type: type = fn_type @RuntimeCallIsValidTooFew [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew: %RuntimeCallIsValidTooFew.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany.type: type = fn_type @RuntimeCallIsValidTooMany [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany: %RuntimeCallIsValidTooMany.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType.type: type = fn_type @RuntimeCallIsValidBadReturnType [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType: %RuntimeCallIsValidBadReturnType.type = struct_value () [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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:     .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 [concrete = constants.%TooFew] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc8_22: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc8_22: init type = call constants.%Float(%int_64.loc8_22) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_22.1: type = value_of_initializer %float.make_type.loc8_22 [concrete = f64]
-// CHECK:STDOUT:     %.loc8_22.2: type = converted %float.make_type.loc8_22, %.loc8_22.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc8_14.1: type = splice_block %.loc8_14.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc8_14: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [concrete = f64]
-// CHECK:STDOUT:       %.loc8_14.2: type = value_of_initializer %float.make_type.loc8_14 [concrete = f64]
-// CHECK:STDOUT:       %.loc8_14.3: type = converted %float.make_type.loc8_14, %.loc8_14.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %TooMany.decl: %TooMany.type = fn_decl @TooMany [concrete = constants.%TooMany] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %c.patt: %pattern_type.3de = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.param_patt: %pattern_type.3de = value_param_pattern %c.patt, call_param2 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param3 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc13_39: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc13_39: init type = call constants.%Float(%int_64.loc13_39) [concrete = f64]
-// CHECK:STDOUT:     %.loc13_39.1: type = value_of_initializer %float.make_type.loc13_39 [concrete = f64]
-// CHECK:STDOUT:     %.loc13_39.2: type = converted %float.make_type.loc13_39, %.loc13_39.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc13_15.1: type = splice_block %.loc13_15.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_15.2: type = value_of_initializer %float.make_type.loc13_15 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_15.3: type = converted %float.make_type.loc13_15, %.loc13_15.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc13_23.1: type = splice_block %.loc13_23.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_23: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_23.2: type = value_of_initializer %float.make_type.loc13_23 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_23.3: type = converted %float.make_type.loc13_23, %.loc13_23.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %c.param: f64 = value_param call_param2
-// CHECK:STDOUT:     %.loc13_31.1: type = splice_block %.loc13_31.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_31: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_31.2: type = value_of_initializer %float.make_type.loc13_31 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_31.3: type = converted %float.make_type.loc13_31, %.loc13_31.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %c: f64 = bind_name c, %c.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param3
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [concrete = constants.%BadReturnType] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc18_37.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc18_21.1: type = splice_block %.loc18_21.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc18_21: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc18_21: init type = call constants.%Float(%int_64.loc18_21) [concrete = f64]
-// CHECK:STDOUT:       %.loc18_21.2: type = value_of_initializer %float.make_type.loc18_21 [concrete = f64]
-// CHECK:STDOUT:       %.loc18_21.3: type = converted %float.make_type.loc18_21, %.loc18_21.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc18_29.1: type = splice_block %.loc18_29.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc18_29: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc18_29: init type = call constants.%Float(%int_64.loc18_29) [concrete = f64]
-// CHECK:STDOUT:       %.loc18_29.2: type = value_of_initializer %float.make_type.loc18_29 [concrete = f64]
-// CHECK:STDOUT:       %.loc18_29.3: type = converted %float.make_type.loc18_29, %.loc18_29.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %JustRight.decl: %JustRight.type = fn_decl @JustRight [concrete = constants.%JustRight] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc19_33: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc19_33: init type = call constants.%Float(%int_64.loc19_33) [concrete = f64]
-// CHECK:STDOUT:     %.loc19_33.1: type = value_of_initializer %float.make_type.loc19_33 [concrete = f64]
-// CHECK:STDOUT:     %.loc19_33.2: type = converted %float.make_type.loc19_33, %.loc19_33.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc19_17.1: type = splice_block %.loc19_17.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc19_17: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc19_17: init type = call constants.%Float(%int_64.loc19_17) [concrete = f64]
-// CHECK:STDOUT:       %.loc19_17.2: type = value_of_initializer %float.make_type.loc19_17 [concrete = f64]
-// CHECK:STDOUT:       %.loc19_17.3: type = converted %float.make_type.loc19_17, %.loc19_17.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc19_25.1: type = splice_block %.loc19_25.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc19_25: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc19_25: init type = call constants.%Float(%int_64.loc19_25) [concrete = f64]
-// CHECK:STDOUT:       %.loc19_25.2: type = value_of_initializer %float.make_type.loc19_25 [concrete = f64]
-// CHECK:STDOUT:       %.loc19_25.3: type = converted %float.make_type.loc19_25, %.loc19_25.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew.decl: %RuntimeCallIsValidTooFew.type = fn_decl @RuntimeCallIsValidTooFew [concrete = constants.%RuntimeCallIsValidTooFew] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc21_40: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc21_40: init type = call constants.%Float(%int_64.loc21_40) [concrete = f64]
-// CHECK:STDOUT:     %.loc21_40.1: type = value_of_initializer %float.make_type.loc21_40 [concrete = f64]
-// CHECK:STDOUT:     %.loc21_40.2: type = converted %float.make_type.loc21_40, %.loc21_40.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc21_32.1: type = splice_block %.loc21_32.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc21_32: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc21_32: init type = call constants.%Float(%int_64.loc21_32) [concrete = f64]
-// CHECK:STDOUT:       %.loc21_32.2: type = value_of_initializer %float.make_type.loc21_32 [concrete = f64]
-// CHECK:STDOUT:       %.loc21_32.3: type = converted %float.make_type.loc21_32, %.loc21_32.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany.decl: %RuntimeCallIsValidTooMany.type = fn_decl @RuntimeCallIsValidTooMany [concrete = constants.%RuntimeCallIsValidTooMany] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %c.patt: %pattern_type.3de = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.param_patt: %pattern_type.3de = value_param_pattern %c.patt, call_param2 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param3 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc25_57: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc25_57: init type = call constants.%Float(%int_64.loc25_57) [concrete = f64]
-// CHECK:STDOUT:     %.loc25_57.1: type = value_of_initializer %float.make_type.loc25_57 [concrete = f64]
-// CHECK:STDOUT:     %.loc25_57.2: type = converted %float.make_type.loc25_57, %.loc25_57.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc25_33.1: type = splice_block %.loc25_33.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_33: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_33: init type = call constants.%Float(%int_64.loc25_33) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_33.2: type = value_of_initializer %float.make_type.loc25_33 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_33.3: type = converted %float.make_type.loc25_33, %.loc25_33.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc25_41.1: type = splice_block %.loc25_41.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_41: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_41: init type = call constants.%Float(%int_64.loc25_41) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_41.2: type = value_of_initializer %float.make_type.loc25_41 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_41.3: type = converted %float.make_type.loc25_41, %.loc25_41.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %c.param: f64 = value_param call_param2
-// CHECK:STDOUT:     %.loc25_49.1: type = splice_block %.loc25_49.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_49: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_49: init type = call constants.%Float(%int_64.loc25_49) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_49.2: type = value_of_initializer %float.make_type.loc25_49 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_49.3: type = converted %float.make_type.loc25_49, %.loc25_49.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %c: f64 = bind_name c, %c.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param3
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType.decl: %RuntimeCallIsValidBadReturnType.type = fn_decl @RuntimeCallIsValidBadReturnType [concrete = constants.%RuntimeCallIsValidBadReturnType] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc29_55.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc29_55.2: type = converted %bool.make_type, %.loc29_55.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc29_39.1: type = splice_block %.loc29_39.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc29_39: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc29_39: init type = call constants.%Float(%int_64.loc29_39) [concrete = f64]
-// CHECK:STDOUT:       %.loc29_39.2: type = value_of_initializer %float.make_type.loc29_39 [concrete = f64]
-// CHECK:STDOUT:       %.loc29_39.3: type = converted %float.make_type.loc29_39, %.loc29_39.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc29_47.1: type = splice_block %.loc29_47.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc29_47: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc29_47: init type = call constants.%Float(%int_64.loc29_47) [concrete = f64]
-// CHECK:STDOUT:       %.loc29_47.2: type = value_of_initializer %float.make_type.loc29_47 [concrete = f64]
-// CHECK:STDOUT:       %.loc29_47.3: type = converted %float.make_type.loc29_47, %.loc29_47.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @TooFew(%a.param: f64) -> f64;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @TooMany(%a.param: f64, %b.param: f64, %c.param: f64) -> f64;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @BadReturnType(%a.param: f64, %b.param: f64) -> bool;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @JustRight(%a.param: f64, %b.param: f64) -> f64 = "float.mul";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidTooFew(%a.param: f64) -> f64 {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [concrete = constants.%TooFew]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %TooFew.call: init f64 = call %TooFew.ref(%a.ref)
-// CHECK:STDOUT:   %.loc22_19.1: f64 = value_of_initializer %TooFew.call
-// CHECK:STDOUT:   %.loc22_19.2: f64 = converted %TooFew.call, %.loc22_19.1
-// CHECK:STDOUT:   return %.loc22_19.2
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param: f64, %b.param: f64, %c.param: f64) -> f64 {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [concrete = constants.%TooMany]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
-// CHECK:STDOUT:   %c.ref: f64 = name_ref c, %c
-// CHECK:STDOUT:   %TooMany.call: init f64 = call %TooMany.ref(%a.ref, %b.ref, %c.ref)
-// CHECK:STDOUT:   %.loc26_26.1: f64 = value_of_initializer %TooMany.call
-// CHECK:STDOUT:   %.loc26_26.2: f64 = converted %TooMany.call, %.loc26_26.1
-// CHECK:STDOUT:   return %.loc26_26.2
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param: f64, %b.param: f64) -> bool {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [concrete = constants.%BadReturnType]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
-// CHECK:STDOUT:   %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc30_29.1: bool = value_of_initializer %BadReturnType.call
-// CHECK:STDOUT:   %.loc30_29.2: bool = converted %BadReturnType.call, %.loc30_29.1
-// CHECK:STDOUT:   return %.loc30_29.2
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 35 - 392
toolchain/check/testdata/builtins/float/negate.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/negate.carbon
@@ -10,441 +12,82 @@
 
 // --- float_negate.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Negate(a: f64) -> f64 = "float.negate";
 
 fn RuntimeCallIsValid(a: f64, b: f64) -> f64 {
+  //@dump-sem-ir-begin
   return Negate(a);
+  //@dump-sem-ir-end
 }
 
 let a: f64 = Negate(1.5);
 
-// --- fail_bad_decl.carbon
+// --- fail_too_few.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn TooFew() -> f64 = "float.negate";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn TooFew() -> f64 = "float.negate";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" [InvalidBuiltinSignature]
+
+fn RuntimeCallIsValidTooFew() -> f64 {
+  return TooFew();
+}
+
+// --- fail_too_many.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn TooMany(a: f64, b: f64) -> f64 = "float.negate";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn TooMany(a: f64, b: f64) -> f64 = "float.negate";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" [InvalidBuiltinSignature]
+
+fn RuntimeCallIsValidTooMany(a: f64, b: f64) -> f64 {
+  return TooMany(a, b);
+}
+
+// --- fail_bad_return_type.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.negate" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn BadReturnType(a: f64) -> bool = "float.negate";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn BadReturnType(a: f64) -> bool = "float.negate";
-fn JustRight(a: f64) -> f64 = "float.negate";
 
-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:          ^~~~~~~~~
-  // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-17]]:1: note: calling function declared here [InCallToEntity]
-  // CHECK:STDERR: fn TooFew() -> f64 = "float.negate";
-  // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR:
-  return TooFew(a);
-}
-
-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:          ^~~~~~~~~~~~~~~~
-  // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-23]]:1: note: calling function declared here [InCallToEntity]
-  // CHECK:STDERR: fn TooMany(a: f64, b: f64) -> f64 = "float.negate";
-  // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR:
-  return TooMany(a, b, c);
-}
-
-fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> 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:          ^~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-29]]:1: note: calling function declared here [InCallToEntity]
-  // CHECK:STDERR: fn BadReturnType(a: f64) -> bool = "float.negate";
-  // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR:
-  return BadReturnType(a, b);
+fn RuntimeCallIsValidBadReturnType(a: f64) -> bool {
+  return BadReturnType(a);
 }
 
 // CHECK:STDOUT: --- float_negate.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
 // CHECK:STDOUT:   %Negate.type: type = fn_type @Negate [concrete]
 // CHECK:STDOUT:   %Negate: %Negate.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float.e93: f64 = float_literal 1.5 [concrete]
-// CHECK:STDOUT:   %float.928: f64 = float_literal -1.5 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .Negate = %Negate.decl
-// CHECK:STDOUT:     .RuntimeCallIsValid = %RuntimeCallIsValid.decl
-// CHECK:STDOUT:     .a = %a
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Negate.decl: %Negate.type = fn_decl @Negate [concrete = constants.%Negate] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc2_22: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc2_22: init type = call constants.%Float(%int_64.loc2_22) [concrete = f64]
-// CHECK:STDOUT:     %.loc2_22.1: type = value_of_initializer %float.make_type.loc2_22 [concrete = f64]
-// CHECK:STDOUT:     %.loc2_22.2: type = converted %float.make_type.loc2_22, %.loc2_22.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc2_14.1: type = splice_block %.loc2_14.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_14: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_14: init type = call constants.%Float(%int_64.loc2_14) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_14.2: type = value_of_initializer %float.make_type.loc2_14 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_14.3: type = converted %float.make_type.loc2_14, %.loc2_14.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [concrete = constants.%RuntimeCallIsValid] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc4_42: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc4_42: init type = call constants.%Float(%int_64.loc4_42) [concrete = f64]
-// CHECK:STDOUT:     %.loc4_42.1: type = value_of_initializer %float.make_type.loc4_42 [concrete = f64]
-// CHECK:STDOUT:     %.loc4_42.2: type = converted %float.make_type.loc4_42, %.loc4_42.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc4_26.1: type = splice_block %.loc4_26.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc4_26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc4_26: init type = call constants.%Float(%int_64.loc4_26) [concrete = f64]
-// CHECK:STDOUT:       %.loc4_26.2: type = value_of_initializer %float.make_type.loc4_26 [concrete = f64]
-// CHECK:STDOUT:       %.loc4_26.3: type = converted %float.make_type.loc4_26, %.loc4_26.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc4_34.1: type = splice_block %.loc4_34.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc4_34: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc4_34: init type = call constants.%Float(%int_64.loc4_34) [concrete = f64]
-// CHECK:STDOUT:       %.loc4_34.2: type = value_of_initializer %float.make_type.loc4_34 [concrete = f64]
-// CHECK:STDOUT:       %.loc4_34.3: type = converted %float.make_type.loc4_34, %.loc4_34.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %.loc8_8.1: type = splice_block %.loc8_8.3 [concrete = f64] {
-// CHECK:STDOUT:     %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type: init type = call constants.%Float(%int_64) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_8.2: type = value_of_initializer %float.make_type [concrete = f64]
-// CHECK:STDOUT:     %.loc8_8.3: type = converted %float.make_type, %.loc8_8.2 [concrete = f64]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %.loc8_24.1: ref f64 = temporary_storage
-// CHECK:STDOUT:   %.loc8_24.2: ref f64 = temporary %.loc8_24.1, @__global_init.%float.negate
-// CHECK:STDOUT:   %a: ref f64 = bind_name a, %.loc8_24.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @Negate(%a.param: f64) -> f64 = "float.negate";
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: f64, %b.param: f64) -> f64 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
 // CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
 // CHECK:STDOUT:   %float.negate: init f64 = call %Negate.ref(%a.ref)
-// CHECK:STDOUT:   %.loc5_19.1: f64 = value_of_initializer %float.negate
-// CHECK:STDOUT:   %.loc5_19.2: f64 = converted %float.negate, %.loc5_19.1
-// CHECK:STDOUT:   return %.loc5_19.2
+// CHECK:STDOUT:   %.loc8_19.1: f64 = value_of_initializer %float.negate
+// CHECK:STDOUT:   %.loc8_19.2: f64 = converted %float.negate, %.loc8_19.1
+// CHECK:STDOUT:   return %.loc8_19.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %Negate.ref: %Negate.type = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
-// CHECK:STDOUT:   %float: f64 = float_literal 1.5 [concrete = constants.%float.e93]
-// CHECK:STDOUT:   %float.negate: init f64 = call %Negate.ref(%float) [concrete = constants.%float.928]
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: --- fail_bad_decl.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %TooFew.type: type = fn_type @TooFew [concrete]
-// CHECK:STDOUT:   %TooFew: %TooFew.type = struct_value () [concrete]
-// CHECK:STDOUT:   %TooMany.type: type = fn_type @TooMany [concrete]
-// CHECK:STDOUT:   %TooMany: %TooMany.type = struct_value () [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
-// CHECK:STDOUT:   %BadReturnType.type: type = fn_type @BadReturnType [concrete]
-// CHECK:STDOUT:   %BadReturnType: %BadReturnType.type = struct_value () [concrete]
-// CHECK:STDOUT:   %JustRight.type: type = fn_type @JustRight [concrete]
-// CHECK:STDOUT:   %JustRight: %JustRight.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew.type: type = fn_type @RuntimeCallIsValidTooFew [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew: %RuntimeCallIsValidTooFew.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany.type: type = fn_type @RuntimeCallIsValidTooMany [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany: %RuntimeCallIsValidTooMany.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType.type: type = fn_type @RuntimeCallIsValidBadReturnType [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType: %RuntimeCallIsValidBadReturnType.type = struct_value () [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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:     .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 [concrete = constants.%TooFew] {
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type: init type = call constants.%Float(%int_64) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_16.1: type = value_of_initializer %float.make_type [concrete = f64]
-// CHECK:STDOUT:     %.loc8_16.2: type = converted %float.make_type, %.loc8_16.1 [concrete = f64]
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param0
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %TooMany.decl: %TooMany.type = fn_decl @TooMany [concrete = constants.%TooMany] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc13_31: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [concrete = f64]
-// CHECK:STDOUT:     %.loc13_31.1: type = value_of_initializer %float.make_type.loc13_31 [concrete = f64]
-// CHECK:STDOUT:     %.loc13_31.2: type = converted %float.make_type.loc13_31, %.loc13_31.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc13_15.1: type = splice_block %.loc13_15.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_15.2: type = value_of_initializer %float.make_type.loc13_15 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_15.3: type = converted %float.make_type.loc13_15, %.loc13_15.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc13_23.1: type = splice_block %.loc13_23.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_23: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_23.2: type = value_of_initializer %float.make_type.loc13_23 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_23.3: type = converted %float.make_type.loc13_23, %.loc13_23.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [concrete = constants.%BadReturnType] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc18_29.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc18_29.2: type = converted %bool.make_type, %.loc18_29.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc18_21.1: type = splice_block %.loc18_21.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type: init type = call constants.%Float(%int_64) [concrete = f64]
-// CHECK:STDOUT:       %.loc18_21.2: type = value_of_initializer %float.make_type [concrete = f64]
-// CHECK:STDOUT:       %.loc18_21.3: type = converted %float.make_type, %.loc18_21.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param1
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %JustRight.decl: %JustRight.type = fn_decl @JustRight [concrete = constants.%JustRight] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc19_25: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc19_25: init type = call constants.%Float(%int_64.loc19_25) [concrete = f64]
-// CHECK:STDOUT:     %.loc19_25.1: type = value_of_initializer %float.make_type.loc19_25 [concrete = f64]
-// CHECK:STDOUT:     %.loc19_25.2: type = converted %float.make_type.loc19_25, %.loc19_25.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc19_17.1: type = splice_block %.loc19_17.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc19_17: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc19_17: init type = call constants.%Float(%int_64.loc19_17) [concrete = f64]
-// CHECK:STDOUT:       %.loc19_17.2: type = value_of_initializer %float.make_type.loc19_17 [concrete = f64]
-// CHECK:STDOUT:       %.loc19_17.3: type = converted %float.make_type.loc19_17, %.loc19_17.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew.decl: %RuntimeCallIsValidTooFew.type = fn_decl @RuntimeCallIsValidTooFew [concrete = constants.%RuntimeCallIsValidTooFew] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc21_40: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc21_40: init type = call constants.%Float(%int_64.loc21_40) [concrete = f64]
-// CHECK:STDOUT:     %.loc21_40.1: type = value_of_initializer %float.make_type.loc21_40 [concrete = f64]
-// CHECK:STDOUT:     %.loc21_40.2: type = converted %float.make_type.loc21_40, %.loc21_40.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc21_32.1: type = splice_block %.loc21_32.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc21_32: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc21_32: init type = call constants.%Float(%int_64.loc21_32) [concrete = f64]
-// CHECK:STDOUT:       %.loc21_32.2: type = value_of_initializer %float.make_type.loc21_32 [concrete = f64]
-// CHECK:STDOUT:       %.loc21_32.3: type = converted %float.make_type.loc21_32, %.loc21_32.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany.decl: %RuntimeCallIsValidTooMany.type = fn_decl @RuntimeCallIsValidTooMany [concrete = constants.%RuntimeCallIsValidTooMany] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %c.patt: %pattern_type.3de = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.param_patt: %pattern_type.3de = value_param_pattern %c.patt, call_param2 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param3 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc32_57: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc32_57: init type = call constants.%Float(%int_64.loc32_57) [concrete = f64]
-// CHECK:STDOUT:     %.loc32_57.1: type = value_of_initializer %float.make_type.loc32_57 [concrete = f64]
-// CHECK:STDOUT:     %.loc32_57.2: type = converted %float.make_type.loc32_57, %.loc32_57.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc32_33.1: type = splice_block %.loc32_33.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc32_33: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc32_33: init type = call constants.%Float(%int_64.loc32_33) [concrete = f64]
-// CHECK:STDOUT:       %.loc32_33.2: type = value_of_initializer %float.make_type.loc32_33 [concrete = f64]
-// CHECK:STDOUT:       %.loc32_33.3: type = converted %float.make_type.loc32_33, %.loc32_33.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc32_41.1: type = splice_block %.loc32_41.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc32_41: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc32_41: init type = call constants.%Float(%int_64.loc32_41) [concrete = f64]
-// CHECK:STDOUT:       %.loc32_41.2: type = value_of_initializer %float.make_type.loc32_41 [concrete = f64]
-// CHECK:STDOUT:       %.loc32_41.3: type = converted %float.make_type.loc32_41, %.loc32_41.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %c.param: f64 = value_param call_param2
-// CHECK:STDOUT:     %.loc32_49.1: type = splice_block %.loc32_49.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc32_49: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc32_49: init type = call constants.%Float(%int_64.loc32_49) [concrete = f64]
-// CHECK:STDOUT:       %.loc32_49.2: type = value_of_initializer %float.make_type.loc32_49 [concrete = f64]
-// CHECK:STDOUT:       %.loc32_49.3: type = converted %float.make_type.loc32_49, %.loc32_49.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %c: f64 = bind_name c, %c.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param3
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType.decl: %RuntimeCallIsValidBadReturnType.type = fn_decl @RuntimeCallIsValidBadReturnType [concrete = constants.%RuntimeCallIsValidBadReturnType] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc43_55.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc43_55.2: type = converted %bool.make_type, %.loc43_55.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc43_39.1: type = splice_block %.loc43_39.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc43_39: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc43_39: init type = call constants.%Float(%int_64.loc43_39) [concrete = f64]
-// CHECK:STDOUT:       %.loc43_39.2: type = value_of_initializer %float.make_type.loc43_39 [concrete = f64]
-// CHECK:STDOUT:       %.loc43_39.3: type = converted %float.make_type.loc43_39, %.loc43_39.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc43_47.1: type = splice_block %.loc43_47.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc43_47: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc43_47: init type = call constants.%Float(%int_64.loc43_47) [concrete = f64]
-// CHECK:STDOUT:       %.loc43_47.2: type = value_of_initializer %float.make_type.loc43_47 [concrete = f64]
-// CHECK:STDOUT:       %.loc43_47.3: type = converted %float.make_type.loc43_47, %.loc43_47.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @TooFew() -> f64;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @TooMany(%a.param: f64, %b.param: f64) -> f64;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @BadReturnType(%a.param: f64) -> bool;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @JustRight(%a.param: f64) -> f64 = "float.negate";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidTooFew(%a.param: f64) -> f64 {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [concrete = constants.%TooFew]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   return <error>
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param: f64, %b.param: f64, %c.param: f64) -> f64 {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [concrete = constants.%TooMany]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
-// CHECK:STDOUT:   %c.ref: f64 = name_ref c, %c
-// CHECK:STDOUT:   return <error>
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param: f64, %b.param: f64) -> bool {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [concrete = constants.%BadReturnType]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
-// CHECK:STDOUT:   return <error>
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 10 - 244
toolchain/check/testdata/builtins/float/neq.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/neq.carbon
@@ -10,6 +12,8 @@
 
 // --- float_neq.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Neq(a: f64, b: f64) -> bool = "float.neq";
 
 class True {}
@@ -21,12 +25,14 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: f64, b: f64) -> bool {
+  //@dump-sem-ir-begin
   return Neq(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_bad_decl.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
 // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.neq" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn WrongResult(a: f64, b: f64) -> f64 = "float.neq";
@@ -37,190 +43,11 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq";
 // CHECK:STDOUT: --- float_neq.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
 // CHECK:STDOUT:   %Neq.type: type = fn_type @Neq [concrete]
 // CHECK:STDOUT:   %Neq: %Neq.type = struct_value () [concrete]
-// CHECK:STDOUT:   %True: type = class_type @True [concrete]
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
-// CHECK:STDOUT:   %False: type = class_type @False [concrete]
-// CHECK:STDOUT:   %pattern_type.efb: type = pattern_type %True [concrete]
-// CHECK:STDOUT:   %pattern_type.4cc: type = pattern_type %False [concrete]
-// CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
-// CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float.f4e: f64 = float_literal 1 [concrete]
-// CHECK:STDOUT:   %float.be3: f64 = float_literal 2 [concrete]
-// CHECK:STDOUT:   %true: bool = bool_literal true [concrete]
-// CHECK:STDOUT:   %false: bool = bool_literal false [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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:     .RuntimeCallIsValid = %RuntimeCallIsValid.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Neq.decl: %Neq.type = fn_decl @Neq [concrete = constants.%Neq] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc2_27.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc2_27.2: type = converted %bool.make_type, %.loc2_27.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc2_11.1: type = splice_block %.loc2_11.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_11: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_11.2: type = value_of_initializer %float.make_type.loc2_11 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_11.3: type = converted %float.make_type.loc2_11, %.loc2_11.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc2_19.1: type = splice_block %.loc2_19.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_19: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_19.2: type = value_of_initializer %float.make_type.loc2_19 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_19.3: type = converted %float.make_type.loc2_19, %.loc2_19.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %True.decl: type = class_decl @True [concrete = constants.%True] {} {}
-// CHECK:STDOUT:   %False.decl: type = class_decl @False [concrete = constants.%False] {} {}
-// CHECK:STDOUT:   %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
-// CHECK:STDOUT:     %true_.patt: %pattern_type.efb = binding_pattern true_ [concrete]
-// CHECK:STDOUT:     %true_.param_patt: %pattern_type.efb = value_param_pattern %true_.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %false_.patt: %pattern_type.4cc = binding_pattern false_ [concrete]
-// CHECK:STDOUT:     %false_.param_patt: %pattern_type.4cc = value_param_pattern %false_.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %true_.param: %True = value_param call_param0
-// CHECK:STDOUT:     %True.ref.loc7: type = name_ref True, file.%True.decl [concrete = constants.%True]
-// CHECK:STDOUT:     %true_: %True = bind_name true_, %true_.param
-// CHECK:STDOUT:     %false_.param: %False = value_param call_param1
-// CHECK:STDOUT:     %False.ref.loc7: type = name_ref False, file.%False.decl [concrete = constants.%False]
-// CHECK:STDOUT:     %false_: %False = bind_name false_, %false_.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [concrete = constants.%RuntimeCallIsValid] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc12_42.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc12_42.2: type = converted %bool.make_type, %.loc12_42.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc12_26.1: type = splice_block %.loc12_26.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc12_26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc12_26: init type = call constants.%Float(%int_64.loc12_26) [concrete = f64]
-// CHECK:STDOUT:       %.loc12_26.2: type = value_of_initializer %float.make_type.loc12_26 [concrete = f64]
-// CHECK:STDOUT:       %.loc12_26.3: type = converted %float.make_type.loc12_26, %.loc12_26.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc12_34.1: type = splice_block %.loc12_34.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc12_34: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc12_34: init type = call constants.%Float(%int_64.loc12_34) [concrete = f64]
-// CHECK:STDOUT:       %.loc12_34.2: type = value_of_initializer %float.make_type.loc12_34 [concrete = f64]
-// CHECK:STDOUT:       %.loc12_34.3: type = converted %float.make_type.loc12_34, %.loc12_34.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @True {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%True
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: class @False {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:   %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
-// CHECK:STDOUT:   complete_type_witness = %complete_type
-// CHECK:STDOUT:
-// CHECK:STDOUT: !members:
-// CHECK:STDOUT:   .Self = constants.%False
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Neq(%a.param: f64, %b.param: f64) -> bool = "float.neq";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @F(%true_.param: %True, %false_.param: %False) {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %true_.ref: %True = name_ref true_, %true_
-// CHECK:STDOUT:   %Neq.ref.loc8: %Neq.type = name_ref Neq, file.%Neq.decl [concrete = constants.%Neq]
-// CHECK:STDOUT:   %float.loc8_20: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc8_25: f64 = float_literal 2 [concrete = constants.%float.be3]
-// CHECK:STDOUT:   %float.neq.loc8: init bool = call %Neq.ref.loc8(%float.loc8_20, %float.loc8_25) [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc8_13.1: bool = value_of_initializer %float.neq.loc8 [concrete = constants.%true]
-// CHECK:STDOUT:   %.loc8_13.2: bool = converted %float.neq.loc8, %.loc8_13.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%True]
-// CHECK:STDOUT:   %false_.ref: %False = name_ref false_, %false_
-// CHECK:STDOUT:   %Neq.ref.loc9: %Neq.type = name_ref Neq, file.%Neq.decl [concrete = constants.%Neq]
-// CHECK:STDOUT:   %float.loc9_21: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.loc9_26: f64 = float_literal 1 [concrete = constants.%float.f4e]
-// CHECK:STDOUT:   %float.neq.loc9: init bool = call %Neq.ref.loc9(%float.loc9_21, %float.loc9_26) [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc9_14.1: bool = value_of_initializer %float.neq.loc9 [concrete = constants.%false]
-// CHECK:STDOUT:   %.loc9_14.2: bool = converted %float.neq.loc9, %.loc9_14.1 [concrete = 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 [concrete = 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 [concrete = 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 [concrete = constants.%False]
-// CHECK:STDOUT:   return
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: f64, %b.param: f64) -> bool {
@@ -229,69 +56,8 @@ fn WrongResult(a: f64, b: f64) -> f64 = "float.neq";
 // CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
 // CHECK:STDOUT:   %float.neq: init bool = call %Neq.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc13_19.1: bool = value_of_initializer %float.neq
-// CHECK:STDOUT:   %.loc13_19.2: bool = converted %float.neq, %.loc13_19.1
-// CHECK:STDOUT:   return %.loc13_19.2
+// CHECK:STDOUT:   %.loc16_19.1: bool = value_of_initializer %float.neq
+// CHECK:STDOUT:   %.loc16_19.2: bool = converted %float.neq, %.loc16_19.1
+// CHECK:STDOUT:   return %.loc16_19.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: --- fail_bad_decl.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %WrongResult.type: type = fn_type @WrongResult [concrete]
-// CHECK:STDOUT:   %WrongResult: %WrongResult.type = struct_value () [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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 [concrete = constants.%WrongResult] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc8_35: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc8_35: init type = call constants.%Float(%int_64.loc8_35) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_35.1: type = value_of_initializer %float.make_type.loc8_35 [concrete = f64]
-// CHECK:STDOUT:     %.loc8_35.2: type = converted %float.make_type.loc8_35, %.loc8_35.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc8_19.1: type = splice_block %.loc8_19.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc8_19: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc8_19: init type = call constants.%Float(%int_64.loc8_19) [concrete = f64]
-// CHECK:STDOUT:       %.loc8_19.2: type = value_of_initializer %float.make_type.loc8_19 [concrete = f64]
-// CHECK:STDOUT:       %.loc8_19.3: type = converted %float.make_type.loc8_19, %.loc8_19.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc8_27.1: type = splice_block %.loc8_27.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc8_27: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc8_27: init type = call constants.%Float(%int_64.loc8_27) [concrete = f64]
-// CHECK:STDOUT:       %.loc8_27.2: type = value_of_initializer %float.make_type.loc8_27 [concrete = f64]
-// CHECK:STDOUT:       %.loc8_27.3: type = converted %float.make_type.loc8_27, %.loc8_27.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @WrongResult(%a.param: f64, %b.param: f64) -> f64;
-// CHECK:STDOUT:

+ 33 - 431
toolchain/check/testdata/builtins/float/sub.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/float/sub.carbon
@@ -10,43 +12,56 @@
 
 // --- float_sub.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Sub(a: f64, b: f64) -> f64 = "float.sub";
 
 fn RuntimeCallIsValid(a: f64, b: f64) -> f64 {
+  //@dump-sem-ir-begin
   return Sub(a, b);
+  //@dump-sem-ir-end
 }
 
 var x: f64 = Sub(2.0, 0.5);
 
-// --- fail_bad_decl.carbon
+// --- fail_too_few.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.sub" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.sub" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn TooFew(a: f64) -> f64 = "float.sub";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn TooFew(a: f64) -> f64 = "float.sub";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.sub" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.sub";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.sub";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.sub" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.sub";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn BadReturnType(a: f64, b: f64) -> bool = "float.sub";
-fn JustRight(a: f64, b: f64) -> f64 = "float.sub";
 
 fn RuntimeCallIsValidTooFew(a: f64) -> f64 {
   return TooFew(a);
 }
 
+// --- fail_too_many.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.sub" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.sub";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn TooMany(a: f64, b: f64, c: f64) -> f64 = "float.sub";
+
 fn RuntimeCallIsValidTooMany(a: f64, b: f64, c: f64) -> f64 {
   return TooMany(a, b, c);
 }
 
+// --- fail_bad_return_type.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "float.sub" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn BadReturnType(a: f64, b: f64) -> bool = "float.sub";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn BadReturnType(a: f64, b: f64) -> bool = "float.sub";
+
 fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool {
   return BadReturnType(a, b);
 }
@@ -54,439 +69,26 @@ fn RuntimeCallIsValidBadReturnType(a: f64, b: f64) -> bool {
 // CHECK:STDOUT: --- float_sub.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
 // CHECK:STDOUT:   %Sub.type: type = fn_type @Sub [concrete]
 // CHECK:STDOUT:   %Sub: %Sub.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid.type: type = fn_type @RuntimeCallIsValid [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValid: %RuntimeCallIsValid.type = struct_value () [concrete]
-// CHECK:STDOUT:   %float.be3: f64 = float_literal 2 [concrete]
-// CHECK:STDOUT:   %float.c22: f64 = float_literal 0.5 [concrete]
-// CHECK:STDOUT:   %float.e93: f64 = float_literal 1.5 [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .Sub = %Sub.decl
-// CHECK:STDOUT:     .RuntimeCallIsValid = %RuntimeCallIsValid.decl
-// CHECK:STDOUT:     .x = %x
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Sub.decl: %Sub.type = fn_decl @Sub [concrete = constants.%Sub] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc2_27: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc2_27: init type = call constants.%Float(%int_64.loc2_27) [concrete = f64]
-// CHECK:STDOUT:     %.loc2_27.1: type = value_of_initializer %float.make_type.loc2_27 [concrete = f64]
-// CHECK:STDOUT:     %.loc2_27.2: type = converted %float.make_type.loc2_27, %.loc2_27.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc2_11.1: type = splice_block %.loc2_11.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_11: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_11: init type = call constants.%Float(%int_64.loc2_11) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_11.2: type = value_of_initializer %float.make_type.loc2_11 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_11.3: type = converted %float.make_type.loc2_11, %.loc2_11.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc2_19.1: type = splice_block %.loc2_19.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc2_19: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc2_19: init type = call constants.%Float(%int_64.loc2_19) [concrete = f64]
-// CHECK:STDOUT:       %.loc2_19.2: type = value_of_initializer %float.make_type.loc2_19 [concrete = f64]
-// CHECK:STDOUT:       %.loc2_19.3: type = converted %float.make_type.loc2_19, %.loc2_19.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValid.decl: %RuntimeCallIsValid.type = fn_decl @RuntimeCallIsValid [concrete = constants.%RuntimeCallIsValid] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc4_42: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc4_42: init type = call constants.%Float(%int_64.loc4_42) [concrete = f64]
-// CHECK:STDOUT:     %.loc4_42.1: type = value_of_initializer %float.make_type.loc4_42 [concrete = f64]
-// CHECK:STDOUT:     %.loc4_42.2: type = converted %float.make_type.loc4_42, %.loc4_42.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc4_26.1: type = splice_block %.loc4_26.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc4_26: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc4_26: init type = call constants.%Float(%int_64.loc4_26) [concrete = f64]
-// CHECK:STDOUT:       %.loc4_26.2: type = value_of_initializer %float.make_type.loc4_26 [concrete = f64]
-// CHECK:STDOUT:       %.loc4_26.3: type = converted %float.make_type.loc4_26, %.loc4_26.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc4_34.1: type = splice_block %.loc4_34.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc4_34: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc4_34: init type = call constants.%Float(%int_64.loc4_34) [concrete = f64]
-// CHECK:STDOUT:       %.loc4_34.2: type = value_of_initializer %float.make_type.loc4_34 [concrete = f64]
-// CHECK:STDOUT:       %.loc4_34.3: type = converted %float.make_type.loc4_34, %.loc4_34.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %x.patt: %pattern_type.3de = binding_pattern x [concrete]
-// CHECK:STDOUT:     %x.var_patt: %pattern_type.3de = var_pattern %x.patt [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %x.var: ref f64 = var %x.var_patt [concrete]
-// CHECK:STDOUT:   %.loc8_8.1: type = splice_block %.loc8_8.3 [concrete = f64] {
-// CHECK:STDOUT:     %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type: init type = call constants.%Float(%int_64) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_8.2: type = value_of_initializer %float.make_type [concrete = f64]
-// CHECK:STDOUT:     %.loc8_8.3: type = converted %float.make_type, %.loc8_8.2 [concrete = f64]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %x: ref f64 = bind_name x, %x.var
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Sub(%a.param: f64, %b.param: f64) -> f64 = "float.sub";
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: f64, %b.param: f64) -> f64 {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [concrete = constants.%Sub]
 // CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
 // CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
 // CHECK:STDOUT:   %float.sub: init f64 = call %Sub.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc5_19.1: f64 = value_of_initializer %float.sub
-// CHECK:STDOUT:   %.loc5_19.2: f64 = converted %float.sub, %.loc5_19.1
-// CHECK:STDOUT:   return %.loc5_19.2
+// CHECK:STDOUT:   %.loc8_19.1: f64 = value_of_initializer %float.sub
+// CHECK:STDOUT:   %.loc8_19.2: f64 = converted %float.sub, %.loc8_19.1
+// CHECK:STDOUT:   return %.loc8_19.2
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %Sub.ref: %Sub.type = name_ref Sub, file.%Sub.decl [concrete = constants.%Sub]
-// CHECK:STDOUT:   %float.loc8_18: f64 = float_literal 2 [concrete = constants.%float.be3]
-// CHECK:STDOUT:   %float.loc8_23: f64 = float_literal 0.5 [concrete = constants.%float.c22]
-// CHECK:STDOUT:   %float.sub: init f64 = call %Sub.ref(%float.loc8_18, %float.loc8_23) [concrete = constants.%float.e93]
-// CHECK:STDOUT:   assign file.%x.var, %float.sub
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: --- fail_bad_decl.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
-// CHECK:STDOUT:   %Float.type: type = fn_type @Float [concrete]
-// CHECK:STDOUT:   %Float: %Float.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.3de: type = pattern_type f64 [concrete]
-// CHECK:STDOUT:   %TooFew.type: type = fn_type @TooFew [concrete]
-// CHECK:STDOUT:   %TooFew: %TooFew.type = struct_value () [concrete]
-// CHECK:STDOUT:   %TooMany.type: type = fn_type @TooMany [concrete]
-// CHECK:STDOUT:   %TooMany: %TooMany.type = struct_value () [concrete]
-// CHECK:STDOUT:   %Bool.type: type = fn_type @Bool [concrete]
-// CHECK:STDOUT:   %Bool: %Bool.type = struct_value () [concrete]
-// CHECK:STDOUT:   %pattern_type.831: type = pattern_type bool [concrete]
-// CHECK:STDOUT:   %BadReturnType.type: type = fn_type @BadReturnType [concrete]
-// CHECK:STDOUT:   %BadReturnType: %BadReturnType.type = struct_value () [concrete]
-// CHECK:STDOUT:   %JustRight.type: type = fn_type @JustRight [concrete]
-// CHECK:STDOUT:   %JustRight: %JustRight.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew.type: type = fn_type @RuntimeCallIsValidTooFew [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew: %RuntimeCallIsValidTooFew.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany.type: type = fn_type @RuntimeCallIsValidTooMany [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany: %RuntimeCallIsValidTooMany.type = struct_value () [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType.type: type = fn_type @RuntimeCallIsValidBadReturnType [concrete]
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType: %RuntimeCallIsValidBadReturnType.type = struct_value () [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Float = %Core.Float
-// CHECK:STDOUT:     .Bool = %Core.Bool
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Float: %Float.type = import_ref Core//prelude/types, Float, loaded [concrete = constants.%Float]
-// CHECK:STDOUT:   %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// 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:     .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 [concrete = constants.%TooFew] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc8_22: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc8_22: init type = call constants.%Float(%int_64.loc8_22) [concrete = f64]
-// CHECK:STDOUT:     %.loc8_22.1: type = value_of_initializer %float.make_type.loc8_22 [concrete = f64]
-// CHECK:STDOUT:     %.loc8_22.2: type = converted %float.make_type.loc8_22, %.loc8_22.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc8_14.1: type = splice_block %.loc8_14.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc8_14: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc8_14: init type = call constants.%Float(%int_64.loc8_14) [concrete = f64]
-// CHECK:STDOUT:       %.loc8_14.2: type = value_of_initializer %float.make_type.loc8_14 [concrete = f64]
-// CHECK:STDOUT:       %.loc8_14.3: type = converted %float.make_type.loc8_14, %.loc8_14.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %TooMany.decl: %TooMany.type = fn_decl @TooMany [concrete = constants.%TooMany] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %c.patt: %pattern_type.3de = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.param_patt: %pattern_type.3de = value_param_pattern %c.patt, call_param2 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param3 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc13_39: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc13_39: init type = call constants.%Float(%int_64.loc13_39) [concrete = f64]
-// CHECK:STDOUT:     %.loc13_39.1: type = value_of_initializer %float.make_type.loc13_39 [concrete = f64]
-// CHECK:STDOUT:     %.loc13_39.2: type = converted %float.make_type.loc13_39, %.loc13_39.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc13_15.1: type = splice_block %.loc13_15.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_15: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_15: init type = call constants.%Float(%int_64.loc13_15) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_15.2: type = value_of_initializer %float.make_type.loc13_15 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_15.3: type = converted %float.make_type.loc13_15, %.loc13_15.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc13_23.1: type = splice_block %.loc13_23.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_23: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_23: init type = call constants.%Float(%int_64.loc13_23) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_23.2: type = value_of_initializer %float.make_type.loc13_23 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_23.3: type = converted %float.make_type.loc13_23, %.loc13_23.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %c.param: f64 = value_param call_param2
-// CHECK:STDOUT:     %.loc13_31.1: type = splice_block %.loc13_31.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc13_31: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc13_31: init type = call constants.%Float(%int_64.loc13_31) [concrete = f64]
-// CHECK:STDOUT:       %.loc13_31.2: type = value_of_initializer %float.make_type.loc13_31 [concrete = f64]
-// CHECK:STDOUT:       %.loc13_31.3: type = converted %float.make_type.loc13_31, %.loc13_31.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %c: f64 = bind_name c, %c.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param3
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %BadReturnType.decl: %BadReturnType.type = fn_decl @BadReturnType [concrete = constants.%BadReturnType] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc18_37.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc18_37.2: type = converted %bool.make_type, %.loc18_37.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc18_21.1: type = splice_block %.loc18_21.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc18_21: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc18_21: init type = call constants.%Float(%int_64.loc18_21) [concrete = f64]
-// CHECK:STDOUT:       %.loc18_21.2: type = value_of_initializer %float.make_type.loc18_21 [concrete = f64]
-// CHECK:STDOUT:       %.loc18_21.3: type = converted %float.make_type.loc18_21, %.loc18_21.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc18_29.1: type = splice_block %.loc18_29.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc18_29: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc18_29: init type = call constants.%Float(%int_64.loc18_29) [concrete = f64]
-// CHECK:STDOUT:       %.loc18_29.2: type = value_of_initializer %float.make_type.loc18_29 [concrete = f64]
-// CHECK:STDOUT:       %.loc18_29.3: type = converted %float.make_type.loc18_29, %.loc18_29.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %JustRight.decl: %JustRight.type = fn_decl @JustRight [concrete = constants.%JustRight] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc19_33: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc19_33: init type = call constants.%Float(%int_64.loc19_33) [concrete = f64]
-// CHECK:STDOUT:     %.loc19_33.1: type = value_of_initializer %float.make_type.loc19_33 [concrete = f64]
-// CHECK:STDOUT:     %.loc19_33.2: type = converted %float.make_type.loc19_33, %.loc19_33.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc19_17.1: type = splice_block %.loc19_17.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc19_17: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc19_17: init type = call constants.%Float(%int_64.loc19_17) [concrete = f64]
-// CHECK:STDOUT:       %.loc19_17.2: type = value_of_initializer %float.make_type.loc19_17 [concrete = f64]
-// CHECK:STDOUT:       %.loc19_17.3: type = converted %float.make_type.loc19_17, %.loc19_17.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc19_25.1: type = splice_block %.loc19_25.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc19_25: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc19_25: init type = call constants.%Float(%int_64.loc19_25) [concrete = f64]
-// CHECK:STDOUT:       %.loc19_25.2: type = value_of_initializer %float.make_type.loc19_25 [concrete = f64]
-// CHECK:STDOUT:       %.loc19_25.3: type = converted %float.make_type.loc19_25, %.loc19_25.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param2
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidTooFew.decl: %RuntimeCallIsValidTooFew.type = fn_decl @RuntimeCallIsValidTooFew [concrete = constants.%RuntimeCallIsValidTooFew] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc21_40: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc21_40: init type = call constants.%Float(%int_64.loc21_40) [concrete = f64]
-// CHECK:STDOUT:     %.loc21_40.1: type = value_of_initializer %float.make_type.loc21_40 [concrete = f64]
-// CHECK:STDOUT:     %.loc21_40.2: type = converted %float.make_type.loc21_40, %.loc21_40.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc21_32.1: type = splice_block %.loc21_32.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc21_32: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc21_32: init type = call constants.%Float(%int_64.loc21_32) [concrete = f64]
-// CHECK:STDOUT:       %.loc21_32.2: type = value_of_initializer %float.make_type.loc21_32 [concrete = f64]
-// CHECK:STDOUT:       %.loc21_32.3: type = converted %float.make_type.loc21_32, %.loc21_32.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param1
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidTooMany.decl: %RuntimeCallIsValidTooMany.type = fn_decl @RuntimeCallIsValidTooMany [concrete = constants.%RuntimeCallIsValidTooMany] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %c.patt: %pattern_type.3de = binding_pattern c [concrete]
-// CHECK:STDOUT:     %c.param_patt: %pattern_type.3de = value_param_pattern %c.patt, call_param2 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.3de = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.3de = out_param_pattern %return.patt, call_param3 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_64.loc25_57: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:     %float.make_type.loc25_57: init type = call constants.%Float(%int_64.loc25_57) [concrete = f64]
-// CHECK:STDOUT:     %.loc25_57.1: type = value_of_initializer %float.make_type.loc25_57 [concrete = f64]
-// CHECK:STDOUT:     %.loc25_57.2: type = converted %float.make_type.loc25_57, %.loc25_57.1 [concrete = f64]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc25_33.1: type = splice_block %.loc25_33.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_33: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_33: init type = call constants.%Float(%int_64.loc25_33) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_33.2: type = value_of_initializer %float.make_type.loc25_33 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_33.3: type = converted %float.make_type.loc25_33, %.loc25_33.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc25_41.1: type = splice_block %.loc25_41.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_41: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_41: init type = call constants.%Float(%int_64.loc25_41) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_41.2: type = value_of_initializer %float.make_type.loc25_41 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_41.3: type = converted %float.make_type.loc25_41, %.loc25_41.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %c.param: f64 = value_param call_param2
-// CHECK:STDOUT:     %.loc25_49.1: type = splice_block %.loc25_49.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc25_49: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc25_49: init type = call constants.%Float(%int_64.loc25_49) [concrete = f64]
-// CHECK:STDOUT:       %.loc25_49.2: type = value_of_initializer %float.make_type.loc25_49 [concrete = f64]
-// CHECK:STDOUT:       %.loc25_49.3: type = converted %float.make_type.loc25_49, %.loc25_49.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %c: f64 = bind_name c, %c.param
-// CHECK:STDOUT:     %return.param: ref f64 = out_param call_param3
-// CHECK:STDOUT:     %return: ref f64 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %RuntimeCallIsValidBadReturnType.decl: %RuntimeCallIsValidBadReturnType.type = fn_decl @RuntimeCallIsValidBadReturnType [concrete = constants.%RuntimeCallIsValidBadReturnType] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.3de = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.3de = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %b.patt: %pattern_type.3de = binding_pattern b [concrete]
-// CHECK:STDOUT:     %b.param_patt: %pattern_type.3de = value_param_pattern %b.patt, call_param1 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.831 = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.831 = out_param_pattern %return.patt, call_param2 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %bool.make_type: init type = call constants.%Bool() [concrete = bool]
-// CHECK:STDOUT:     %.loc29_55.1: type = value_of_initializer %bool.make_type [concrete = bool]
-// CHECK:STDOUT:     %.loc29_55.2: type = converted %bool.make_type, %.loc29_55.1 [concrete = bool]
-// CHECK:STDOUT:     %a.param: f64 = value_param call_param0
-// CHECK:STDOUT:     %.loc29_39.1: type = splice_block %.loc29_39.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc29_39: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc29_39: init type = call constants.%Float(%int_64.loc29_39) [concrete = f64]
-// CHECK:STDOUT:       %.loc29_39.2: type = value_of_initializer %float.make_type.loc29_39 [concrete = f64]
-// CHECK:STDOUT:       %.loc29_39.3: type = converted %float.make_type.loc29_39, %.loc29_39.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: f64 = bind_name a, %a.param
-// CHECK:STDOUT:     %b.param: f64 = value_param call_param1
-// CHECK:STDOUT:     %.loc29_47.1: type = splice_block %.loc29_47.3 [concrete = f64] {
-// CHECK:STDOUT:       %int_64.loc29_47: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
-// CHECK:STDOUT:       %float.make_type.loc29_47: init type = call constants.%Float(%int_64.loc29_47) [concrete = f64]
-// CHECK:STDOUT:       %.loc29_47.2: type = value_of_initializer %float.make_type.loc29_47 [concrete = f64]
-// CHECK:STDOUT:       %.loc29_47.3: type = converted %float.make_type.loc29_47, %.loc29_47.2 [concrete = f64]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %b: f64 = bind_name b, %b.param
-// CHECK:STDOUT:     %return.param: ref bool = out_param call_param2
-// CHECK:STDOUT:     %return: ref bool = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @TooFew(%a.param: f64) -> f64;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @TooMany(%a.param: f64, %b.param: f64, %c.param: f64) -> f64;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @BadReturnType(%a.param: f64, %b.param: f64) -> bool;
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @JustRight(%a.param: f64, %b.param: f64) -> f64 = "float.sub";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidTooFew(%a.param: f64) -> f64 {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %TooFew.ref: %TooFew.type = name_ref TooFew, file.%TooFew.decl [concrete = constants.%TooFew]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %TooFew.call: init f64 = call %TooFew.ref(%a.ref)
-// CHECK:STDOUT:   %.loc22_19.1: f64 = value_of_initializer %TooFew.call
-// CHECK:STDOUT:   %.loc22_19.2: f64 = converted %TooFew.call, %.loc22_19.1
-// CHECK:STDOUT:   return %.loc22_19.2
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidTooMany(%a.param: f64, %b.param: f64, %c.param: f64) -> f64 {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %TooMany.ref: %TooMany.type = name_ref TooMany, file.%TooMany.decl [concrete = constants.%TooMany]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
-// CHECK:STDOUT:   %c.ref: f64 = name_ref c, %c
-// CHECK:STDOUT:   %TooMany.call: init f64 = call %TooMany.ref(%a.ref, %b.ref, %c.ref)
-// CHECK:STDOUT:   %.loc26_26.1: f64 = value_of_initializer %TooMany.call
-// CHECK:STDOUT:   %.loc26_26.2: f64 = converted %TooMany.call, %.loc26_26.1
-// CHECK:STDOUT:   return %.loc26_26.2
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @RuntimeCallIsValidBadReturnType(%a.param: f64, %b.param: f64) -> bool {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %BadReturnType.ref: %BadReturnType.type = name_ref BadReturnType, file.%BadReturnType.decl [concrete = constants.%BadReturnType]
-// CHECK:STDOUT:   %a.ref: f64 = name_ref a, %a
-// CHECK:STDOUT:   %b.ref: f64 = name_ref b, %b
-// CHECK:STDOUT:   %BadReturnType.call: init bool = call %BadReturnType.ref(%a.ref, %b.ref)
-// CHECK:STDOUT:   %.loc30_29.1: bool = value_of_initializer %BadReturnType.call
-// CHECK:STDOUT:   %.loc30_29.2: bool = converted %BadReturnType.call, %.loc30_29.1
-// CHECK:STDOUT:   return %.loc30_29.2
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 32 - 1
toolchain/check/testdata/builtins/int/and.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -20,7 +20,9 @@ var arr: array(i32, And(12, 10));
 let arr_p: array(i32, 8)* = &arr;
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return And(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- literal.carbon
@@ -120,3 +122,32 @@ fn Test(n: Core.IntLiteral()) {
   // CHECK:STDERR:
   And(n, n);
 }
+
+// CHECK:STDOUT: --- int_and.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %And.type: type = fn_type @And [concrete]
+// CHECK:STDOUT:   %And: %And.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %And.ref: %And.type = name_ref And, file.%And.decl [concrete = 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:   %.loc11_19.1: %i32 = value_of_initializer %int.and
+// CHECK:STDOUT:   %.loc11_19.2: %i32 = converted %int.and, %.loc11_19.1
+// CHECK:STDOUT:   return %.loc11_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 36 - 4
toolchain/check/testdata/builtins/int/and_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.and_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -30,18 +32,48 @@ library "[[@TEST_NAME]]";
 // CHECK:STDERR:
 fn Builtin(a: Core.IntLiteral()*, b: Core.IntLiteral()) = "int.and_assign";
 
-// --- fail_bad_decl.carbon
+// --- fail_not_ptr.carbon
 
 library "[[@TEST_NAME]]";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.and_assign" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_not_ptr.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.and_assign" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn NotPtr(a: i32, b: i32) = "int.and_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn NotPtr(a: i32, b: i32) = "int.and_assign";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.and_assign" [InvalidBuiltinSignature]
+// TODO: There's a crash bug preventing splitting tests, it'd probably be good
+// to split. (also, look at examples in other files)
+// // --- fail_not_ptr.carbon
+//
+// library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_not_ptr.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.and_assign" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn MixedTypes(a: i32*, b: i64) = "int.and_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.and_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.and_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 31 - 1
toolchain/check/testdata/builtins/int/complement.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -21,7 +21,9 @@ var arr: array(i32, And(Complement(0x123456), 0xFFFFFF));
 let arr_p: array(i32, 0xEDCBA9)* = &arr;
 
 fn RuntimeCallIsValid(a: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Complement(a);
+  //@dump-sem-ir-end
 }
 
 // --- literal.carbon
@@ -59,3 +61,31 @@ fn F(a: Core.IntLiteral()) -> Core.IntLiteral() {
   // CHECK:STDERR:
   return Complement(a);
 }
+
+// CHECK:STDOUT: --- int_complement.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Complement.type: type = fn_type @Complement [concrete]
+// CHECK:STDOUT:   %Complement: %Complement.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Complement.ref: %Complement.type = name_ref Complement, file.%Complement.decl [concrete = constants.%Complement]
+// CHECK:STDOUT:   %a.ref: %i32 = name_ref a, %a
+// CHECK:STDOUT:   %int.complement: init %i32 = call %Complement.ref(%a.ref)
+// CHECK:STDOUT:   %.loc12_23.1: %i32 = value_of_initializer %int.complement
+// CHECK:STDOUT:   %.loc12_23.2: %i32 = converted %int.complement, %.loc12_23.1
+// CHECK:STDOUT:   return %.loc12_23.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 79 - 1
toolchain/check/testdata/builtins/int/convert.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -40,6 +40,29 @@ fn Uint32ToIntLiteral(a: u32) -> Core.IntLiteral() = "int.convert";
 class Expect[T:! type](N:! T) {}
 fn Test[T:! type](N:! T) -> Expect(N) { return {}; }
 
+// --- runtime_call.carbon
+
+library "[[@TEST_NAME]]";
+import library "int_ops";
+
+fn SizePreserving(a: i32) -> u32 {
+  //@dump-sem-ir-begin
+  return Int32ToUint32(a);
+  //@dump-sem-ir-end
+}
+
+fn Narrowing(a: i32) -> i16 {
+  //@dump-sem-ir-begin
+  return Int32ToInt16(a);
+  //@dump-sem-ir-end
+}
+
+fn Widening(a: i32) -> i64 {
+  //@dump-sem-ir-begin
+  return Int32ToInt64(a);
+  //@dump-sem-ir-end
+}
+
 // --- fail_self_test.carbon
 
 library "[[@TEST_NAME]]";
@@ -225,3 +248,58 @@ let not_constant: Core.IntLiteral() = 0;
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 let convert_not_constant: i16 = IntLiteralToInt16(not_constant);
+
+// CHECK:STDOUT: --- runtime_call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %u32: type = class_type @UInt, @UInt(%int_32) [concrete]
+// CHECK:STDOUT:   %Int32ToUint32.type: type = fn_type @Int32ToUint32 [concrete]
+// CHECK:STDOUT:   %Int32ToUint32: %Int32ToUint32.type = struct_value () [concrete]
+// CHECK:STDOUT:   %int_16: Core.IntLiteral = int_value 16 [concrete]
+// CHECK:STDOUT:   %i16: type = class_type @Int, @Int(%int_16) [concrete]
+// CHECK:STDOUT:   %Int32ToInt16.type: type = fn_type @Int32ToInt16 [concrete]
+// CHECK:STDOUT:   %Int32ToInt16: %Int32ToInt16.type = struct_value () [concrete]
+// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
+// CHECK:STDOUT:   %i64: type = class_type @Int, @Int(%int_64) [concrete]
+// CHECK:STDOUT:   %Int32ToInt64.type: type = fn_type @Int32ToInt64 [concrete]
+// CHECK:STDOUT:   %Int32ToInt64: %Int32ToInt64.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT:   %Main.Int32ToUint32: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [concrete = constants.%Int32ToUint32]
+// CHECK:STDOUT:   %Main.Int32ToInt16: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [concrete = constants.%Int32ToInt16]
+// CHECK:STDOUT:   %Main.Int32ToInt64: %Int32ToInt64.type = import_ref Main//int_ops, Int32ToInt64, loaded [concrete = constants.%Int32ToInt64]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @SizePreserving(%a.param: %i32) -> %u32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%Main.Int32ToUint32 [concrete = constants.%Int32ToUint32]
+// CHECK:STDOUT:   %a.ref: %i32 = name_ref a, %a
+// CHECK:STDOUT:   %int.convert: init %u32 = call %Int32ToUint32.ref(%a.ref)
+// CHECK:STDOUT:   %.loc7_26.1: %u32 = value_of_initializer %int.convert
+// CHECK:STDOUT:   %.loc7_26.2: %u32 = converted %int.convert, %.loc7_26.1
+// CHECK:STDOUT:   return %.loc7_26.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Narrowing(%a.param: %i32) -> %i16 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%Main.Int32ToInt16 [concrete = constants.%Int32ToInt16]
+// CHECK:STDOUT:   %a.ref: %i32 = name_ref a, %a
+// CHECK:STDOUT:   %int.convert: init %i16 = call %Int32ToInt16.ref(%a.ref)
+// CHECK:STDOUT:   %.loc13_25.1: %i16 = value_of_initializer %int.convert
+// CHECK:STDOUT:   %.loc13_25.2: %i16 = converted %int.convert, %.loc13_25.1
+// CHECK:STDOUT:   return %.loc13_25.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Widening(%a.param: %i32) -> %i64 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Int32ToInt64.ref: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%Main.Int32ToInt64 [concrete = constants.%Int32ToInt64]
+// CHECK:STDOUT:   %a.ref: %i32 = name_ref a, %a
+// CHECK:STDOUT:   %int.convert: init %i64 = call %Int32ToInt64.ref(%a.ref)
+// CHECK:STDOUT:   %.loc19_25.1: %i64 = value_of_initializer %int.convert
+// CHECK:STDOUT:   %.loc19_25.2: %i64 = converted %int.convert, %.loc19_25.1
+// CHECK:STDOUT:   return %.loc19_25.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 128 - 1
toolchain/check/testdata/builtins/int/convert_checked.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -43,6 +43,17 @@ fn Uint32ToUint64(a: u32) -> u64 = "int.convert_checked";
 fn Int32ToIntLiteral(a: i32) -> IntLiteral() = "int.convert_checked";
 fn Uint32ToUintLiteral(a: u32) -> IntLiteral() = "int.convert_checked";
 
+// --- runtime_call.carbon
+
+library "[[@TEST_NAME]]";
+import library "int_ops";
+
+//@dump-sem-ir-begin
+let SizePreserving: u32 = Int32ToUint32(1);
+let Narrowing: i16 = Int32ToInt16(1);
+let Widening: i64 = Int32ToInt64(1);
+//@dump-sem-ir-end
+
 // --- identity.carbon
 
 library "[[@TEST_NAME]]";
@@ -250,3 +261,119 @@ let convert_not_constant_same: i32 = Int32ToInt32(not_constant);
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 let convert_not_constant_widen: i64 = Int32ToInt64(not_constant);
+
+// CHECK:STDOUT: --- runtime_call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %u32: type = class_type @UInt, @UInt(%int_32) [concrete]
+// CHECK:STDOUT:   %pattern_type.4a9: type = pattern_type %u32 [concrete]
+// CHECK:STDOUT:   %Int32ToUint32.type: type = fn_type @Int32ToUint32 [concrete]
+// CHECK:STDOUT:   %Int32ToUint32: %Int32ToUint32.type = struct_value () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
+// CHECK:STDOUT:   %ImplicitAs.type.9ba: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
+// CHECK:STDOUT:   %Convert.type.6da: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete]
+// CHECK:STDOUT:   %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic]
+// CHECK:STDOUT:   %Convert.type.0b2: type = fn_type @Convert.2, @impl.c81(%To.c80) [symbolic]
+// CHECK:STDOUT:   %Convert.6d7: %Convert.type.0b2 = struct_value () [symbolic]
+// CHECK:STDOUT:   %ImplicitAs.impl_witness.e34: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.e36, @impl.c81(%int_32) [concrete]
+// CHECK:STDOUT:   %Convert.type.ed5: type = fn_type @Convert.2, @impl.c81(%int_32) [concrete]
+// CHECK:STDOUT:   %Convert.16d: %Convert.type.ed5 = struct_value () [concrete]
+// CHECK:STDOUT:   %ImplicitAs.facet: %ImplicitAs.type.9ba = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.e34) [concrete]
+// CHECK:STDOUT:   %.d6a: type = fn_type_with_self_type %Convert.type.6da, %ImplicitAs.facet [concrete]
+// CHECK:STDOUT:   %Convert.bound: <bound method> = bound_method %int_1.5b8, %Convert.16d [concrete]
+// CHECK:STDOUT:   %Convert.specific_fn: <specific function> = specific_function %Convert.16d, @Convert.2(%int_32) [concrete]
+// CHECK:STDOUT:   %bound_method: <bound method> = bound_method %int_1.5b8, %Convert.specific_fn [concrete]
+// CHECK:STDOUT:   %int_1.47b: %i32 = int_value 1 [concrete]
+// CHECK:STDOUT:   %int_1.c1d: %u32 = int_value 1 [concrete]
+// CHECK:STDOUT:   %int_16: Core.IntLiteral = int_value 16 [concrete]
+// CHECK:STDOUT:   %i16: type = class_type @Int, @Int(%int_16) [concrete]
+// CHECK:STDOUT:   %pattern_type.88f: type = pattern_type %i16 [concrete]
+// CHECK:STDOUT:   %Int32ToInt16.type: type = fn_type @Int32ToInt16 [concrete]
+// CHECK:STDOUT:   %Int32ToInt16: %Int32ToInt16.type = struct_value () [concrete]
+// CHECK:STDOUT:   %int_1.c22: %i16 = int_value 1 [concrete]
+// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
+// CHECK:STDOUT:   %i64: type = class_type @Int, @Int(%int_64) [concrete]
+// CHECK:STDOUT:   %pattern_type.a10: type = pattern_type %i64 [concrete]
+// CHECK:STDOUT:   %Int32ToInt64.type: type = fn_type @Int32ToInt64 [concrete]
+// CHECK:STDOUT:   %Int32ToInt64: %Int32ToInt64.type = struct_value () [concrete]
+// CHECK:STDOUT:   %int_1.a95: %i64 = int_value 1 [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT:   %Main.Int32ToUint32: %Int32ToUint32.type = import_ref Main//int_ops, Int32ToUint32, loaded [concrete = constants.%Int32ToUint32]
+// CHECK:STDOUT:   %Main.Int32ToInt16: %Int32ToInt16.type = import_ref Main//int_ops, Int32ToInt16, loaded [concrete = constants.%Int32ToInt16]
+// CHECK:STDOUT:   %Main.Int32ToInt64: %Int32ToInt64.type = import_ref Main//int_ops, Int32ToInt64, loaded [concrete = constants.%Int32ToInt64]
+// CHECK:STDOUT:   %Core.import_ref.a86: @impl.c81.%Convert.type (%Convert.type.0b2) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.c81.%Convert (constants.%Convert.6d7)]
+// CHECK:STDOUT:   %ImplicitAs.impl_witness_table.e36 = impl_witness_table (%Core.import_ref.a86), @impl.c81 [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: file {
+// CHECK:STDOUT:   name_binding_decl {
+// CHECK:STDOUT:     %SizePreserving.patt: %pattern_type.4a9 = binding_pattern SizePreserving [concrete]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc6_21: type = splice_block %u32 [concrete = constants.%u32] {
+// CHECK:STDOUT:     %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
+// CHECK:STDOUT:     %u32: type = class_type @UInt, @UInt(constants.%int_32) [concrete = constants.%u32]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc6_42.1: ref %u32 = temporary_storage
+// CHECK:STDOUT:   %.loc6_42.2: ref %u32 = temporary %.loc6_42.1, @__global_init.%int.convert_checked.loc6_42
+// CHECK:STDOUT:   %SizePreserving: ref %u32 = bind_name SizePreserving, %.loc6_42.2
+// CHECK:STDOUT:   name_binding_decl {
+// CHECK:STDOUT:     %Narrowing.patt: %pattern_type.88f = binding_pattern Narrowing [concrete]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc7_16: type = splice_block %i16 [concrete = constants.%i16] {
+// CHECK:STDOUT:     %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
+// CHECK:STDOUT:     %i16: type = class_type @Int, @Int(constants.%int_16) [concrete = constants.%i16]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc7_36.1: ref %i16 = temporary_storage
+// CHECK:STDOUT:   %.loc7_36.2: ref %i16 = temporary %.loc7_36.1, @__global_init.%int.convert_checked.loc7_36
+// CHECK:STDOUT:   %Narrowing: ref %i16 = bind_name Narrowing, %.loc7_36.2
+// CHECK:STDOUT:   name_binding_decl {
+// CHECK:STDOUT:     %Widening.patt: %pattern_type.a10 = binding_pattern Widening [concrete]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc8_15: type = splice_block %i64 [concrete = constants.%i64] {
+// CHECK:STDOUT:     %int_64: Core.IntLiteral = int_value 64 [concrete = constants.%int_64]
+// CHECK:STDOUT:     %i64: type = class_type @Int, @Int(constants.%int_64) [concrete = constants.%i64]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc8_35.1: ref %i64 = temporary_storage
+// CHECK:STDOUT:   %.loc8_35.2: ref %i64 = temporary %.loc8_35.1, @__global_init.%int.convert_checked.loc8_35
+// CHECK:STDOUT:   %Widening: ref %i64 = bind_name Widening, %.loc8_35.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Int32ToUint32.ref: %Int32ToUint32.type = name_ref Int32ToUint32, imports.%Main.Int32ToUint32 [concrete = constants.%Int32ToUint32]
+// CHECK:STDOUT:   %int_1.loc6: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
+// CHECK:STDOUT:   %impl.elem0.loc6: %.d6a = impl_witness_access constants.%ImplicitAs.impl_witness.e34, element0 [concrete = constants.%Convert.16d]
+// CHECK:STDOUT:   %bound_method.loc6_41.1: <bound method> = bound_method %int_1.loc6, %impl.elem0.loc6 [concrete = constants.%Convert.bound]
+// CHECK:STDOUT:   %specific_fn.loc6: <specific function> = specific_function %impl.elem0.loc6, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
+// CHECK:STDOUT:   %bound_method.loc6_41.2: <bound method> = bound_method %int_1.loc6, %specific_fn.loc6 [concrete = constants.%bound_method]
+// CHECK:STDOUT:   %int.convert_checked.loc6_41: init %i32 = call %bound_method.loc6_41.2(%int_1.loc6) [concrete = constants.%int_1.47b]
+// CHECK:STDOUT:   %.loc6_41.1: %i32 = value_of_initializer %int.convert_checked.loc6_41 [concrete = constants.%int_1.47b]
+// CHECK:STDOUT:   %.loc6_41.2: %i32 = converted %int_1.loc6, %.loc6_41.1 [concrete = constants.%int_1.47b]
+// CHECK:STDOUT:   %int.convert_checked.loc6_42: init %u32 = call %Int32ToUint32.ref(%.loc6_41.2) [concrete = constants.%int_1.c1d]
+// CHECK:STDOUT:   %Int32ToInt16.ref: %Int32ToInt16.type = name_ref Int32ToInt16, imports.%Main.Int32ToInt16 [concrete = constants.%Int32ToInt16]
+// CHECK:STDOUT:   %int_1.loc7: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
+// CHECK:STDOUT:   %impl.elem0.loc7: %.d6a = impl_witness_access constants.%ImplicitAs.impl_witness.e34, element0 [concrete = constants.%Convert.16d]
+// CHECK:STDOUT:   %bound_method.loc7_35.1: <bound method> = bound_method %int_1.loc7, %impl.elem0.loc7 [concrete = constants.%Convert.bound]
+// CHECK:STDOUT:   %specific_fn.loc7: <specific function> = specific_function %impl.elem0.loc7, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
+// CHECK:STDOUT:   %bound_method.loc7_35.2: <bound method> = bound_method %int_1.loc7, %specific_fn.loc7 [concrete = constants.%bound_method]
+// CHECK:STDOUT:   %int.convert_checked.loc7_35: init %i32 = call %bound_method.loc7_35.2(%int_1.loc7) [concrete = constants.%int_1.47b]
+// CHECK:STDOUT:   %.loc7_35.1: %i32 = value_of_initializer %int.convert_checked.loc7_35 [concrete = constants.%int_1.47b]
+// CHECK:STDOUT:   %.loc7_35.2: %i32 = converted %int_1.loc7, %.loc7_35.1 [concrete = constants.%int_1.47b]
+// CHECK:STDOUT:   %int.convert_checked.loc7_36: init %i16 = call %Int32ToInt16.ref(%.loc7_35.2) [concrete = constants.%int_1.c22]
+// CHECK:STDOUT:   %Int32ToInt64.ref: %Int32ToInt64.type = name_ref Int32ToInt64, imports.%Main.Int32ToInt64 [concrete = constants.%Int32ToInt64]
+// CHECK:STDOUT:   %int_1.loc8: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
+// CHECK:STDOUT:   %impl.elem0.loc8: %.d6a = impl_witness_access constants.%ImplicitAs.impl_witness.e34, element0 [concrete = constants.%Convert.16d]
+// CHECK:STDOUT:   %bound_method.loc8_34.1: <bound method> = bound_method %int_1.loc8, %impl.elem0.loc8 [concrete = constants.%Convert.bound]
+// CHECK:STDOUT:   %specific_fn.loc8: <specific function> = specific_function %impl.elem0.loc8, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
+// CHECK:STDOUT:   %bound_method.loc8_34.2: <bound method> = bound_method %int_1.loc8, %specific_fn.loc8 [concrete = constants.%bound_method]
+// CHECK:STDOUT:   %int.convert_checked.loc8_34: init %i32 = call %bound_method.loc8_34.2(%int_1.loc8) [concrete = constants.%int_1.47b]
+// CHECK:STDOUT:   %.loc8_34.1: %i32 = value_of_initializer %int.convert_checked.loc8_34 [concrete = constants.%int_1.47b]
+// CHECK:STDOUT:   %.loc8_34.2: %i32 = converted %int_1.loc8, %.loc8_34.1 [concrete = constants.%int_1.47b]
+// CHECK:STDOUT:   %int.convert_checked.loc8_35: init %i64 = call %Int32ToInt64.ref(%.loc8_34.2) [concrete = constants.%int_1.a95]
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 28 - 2
toolchain/check/testdata/builtins/int/eq.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -25,12 +25,14 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> bool {
+  //@dump-sem-ir-begin
   return Eq(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_bad_decl.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
 // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.eq" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn WrongResult(a: i32, b: i32) -> i32 = "int.eq";
@@ -104,3 +106,27 @@ fn Test(n: Core.IntLiteral()) {
   // CHECK:STDERR:
   Eq(n, n);
 }
+
+// CHECK:STDOUT: --- int_eq.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Eq.type.e7f: type = fn_type @Eq.1 [concrete]
+// CHECK:STDOUT:   %Eq: %Eq.type.e7f = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> bool {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Eq.ref: %Eq.type.e7f = name_ref Eq, file.%Eq.decl [concrete = 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:   %.loc16_18.1: bool = value_of_initializer %int.eq
+// CHECK:STDOUT:   %.loc16_18.2: bool = converted %int.eq, %.loc16_18.1
+// CHECK:STDOUT:   return %.loc16_18.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/greater.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -27,5 +27,31 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> bool {
+  //@dump-sem-ir-begin
   return Greater(a, b);
+  //@dump-sem-ir-end
 }
+
+// CHECK:STDOUT: --- int_greater.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Greater.type.bf7: type = fn_type @Greater.1 [concrete]
+// CHECK:STDOUT:   %Greater.b2c: %Greater.type.bf7 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> bool {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Greater.ref: %Greater.type.bf7 = name_ref Greater, file.%Greater.decl [concrete = constants.%Greater.b2c]
+// 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:   %.loc18_23.1: bool = value_of_initializer %int.greater
+// CHECK:STDOUT:   %.loc18_23.2: bool = converted %int.greater, %.loc18_23.1
+// CHECK:STDOUT:   return %.loc18_23.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/greater_eq.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -29,7 +29,9 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> bool {
+  //@dump-sem-ir-begin
   return GreaterEq(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- literal.carbon
@@ -67,3 +69,27 @@ fn F() {
   Test(GreaterEq(-1, 1)) as Expect(false);
   Test(GreaterEq(1, -1)) as Expect(true);
 }
+
+// CHECK:STDOUT: --- int_greater_eq.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %GreaterEq.type: type = fn_type @GreaterEq [concrete]
+// CHECK:STDOUT:   %GreaterEq: %GreaterEq.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> bool {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %GreaterEq.ref: %GreaterEq.type = name_ref GreaterEq, file.%GreaterEq.decl [concrete = 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:   %.loc20_25.1: bool = value_of_initializer %int.greater_eq
+// CHECK:STDOUT:   %.loc20_25.2: bool = converted %int.greater_eq, %.loc20_25.1
+// CHECK:STDOUT:   return %.loc20_25.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 53 - 1
toolchain/check/testdata/builtins/int/left_shift.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -31,7 +31,9 @@ fn F() {
 }
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return LeftShift(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- u32.carbon
@@ -55,7 +57,9 @@ fn F() {
 }
 
 fn RuntimeCall(a: u32, b: i32) -> u32 {
+  //@dump-sem-ir-begin
   return LeftShift(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- literal.carbon
@@ -223,3 +227,51 @@ let bad3: i32 = LeftShiftByLit(an_i32, 12);
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 let bad4: Core.IntLiteral() = LeftShiftOfLit(12, an_i32);
+
+// CHECK:STDOUT: --- i32.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %LeftShift.type.ed3: type = fn_type @LeftShift.1 [concrete]
+// CHECK:STDOUT:   %LeftShift: %LeftShift.type.ed3 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %LeftShift.ref: %LeftShift.type.ed3 = name_ref LeftShift, file.%LeftShift.decl [concrete = 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:   %.loc22_25.1: %i32 = value_of_initializer %int.left_shift
+// CHECK:STDOUT:   %.loc22_25.2: %i32 = converted %int.left_shift, %.loc22_25.1
+// CHECK:STDOUT:   return %.loc22_25.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: --- u32.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %u32: type = class_type @UInt, @UInt(%int_32) [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %LeftShift.type.ed3: type = fn_type @LeftShift.1 [concrete]
+// CHECK:STDOUT:   %LeftShift: %LeftShift.type.ed3 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCall(%a.param: %u32, %b.param: %i32) -> %u32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %LeftShift.ref: %LeftShift.type.ed3 = name_ref LeftShift, file.%LeftShift.decl [concrete = constants.%LeftShift]
+// CHECK:STDOUT:   %a.ref: %u32 = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.left_shift: init %u32 = call %LeftShift.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   %.loc22_25.1: %u32 = value_of_initializer %int.left_shift
+// CHECK:STDOUT:   %.loc22_25.2: %u32 = converted %int.left_shift, %.loc22_25.1
+// CHECK:STDOUT:   return %.loc22_25.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 42 - 1
toolchain/check/testdata/builtins/int/left_shift_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,13 +17,17 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.left_shift_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 fn MixedTypes(a: i32*, b: i64) = "int.left_shift_assign";
 
 fn CallMixed(a: i32*, b: i64) {
+  //@dump-sem-ir-begin
   MixedTypes(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +49,40 @@ library "[[@TEST_NAME]]";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn NotPtr(a: i32, b: i32) = "int.left_shift_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
+// CHECK:STDOUT:   %i64: type = class_type @Int, @Int(%int_64) [concrete]
+// CHECK:STDOUT:   %MixedTypes.type: type = fn_type @MixedTypes [concrete]
+// CHECK:STDOUT:   %MixedTypes: %MixedTypes.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.left_shift_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @CallMixed(%a.param: %ptr, %b.param: %i64) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %MixedTypes.ref: %MixedTypes.type = name_ref MixedTypes, file.%MixedTypes.decl [concrete = constants.%MixedTypes]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i64 = name_ref b, %b
+// CHECK:STDOUT:   %int.left_shift_assign: init %empty_tuple.type = call %MixedTypes.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/less.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -27,5 +27,31 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> bool {
+  //@dump-sem-ir-begin
   return Less(a, b);
+  //@dump-sem-ir-end
 }
+
+// CHECK:STDOUT: --- int_less.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Less.type.3f8: type = fn_type @Less.1 [concrete]
+// CHECK:STDOUT:   %Less.f01: %Less.type.3f8 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> bool {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Less.ref: %Less.type.3f8 = name_ref Less, file.%Less.decl [concrete = constants.%Less.f01]
+// 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:   %.loc18_20.1: bool = value_of_initializer %int.less
+// CHECK:STDOUT:   %.loc18_20.2: bool = converted %int.less, %.loc18_20.1
+// CHECK:STDOUT:   return %.loc18_20.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/less_eq.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -29,7 +29,9 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> bool {
+  //@dump-sem-ir-begin
   return LessEq(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- literal.carbon
@@ -102,3 +104,27 @@ fn Test(n: Core.IntLiteral()) {
   // CHECK:STDERR:
   LessEq(n, n);
 }
+
+// CHECK:STDOUT: --- int_less_eq.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %LessEq.type: type = fn_type @LessEq [concrete]
+// CHECK:STDOUT:   %LessEq: %LessEq.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> bool {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %LessEq.ref: %LessEq.type = name_ref LessEq, file.%LessEq.decl [concrete = 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:   %.loc20_22.1: bool = value_of_initializer %int.less_eq
+// CHECK:STDOUT:   %.loc20_22.2: bool = converted %int.less_eq, %.loc20_22.1
+// CHECK:STDOUT:   return %.loc20_22.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 34 - 3
toolchain/check/testdata/builtins/int/make_type_signed.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -23,11 +23,19 @@ library "[[@TEST_NAME]]";
 
 import library "types";
 
-fn F(n: Int(64)) -> Int(64) {
+fn F(n: Int(64)) ->
+    //@dump-sem-ir-begin
+    Int(64)
+    //@dump-sem-ir-end
+    {
   return n;
 }
 
-fn G(n: Int(13)) -> Int(13) {
+fn G(n: Int(13)) ->
+    //@dump-sem-ir-begin
+    Int(13)
+    //@dump-sem-ir-end
+    {
   return n;
 }
 
@@ -91,3 +99,26 @@ import library "types";
 // CHECK:STDERR:        ^~~~~~~~~~~~~~~
 // CHECK:STDERR:
 var m: Int(1000000000);
+
+// CHECK:STDOUT: --- use_types.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
+// CHECK:STDOUT:   %i64.builtin: type = int_type signed, %int_64 [concrete]
+// CHECK:STDOUT:   %int_13: Core.IntLiteral = int_value 13 [concrete]
+// CHECK:STDOUT:   %i13.builtin: type = int_type signed, %int_13 [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @F(%n.param: %i64.builtin) -> %i64.builtin {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @G(%n.param: %i13.builtin) -> %i13.builtin {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 36 - 4
toolchain/check/testdata/builtins/int/make_type_unsigned.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -23,15 +23,24 @@ library "[[@TEST_NAME]]";
 
 import library "types";
 
-fn F(n: UInt(64)) -> UInt(64) {
+fn F(n: UInt(64)) ->
+    //@dump-sem-ir-begin
+    UInt(64)
+    //@dump-sem-ir-end
+    {
   return n;
 }
 
-fn G(n: UInt(13)) -> UInt(13) {
+fn G(n: UInt(13)) ->
+    //@dump-sem-ir-begin
+    UInt(13)
+    //@dump-sem-ir-end
+    {
   return n;
 }
 
-fn Symbolic(N:! IntLiteral(), x: UInt(N)) -> UInt(N) {
+fn Symbolic(N:! IntLiteral(), x: UInt(N)) -> UInt(N)
+    {
   return x;
 }
 
@@ -72,3 +81,26 @@ import library "types";
 // CHECK:STDERR:        ^~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 var m: UInt(1000000000);
+
+// CHECK:STDOUT: --- use_types.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
+// CHECK:STDOUT:   %u64.builtin: type = int_type unsigned, %int_64 [concrete]
+// CHECK:STDOUT:   %int_13: Core.IntLiteral = int_value 13 [concrete]
+// CHECK:STDOUT:   %u13.builtin: type = int_type unsigned, %int_13 [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @F(%n.param: %u64.builtin) -> %u64.builtin {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @G(%n.param: %u13.builtin) -> %u13.builtin {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/neq.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -23,5 +23,31 @@ fn F(true_: True, false_: False) {
 }
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> bool {
+  //@dump-sem-ir-begin
   return Neq(a, b);
+  //@dump-sem-ir-end
 }
+
+// CHECK:STDOUT: --- int_neq.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Neq.type: type = fn_type @Neq [concrete]
+// CHECK:STDOUT:   %Neq: %Neq.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> bool {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Neq.ref: %Neq.type = name_ref Neq, file.%Neq.decl [concrete = 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:   %.loc14_19.1: bool = value_of_initializer %int.neq
+// CHECK:STDOUT:   %.loc14_19.2: bool = converted %int.neq, %.loc14_19.1
+// CHECK:STDOUT:   return %.loc14_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 32 - 1
toolchain/check/testdata/builtins/int/or.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -18,5 +18,36 @@ var arr: array(i32, Or(12, 10));
 let arr_p: array(i32, 14)* = &arr;
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Or(a, b);
+  //@dump-sem-ir-end
 }
+
+// CHECK:STDOUT: --- int_or.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Or.type: type = fn_type @Or [concrete]
+// CHECK:STDOUT:   %Or: %Or.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Or.ref: %Or.type = name_ref Or, file.%Or.decl [concrete = 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:   %.loc9_18.1: %i32 = value_of_initializer %int.or
+// CHECK:STDOUT:   %.loc9_18.2: %i32 = converted %int.or, %.loc9_18.1
+// CHECK:STDOUT:   return %.loc9_18.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/or_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.or_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +47,27 @@ fn NotPtr(a: i32, b: i32) = "int.or_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.or_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.or_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 53 - 1
toolchain/check/testdata/builtins/int/right_shift.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -31,7 +31,9 @@ fn F() {
 }
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return RightShift(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- u32.carbon
@@ -54,7 +56,9 @@ fn F() {
 }
 
 fn RuntimeCall(a: u32, b: i32) -> u32 {
+  //@dump-sem-ir-begin
   return RightShift(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- literal.carbon
@@ -127,3 +131,51 @@ let negative_lit: Core.IntLiteral() = RightShiftLit(1, -1);
 // CHECK:STDERR:                                            ^~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 let negative_lit_zero: Core.IntLiteral() = RightShiftLit(0, -1);
+
+// CHECK:STDOUT: --- i32.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %RightShift.type.050: type = fn_type @RightShift.1 [concrete]
+// CHECK:STDOUT:   %RightShift: %RightShift.type.050 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %RightShift.ref: %RightShift.type.050 = name_ref RightShift, file.%RightShift.decl [concrete = 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:   %.loc22_26.1: %i32 = value_of_initializer %int.right_shift
+// CHECK:STDOUT:   %.loc22_26.2: %i32 = converted %int.right_shift, %.loc22_26.1
+// CHECK:STDOUT:   return %.loc22_26.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: --- u32.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %u32: type = class_type @UInt, @UInt(%int_32) [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %RightShift.type.050: type = fn_type @RightShift.1 [concrete]
+// CHECK:STDOUT:   %RightShift: %RightShift.type.050 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCall(%a.param: %u32, %b.param: %i32) -> %u32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %RightShift.ref: %RightShift.type.050 = name_ref RightShift, file.%RightShift.decl [concrete = constants.%RightShift]
+// CHECK:STDOUT:   %a.ref: %u32 = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.right_shift: init %u32 = call %RightShift.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   %.loc21_26.1: %u32 = value_of_initializer %int.right_shift
+// CHECK:STDOUT:   %.loc21_26.2: %u32 = converted %int.right_shift, %.loc21_26.1
+// CHECK:STDOUT:   return %.loc21_26.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 42 - 1
toolchain/check/testdata/builtins/int/right_shift_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,13 +17,17 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.right_shift_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 fn MixedTypes(a: i32*, b: i64) = "int.right_shift_assign";
 
 fn CallMixed(a: i32*, b: i64) {
+  //@dump-sem-ir-begin
   MixedTypes(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +49,40 @@ library "[[@TEST_NAME]]";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn NotPtr(a: i32, b: i32) = "int.right_shift_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT:   %int_64: Core.IntLiteral = int_value 64 [concrete]
+// CHECK:STDOUT:   %i64: type = class_type @Int, @Int(%int_64) [concrete]
+// CHECK:STDOUT:   %MixedTypes.type: type = fn_type @MixedTypes [concrete]
+// CHECK:STDOUT:   %MixedTypes: %MixedTypes.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.right_shift_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @CallMixed(%a.param: %ptr, %b.param: %i64) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %MixedTypes.ref: %MixedTypes.type = name_ref MixedTypes, file.%MixedTypes.decl [concrete = constants.%MixedTypes]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i64 = name_ref b, %b
+// CHECK:STDOUT:   %int.right_shift_assign: init %empty_tuple.type = call %MixedTypes.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 91 - 50
toolchain/check/testdata/builtins/int/sadd.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -26,7 +26,9 @@ fn F() {
 }
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Add(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- literal.carbon
@@ -51,89 +53,104 @@ fn F() {
   Test(Add(-0x8000_0000_0000_0000, -0x8000_0000_0000_0000)) as Expect(-0x1_0000_0000_0000_0000);
 }
 
-// --- fail_bad_decl.carbon
+// --- fail_too_few.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn TooFew(a: i32) -> i32 = "int.sadd";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn TooFew(a: i32) -> i32 = "int.sadd";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
+
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:26: error: name `TooMany` not found [NameNotFound]
+// CHECK:STDERR: var too_many: array(i32, TooMany(1, 2, 3));
+// CHECK:STDERR:                          ^~~~~~~
+// CHECK:STDERR:
+var too_many: array(i32, TooMany(1, 2, 3));
+
+fn RuntimeCallIsValidTooFew(a: i32) -> i32 {
+  return TooFew(a);
+}
+
+// --- fail_too_many.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.sadd";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.sadd";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:33: error: name `BadReturnType` not found [NameNotFound]
+// CHECK:STDERR: var bad_return_type: array(i32, BadReturnType(1, 2));
+// CHECK:STDERR:                                 ^~~~~~~~~~~~~
+// CHECK:STDERR:
+var bad_return_type: array(i32, BadReturnType(1, 2));
+
+fn RuntimeCallIsValidTooMany(a: i32, b: i32, c: i32) -> i32 {
+  return TooMany(a, b, c);
+}
+
+// --- fail_bad_return_type.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn BadReturnType(a: i32, b: i32) -> bool = "int.sadd";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn BadReturnType(a: i32, b: i32) -> bool = "int.sadd";
-fn JustRight(a: i32, b: i32) -> i32 = "int.sadd";
 
-// Heterogeneous "add" is not supported.
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:25: error: name `TooFew` not found [NameNotFound]
+// CHECK:STDERR: var too_few: array(i32, TooFew(1));
+// CHECK:STDERR:                         ^~~~~~
+// CHECK:STDERR:
+var too_few: array(i32, TooFew(1));
+
+fn RuntimeCallIsValidBadReturnType(a: i32, b: i32) -> bool {
+  return BadReturnType(a, b);
+}
+
+// --- fail_bad_call.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_bad_call.carbon:[[@LINE+4]]:26: error: name `JustRight` not found [NameNotFound]
+// CHECK:STDERR: var bad_call: array(i32, JustRight(1, 2, 3));
+// CHECK:STDERR:                          ^~~~~~~~~
+// CHECK:STDERR:
+var bad_call: array(i32, JustRight(1, 2, 3));
+
+// --- fail_mixed_add.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_mixed_add.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn MixedAdd1(a: i32, b: Core.IntLiteral()) -> i32 = "int.sadd";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedAdd1(a: i32, b: Core.IntLiteral()) -> i32 = "int.sadd";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_mixed_add.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn MixedAdd2(a: Core.IntLiteral(), b: i32) -> i32 = "int.sadd";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedAdd2(a: Core.IntLiteral(), b: i32) -> i32 = "int.sadd";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_mixed_add.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn MixedAdd3(a: i32, b: Core.IntLiteral()) -> Core.IntLiteral() = "int.sadd";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedAdd3(a: i32, b: Core.IntLiteral()) -> Core.IntLiteral() = "int.sadd";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_mixed_add.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.sadd" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn MixedAdd4(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.sadd";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedAdd4(a: Core.IntLiteral(), b: i32) -> Core.IntLiteral() = "int.sadd";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:25: error: array bound is not a constant [InvalidArrayExpr]
-// CHECK:STDERR: var too_few: array(i32, TooFew(1));
-// CHECK:STDERR:                         ^~~~~~~~~
-// CHECK:STDERR:
-var too_few: array(i32, TooFew(1));
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:26: error: array bound is not a constant [InvalidArrayExpr]
-// CHECK:STDERR: var too_many: array(i32, TooMany(1, 2, 3));
-// CHECK:STDERR:                          ^~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-var too_many: array(i32, TooMany(1, 2, 3));
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:33: error: array bound is not a constant [InvalidArrayExpr]
-// CHECK:STDERR: var bad_return_type: array(i32, BadReturnType(1, 2));
-// CHECK:STDERR:                                 ^~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-var bad_return_type: array(i32, BadReturnType(1, 2));
-
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:26: error: 3 arguments passed to function expecting 2 arguments [CallArgCountMismatch]
-// CHECK:STDERR: var bad_call: array(i32, JustRight(1, 2, 3));
-// CHECK:STDERR:                          ^~~~~~~~~~~~~~~~~~
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-43]]:1: note: calling function declared here [InCallToEntity]
-// CHECK:STDERR: fn JustRight(a: i32, b: i32) -> i32 = "int.sadd";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-var bad_call: array(i32, JustRight(1, 2, 3));
-
-fn RuntimeCallIsValidTooFew(a: i32) -> i32 {
-  return TooFew(a);
-}
-
-fn RuntimeCallIsValidTooMany(a: i32, b: i32, c: i32) -> i32 {
-  return TooMany(a, b, c);
-}
-
-fn RuntimeCallIsValidBadReturnType(a: i32, b: i32) -> bool {
-  return BadReturnType(a, b);
-}
-
 // --- fail_overflow.carbon
 
-package FailOverflow;
+library "[[@TEST_NAME]]";
 
 fn Add(a: i32, b: i32) -> i32 = "int.sadd";
 
@@ -143,3 +160,27 @@ let a: i32 = Add(0x7FFFFFFF, 0);
 // CHECK:STDERR:              ^~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 let b: i32 = Add(0x7FFFFFFF, 1);
+
+// CHECK:STDOUT: --- i32.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Add.type.b1f: type = fn_type @Add.1 [concrete]
+// CHECK:STDOUT:   %Add: %Add.type.b1f = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Add.ref: %Add.type.b1f = name_ref Add, file.%Add.decl [concrete = 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:   %.loc17_19.1: %i32 = value_of_initializer %int.sadd
+// CHECK:STDOUT:   %.loc17_19.2: %i32 = converted %int.sadd, %.loc17_19.1
+// CHECK:STDOUT:   return %.loc17_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 1 - 1
toolchain/check/testdata/builtins/int/sadd_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:

+ 36 - 3
toolchain/check/testdata/builtins/int/sdiv.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -12,18 +12,22 @@
 
 // --- int_div.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Div(a: i32, b: i32) -> i32 = "int.sdiv";
 
 var arr: array(i32, Div(3, 2));
 let arr_p: array(i32, 1)* = &arr;
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Div(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_overflow.carbon
 
-package FailOverflow;
+library "[[@TEST_NAME]]";
 
 fn Div(a: i32, b: i32) -> i32 = "int.sdiv";
 fn Sub(a: i32, b: i32) -> i32 = "int.ssub";
@@ -58,7 +62,7 @@ fn F() {
 
 // --- fail_div_by_zero.carbon
 
-package FailDivByZero;
+library "[[@TEST_NAME]]";
 
 fn Div(a: i32, b: i32) -> i32 = "int.sdiv";
 fn DivLit(a: Core.IntLiteral(), b: Core.IntLiteral()) -> Core.IntLiteral() = "int.sdiv";
@@ -87,3 +91,32 @@ let c: Core.IntLiteral() = DivLit(1, 0);
 // CHECK:STDERR:                            ^~~~~~~~~~~~
 // CHECK:STDERR:
 let d: Core.IntLiteral() = DivLit(0, 0);
+
+// CHECK:STDOUT: --- int_div.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Div.type.ab4: type = fn_type @Div.1 [concrete]
+// CHECK:STDOUT:   %Div: %Div.type.ab4 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Div.ref: %Div.type.ab4 = name_ref Div, file.%Div.decl [concrete = 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:   %.loc11_19.1: %i32 = value_of_initializer %int.sdiv
+// CHECK:STDOUT:   %.loc11_19.2: %i32 = converted %int.sdiv, %.loc11_19.1
+// CHECK:STDOUT:   return %.loc11_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/sdiv_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.sdiv_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +47,27 @@ fn NotPtr(a: i32, b: i32) = "int.sdiv_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.sdiv_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.sdiv_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 36 - 3
toolchain/check/testdata/builtins/int/smod.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -12,18 +12,22 @@
 
 // --- int_div.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Mod(a: i32, b: i32) -> i32 = "int.smod";
 
 var arr: array(i32, Mod(5, 3));
 let arr_p: array(i32, 2)* = &arr;
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Mod(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_overflow.carbon
 
-package FailOverflow;
+library "[[@TEST_NAME]]";
 
 fn Mod(a: i32, b: i32) -> i32 = "int.smod";
 fn Sub(a: i32, b: i32) -> i32 = "int.ssub";
@@ -45,7 +49,7 @@ let c: i32 = Mod(Sub(Negate(0x7FFF_FFFF), 1), Negate(1));
 
 // --- fail_div_by_zero.carbon
 
-package FailDivByZero;
+library "[[@TEST_NAME]]";
 
 fn Mod(a: i32, b: i32) -> i32 = "int.smod";
 
@@ -62,3 +66,32 @@ let a: i32 = Mod(1, 0);
 // CHECK:STDERR:              ^~~~~~~~~
 // 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 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Mod.type.797: type = fn_type @Mod.1 [concrete]
+// CHECK:STDOUT:   %Mod: %Mod.type.797 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Mod.ref: %Mod.type.797 = name_ref Mod, file.%Mod.decl [concrete = 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:   %.loc11_19.1: %i32 = value_of_initializer %int.smod
+// CHECK:STDOUT:   %.loc11_19.2: %i32 = converted %int.smod, %.loc11_19.1
+// CHECK:STDOUT:   return %.loc11_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/smod_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.smod_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +47,27 @@ fn NotPtr(a: i32, b: i32) = "int.smod_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.smod_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.smod_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 28 - 2
toolchain/check/testdata/builtins/int/smul.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -29,7 +29,9 @@ fn F() {
 }
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Mul(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- literal.carbon
@@ -61,7 +63,7 @@ fn F() {
 
 // --- fail_overflow.carbon
 
-package FailOverflow;
+library "[[@TEST_NAME]]";
 
 fn Mul(a: i32, b: i32) -> i32 = "int.smul";
 
@@ -71,3 +73,27 @@ let a: i32 = Mul(0x7FFF, 0x10000);
 // CHECK:STDERR:              ^~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 let b: i32 = Mul(0x8000, 0x10000);
+
+// CHECK:STDOUT: --- i32.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Mul.type.b2a: type = fn_type @Mul.1 [concrete]
+// CHECK:STDOUT:   %Mul: %Mul.type.b2a = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Mul.ref: %Mul.type.b2a = name_ref Mul, file.%Mul.decl [concrete = 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:   %.loc20_19.1: %i32 = value_of_initializer %int.smul
+// CHECK:STDOUT:   %.loc20_19.2: %i32 = converted %int.smul, %.loc20_19.1
+// CHECK:STDOUT:   return %.loc20_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/smul_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.smul_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +47,27 @@ fn NotPtr(a: i32, b: i32) = "int.smul_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.smul_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.smul_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 85 - 57
toolchain/check/testdata/builtins/int/snegate.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -12,6 +12,8 @@
 
 // --- int_negate.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Negate(a: i32) -> i32 = "int.snegate";
 
 var arr: array(i32, Negate(Negate(123)));
@@ -20,7 +22,9 @@ let arr_p: array(i32, 123)* = &arr;
 let n: i32 = Negate(1);
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Negate(a);
+  //@dump-sem-ir-end
 }
 
 // --- literal.carbon
@@ -38,88 +42,84 @@ fn F() {
   Test(Negate(0 - 0x8000_0000_0000_0000)) as Expect(0x8000_0000_0000_0000);
 }
 
-// --- fail_bad_decl.carbon
+// --- fail_too_few.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn TooFew() -> i32 = "int.snegate";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn TooFew() -> i32 = "int.snegate";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.snegate";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn TooMany(a: i32, b: i32) -> i32 = "int.snegate";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.snegate";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn BadReturnType(a: i32) -> bool = "int.snegate";
-fn JustRight(a: i32) -> i32 = "int.snegate";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:25: error: array bound is not a constant [InvalidArrayExpr]
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:25: error: array bound is not a constant [InvalidArrayExpr]
 // CHECK:STDERR: var too_few: array(i32, TooFew());
 // CHECK:STDERR:                         ^~~~~~~~
 // CHECK:STDERR:
 var too_few: array(i32, TooFew());
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:26: error: array bound is not a constant [InvalidArrayExpr]
+
+fn RuntimeCallIsValidTooFew() -> i32 {
+  return TooFew();
+}
+
+// --- fail_too_many.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.snegate";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn TooMany(a: i32, b: i32) -> i32 = "int.snegate";
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:26: error: array bound is not a constant [InvalidArrayExpr]
 // CHECK:STDERR: var too_many: array(i32, TooMany(1, 2));
 // CHECK:STDERR:                          ^~~~~~~~~~~~~
 // CHECK:STDERR:
 var too_many: array(i32, TooMany(1, 2));
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:33: error: array bound is not a constant [InvalidArrayExpr]
+
+fn RuntimeCallIsValidTooMany(a: i32, b: i32) -> i32 {
+  return TooMany(a, b);
+}
+
+// --- fail_bad_return_type.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.snegate" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.snegate";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn BadReturnType(a: i32) -> bool = "int.snegate";
+
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:33: error: array bound is not a constant [InvalidArrayExpr]
 // CHECK:STDERR: var bad_return_type: array(i32, BadReturnType(1));
 // CHECK:STDERR:                                 ^~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 var bad_return_type: array(i32, BadReturnType(1));
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:26: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch]
-// CHECK:STDERR: var bad_call: array(i32, JustRight(1, 2));
-// CHECK:STDERR:                          ^~~~~~~~~~~~~~~
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here [InCallToEntity]
-// CHECK:STDERR: fn JustRight(a: i32) -> i32 = "int.snegate";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-var bad_call: array(i32, JustRight(1, 2));
-
-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:          ^~~~~~~~~
-  // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: note: calling function declared here [InCallToEntity]
-  // CHECK:STDERR: fn TooFew() -> i32 = "int.snegate";
-  // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR:
-  return TooFew(a);
+fn RuntimeCallIsValidBadReturnType(a: i32) -> bool {
+  return BadReturnType(a);
 }
 
-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:          ^~~~~~~~~~~~~~~~
-  // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: note: calling function declared here [InCallToEntity]
-  // CHECK:STDERR: fn TooMany(a: i32, b: i32) -> i32 = "int.snegate";
-  // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR:
-  return TooMany(a, b, c);
-}
+// --- fail_bad_call.carbon
 
-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:          ^~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: note: calling function declared here [InCallToEntity]
-  // CHECK:STDERR: fn BadReturnType(a: i32) -> bool = "int.snegate";
-  // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR:
-  return BadReturnType(a, b);
-}
+library "[[@TEST_NAME]]";
+
+fn Negate(a: i32) -> i32 = "int.snegate";
+
+// CHECK:STDERR: fail_bad_call.carbon:[[@LINE+7]]:26: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch]
+// CHECK:STDERR: var bad_call: array(i32, Negate(1, 2));
+// CHECK:STDERR:                          ^~~~~~~~~~~~
+// CHECK:STDERR: fail_bad_call.carbon:[[@LINE-5]]:1: note: calling function declared here [InCallToEntity]
+// CHECK:STDERR: fn Negate(a: i32) -> i32 = "int.snegate";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+var bad_call: array(i32, Negate(1, 2));
 
 // --- fail_overflow.carbon
 
-package FailOverflow;
+library "[[@TEST_NAME]]";
 
 fn Negate(a: i32) -> i32 = "int.snegate";
 fn Sub(a: i32, b: i32) -> i32 = "int.ssub";
@@ -133,3 +133,31 @@ let a: i32 = Negate(Negate(0x7FFF_FFFF));
 // CHECK:STDERR:              ^~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 let b: i32 = Negate(-0x8000_0000);
+
+// CHECK:STDOUT: --- int_negate.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Negate.type.15b: type = fn_type @Negate.1 [concrete]
+// CHECK:STDOUT:   %Negate: %Negate.type.15b = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Negate.ref: %Negate.type.15b = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
+// CHECK:STDOUT:   %a.ref: %i32 = name_ref a, %a
+// CHECK:STDOUT:   %int.snegate: init %i32 = call %Negate.ref(%a.ref)
+// CHECK:STDOUT:   %.loc13_19.1: %i32 = value_of_initializer %int.snegate
+// CHECK:STDOUT:   %.loc13_19.2: %i32 = converted %int.snegate, %.loc13_19.1
+// CHECK:STDOUT:   return %.loc13_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 35 - 2
toolchain/check/testdata/builtins/int/ssub.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -12,18 +12,22 @@
 
 // --- int_sub.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Sub(a: i32, b: i32) -> i32 = "int.ssub";
 
 var arr: array(i32, Sub(3, 2));
 let arr_p: array(i32, 1)* = &arr;
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Sub(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_overflow.carbon
 
-package FailOverflow;
+library "[[@TEST_NAME]]";
 
 fn Sub(a: i32, b: i32) -> i32 = "int.ssub";
 
@@ -34,3 +38,32 @@ let b: i32 = Sub(Sub(0, 0x7FFFFFFF), 1);
 // CHECK:STDERR:              ^~~~~~~~~~~~~~~~~~~~~~~~~~
 // 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 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Sub.type.765: type = fn_type @Sub.1 [concrete]
+// CHECK:STDOUT:   %Sub: %Sub.type.765 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Sub.ref: %Sub.type.765 = name_ref Sub, file.%Sub.decl [concrete = 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:   %.loc11_19.1: %i32 = value_of_initializer %int.ssub
+// CHECK:STDOUT:   %.loc11_19.2: %i32 = converted %int.ssub, %.loc11_19.1
+// CHECK:STDOUT:   return %.loc11_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/ssub_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.ssub_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +47,27 @@ fn NotPtr(a: i32, b: i32) = "int.ssub_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.ssub_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.ssub_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 86 - 36
toolchain/check/testdata/builtins/int/uadd.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -12,79 +12,129 @@
 
 // --- int_add.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Add(a: i32, b: i32) -> i32 = "int.uadd";
 
 var arr: array(i32, Add(1, 2));
 let arr_p: array(i32, 3)* = &arr;
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Add(a, b);
+  //@dump-sem-ir-end
 }
 
-// --- fail_bad_decl.carbon
+// --- fail_too_few.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn TooFew(a: i32) -> i32 = "int.uadd";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn TooFew(a: i32) -> i32 = "int.uadd";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.uadd";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.uadd";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn BadReturnType(a: i32, b: i32) -> bool = "int.uadd";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn BadReturnType(a: i32, b: i32) -> bool = "int.uadd";
-fn JustRight(a: i32, b: i32) -> i32 = "int.uadd";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:25: error: array bound is not a constant [InvalidArrayExpr]
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:25: error: array bound is not a constant [InvalidArrayExpr]
 // CHECK:STDERR: var too_few: array(i32, TooFew(1));
 // CHECK:STDERR:                         ^~~~~~~~~
 // CHECK:STDERR:
 var too_few: array(i32, TooFew(1));
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:26: error: array bound is not a constant [InvalidArrayExpr]
-// CHECK:STDERR: var too_many: array(i32, TooMany(1, 2, 3));
-// CHECK:STDERR:                          ^~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-var too_many: array(i32, TooMany(1, 2, 3));
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:33: error: array bound is not a constant [InvalidArrayExpr]
-// CHECK:STDERR: var bad_return_type: array(i32, BadReturnType(1, 2));
-// CHECK:STDERR:                                 ^~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-var bad_return_type: array(i32, BadReturnType(1, 2));
-
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:26: error: 3 arguments passed to function expecting 2 arguments [CallArgCountMismatch]
-// CHECK:STDERR: var bad_call: array(i32, JustRight(1, 2, 3));
-// CHECK:STDERR:                          ^~~~~~~~~~~~~~~~~~
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here [InCallToEntity]
-// CHECK:STDERR: fn JustRight(a: i32, b: i32) -> i32 = "int.uadd";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-var bad_call: array(i32, JustRight(1, 2, 3));
 
 fn RuntimeCallIsValidTooFew(a: i32) -> i32 {
   return TooFew(a);
 }
 
+// --- fail_too_many.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.uadd";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn TooMany(a: i32, b: i32, c: i32) -> i32 = "int.uadd";
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:26: error: array bound is not a constant [InvalidArrayExpr]
+// CHECK:STDERR: var too_many: array(i32, TooMany(1, 2, 3));
+// CHECK:STDERR:                          ^~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+var too_many: array(i32, TooMany(1, 2, 3));
+
 fn RuntimeCallIsValidTooMany(a: i32, b: i32, c: i32) -> i32 {
   return TooMany(a, b, c);
 }
 
+// --- fail_bad_return_type.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.uadd" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn BadReturnType(a: i32, b: i32) -> bool = "int.uadd";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn BadReturnType(a: i32, b: i32) -> bool = "int.uadd";
+
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:33: error: array bound is not a constant [InvalidArrayExpr]
+// CHECK:STDERR: var bad_return_type: array(i32, BadReturnType(1, 2));
+// CHECK:STDERR:                                 ^~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+var bad_return_type: array(i32, BadReturnType(1, 2));
+
 fn RuntimeCallIsValidBadReturnType(a: i32, b: i32) -> bool {
   return BadReturnType(a, b);
 }
 
+// --- fail_bad_call.carbon
+
+library "[[@TEST_NAME]]";
+
+fn Add(a: i32, b: i32) -> i32 = "int.uadd";
+
+// CHECK:STDERR: fail_bad_call.carbon:[[@LINE+7]]:26: error: 3 arguments passed to function expecting 2 arguments [CallArgCountMismatch]
+// CHECK:STDERR: var bad_call: array(i32, Add(1, 2, 3));
+// CHECK:STDERR:                          ^~~~~~~~~~~~
+// CHECK:STDERR: fail_bad_call.carbon:[[@LINE-5]]:1: note: calling function declared here [InCallToEntity]
+// CHECK:STDERR: fn Add(a: i32, b: i32) -> i32 = "int.uadd";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+var bad_call: array(i32, Add(1, 2, 3));
+
 // --- overflow.carbon
 
-package Overflow;
+library "[[@TEST_NAME]]";
 
 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 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Add.type.b1f: type = fn_type @Add.1 [concrete]
+// CHECK:STDOUT:   %Add: %Add.type.b1f = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Add.ref: %Add.type.b1f = name_ref Add, file.%Add.decl [concrete = 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:   %.loc11_19.1: %i32 = value_of_initializer %int.uadd
+// CHECK:STDOUT:   %.loc11_19.2: %i32 = converted %int.uadd, %.loc11_19.1
+// CHECK:STDOUT:   return %.loc11_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/uadd_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.uadd_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +47,27 @@ fn NotPtr(a: i32, b: i32) = "int.uadd_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.uadd_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.uadd_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 36 - 3
toolchain/check/testdata/builtins/int/udiv.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -12,18 +12,22 @@
 
 // --- int_div.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Div(a: i32, b: i32) -> i32 = "int.udiv";
 
 var arr: array(i32, Div(3, 2));
 let arr_p: array(i32, 1)* = &arr;
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Div(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- overflow.carbon
 
-package Overflow;
+library "[[@TEST_NAME]]";
 
 fn Div(a: i32, b: i32) -> i32 = "int.udiv";
 fn Sub(a: i32, b: i32) -> i32 = "int.usub";
@@ -40,7 +44,7 @@ let c: i32 = Div(Sub(Negate(0x7FFF_FFFF), 1), Negate(1));
 
 // --- fail_div_by_zero.carbon
 
-package FailDivByZero;
+library "[[@TEST_NAME]]";
 
 fn Div(a: i32, b: i32) -> i32 = "int.udiv";
 
@@ -55,3 +59,32 @@ let a: i32 = Div(1, 0);
 // CHECK:STDERR:              ^~~~~~~~~
 // 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 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Div.type.ab4: type = fn_type @Div.1 [concrete]
+// CHECK:STDOUT:   %Div: %Div.type.ab4 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Div.ref: %Div.type.ab4 = name_ref Div, file.%Div.decl [concrete = 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:   %.loc11_19.1: %i32 = value_of_initializer %int.udiv
+// CHECK:STDOUT:   %.loc11_19.2: %i32 = converted %int.udiv, %.loc11_19.1
+// CHECK:STDOUT:   return %.loc11_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/udiv_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.udiv_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +47,27 @@ fn NotPtr(a: i32, b: i32) = "int.udiv_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.udiv_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.udiv_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 36 - 3
toolchain/check/testdata/builtins/int/umod.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -12,18 +12,22 @@
 
 // --- int_div.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Mod(a: i32, b: i32) -> i32 = "int.umod";
 
 var arr: array(i32, Mod(5, 3));
 let arr_p: array(i32, 2)* = &arr;
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Mod(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- overflow.carbon
 
-package Overflow;
+library "[[@TEST_NAME]]";
 
 fn Mod(a: i32, b: i32) -> i32 = "int.umod";
 fn Sub(a: i32, b: i32) -> i32 = "int.usub";
@@ -40,7 +44,7 @@ let c: i32 = Mod(Sub(Negate(0x7FFF_FFFF), 1), Negate(1));
 
 // --- fail_div_by_zero.carbon
 
-package FailDivByZero;
+library "[[@TEST_NAME]]";
 
 fn Mod(a: i32, b: i32) -> i32 = "int.umod";
 
@@ -57,3 +61,32 @@ let a: i32 = Mod(1, 0);
 // CHECK:STDERR:              ^~~~~~~~~
 // 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 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Mod.type.797: type = fn_type @Mod.1 [concrete]
+// CHECK:STDOUT:   %Mod: %Mod.type.797 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Mod.ref: %Mod.type.797 = name_ref Mod, file.%Mod.decl [concrete = 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:   %.loc11_19.1: %i32 = value_of_initializer %int.umod
+// CHECK:STDOUT:   %.loc11_19.2: %i32 = converted %int.umod, %.loc11_19.1
+// CHECK:STDOUT:   return %.loc11_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/umod_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.umod_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +47,27 @@ fn NotPtr(a: i32, b: i32) = "int.umod_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.umod_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.umod_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 35 - 2
toolchain/check/testdata/builtins/int/umul.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -12,20 +12,53 @@
 
 // --- int_mul.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Mul(a: i32, b: i32) -> i32 = "int.umul";
 
 var arr: array(i32, Mul(3, 2));
 let arr_p: array(i32, 6)* = &arr;
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Mul(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- overflow.carbon
 
-package Overflow;
+library "[[@TEST_NAME]]";
 
 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 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Mul.type.b2a: type = fn_type @Mul.1 [concrete]
+// CHECK:STDOUT:   %Mul: %Mul.type.b2a = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Mul.ref: %Mul.type.b2a = name_ref Mul, file.%Mul.decl [concrete = 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:   %.loc11_19.1: %i32 = value_of_initializer %int.umul
+// CHECK:STDOUT:   %.loc11_19.2: %i32 = converted %int.umul, %.loc11_19.1
+// CHECK:STDOUT:   return %.loc11_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/umul_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.umul_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +47,27 @@ fn NotPtr(a: i32, b: i32) = "int.umul_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.umul_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.umul_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 85 - 57
toolchain/check/testdata/builtins/int/unegate.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -12,6 +12,8 @@
 
 // --- int_negate.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Negate(a: u32) -> u32 = "int.unegate";
 
 var arr: array(u32, Negate(Negate(123)));
@@ -20,91 +22,89 @@ let arr_p: array(u32, 123)* = &arr;
 let n: u32 = Negate(1);
 
 fn RuntimeCallIsValid(a: u32, b: u32) -> u32 {
+  //@dump-sem-ir-begin
   return Negate(a);
+  //@dump-sem-ir-end
 }
 
-// --- fail_bad_decl.carbon
+// --- fail_too_few.carbon
 
-package FailBadDecl;
+library "[[@TEST_NAME]]";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" [InvalidBuiltinSignature]
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" [InvalidBuiltinSignature]
 // CHECK:STDERR: fn TooFew() -> u32 = "int.unegate";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn TooFew() -> u32 = "int.unegate";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn TooMany(a: u32, b: u32) -> u32 = "int.unegate";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn TooMany(a: u32, b: u32) -> u32 = "int.unegate";
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" [InvalidBuiltinSignature]
-// CHECK:STDERR: fn BadReturnType(a: u32) -> bool = "int.unegate";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-fn BadReturnType(a: u32) -> bool = "int.unegate";
-fn JustRight(a: u32) -> u32 = "int.unegate";
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:25: error: array bound is not a constant [InvalidArrayExpr]
+// CHECK:STDERR: fail_too_few.carbon:[[@LINE+4]]:25: error: array bound is not a constant [InvalidArrayExpr]
 // CHECK:STDERR: var too_few: array(u32, TooFew());
 // CHECK:STDERR:                         ^~~~~~~~
 // CHECK:STDERR:
 var too_few: array(u32, TooFew());
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:26: error: array bound is not a constant [InvalidArrayExpr]
+
+fn RuntimeCallIsValidTooFew() -> u32 {
+  return TooFew();
+}
+
+// --- fail_too_many.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn TooMany(a: u32, b: u32) -> u32 = "int.unegate";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn TooMany(a: u32, b: u32) -> u32 = "int.unegate";
+
+// CHECK:STDERR: fail_too_many.carbon:[[@LINE+4]]:26: error: array bound is not a constant [InvalidArrayExpr]
 // CHECK:STDERR: var too_many: array(u32, TooMany(1, 2));
 // CHECK:STDERR:                          ^~~~~~~~~~~~~
 // CHECK:STDERR:
 var too_many: array(u32, TooMany(1, 2));
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+4]]:33: error: array bound is not a constant [InvalidArrayExpr]
+
+fn RuntimeCallIsValidTooMany(a: u32, b: u32) -> u32 {
+  return TooMany(a, b);
+}
+
+// --- fail_bad_return_type.carbon
+
+library "[[@TEST_NAME]]";
+
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:1: error: invalid signature for builtin function "int.unegate" [InvalidBuiltinSignature]
+// CHECK:STDERR: fn BadReturnType(a: u32) -> bool = "int.unegate";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+fn BadReturnType(a: u32) -> bool = "int.unegate";
+
+// CHECK:STDERR: fail_bad_return_type.carbon:[[@LINE+4]]:33: error: array bound is not a constant [InvalidArrayExpr]
 // CHECK:STDERR: var bad_return_type: array(u32, BadReturnType(1));
 // CHECK:STDERR:                                 ^~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 var bad_return_type: array(u32, BadReturnType(1));
 
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE+7]]:26: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch]
-// CHECK:STDERR: var bad_call: array(u32, JustRight(1, 2));
-// CHECK:STDERR:                          ^~~~~~~~~~~~~~~
-// CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-21]]:1: note: calling function declared here [InCallToEntity]
-// CHECK:STDERR: fn JustRight(a: u32) -> u32 = "int.unegate";
-// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// CHECK:STDERR:
-var bad_call: array(u32, JustRight(1, 2));
-
-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:          ^~~~~~~~~
-  // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-42]]:1: note: calling function declared here [InCallToEntity]
-  // CHECK:STDERR: fn TooFew() -> u32 = "int.unegate";
-  // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR:
-  return TooFew(a);
+fn RuntimeCallIsValidBadReturnType(a: u32) -> bool {
+  return BadReturnType(a);
 }
 
-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:          ^~~~~~~~~~~~~~~~
-  // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-48]]:1: note: calling function declared here [InCallToEntity]
-  // CHECK:STDERR: fn TooMany(a: u32, b: u32) -> u32 = "int.unegate";
-  // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR:
-  return TooMany(a, b, c);
-}
+// --- fail_bad_call.carbon
 
-fn RuntimeCallIsValidBadReturnType(a: u32, b: u32) -> 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:          ^~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR: fail_bad_decl.carbon:[[@LINE-54]]:1: note: calling function declared here [InCallToEntity]
-  // CHECK:STDERR: fn BadReturnType(a: u32) -> bool = "int.unegate";
-  // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-  // CHECK:STDERR:
-  return BadReturnType(a, b);
-}
+library "[[@TEST_NAME]]";
+
+fn Negate(a: u32) -> u32 = "int.unegate";
+
+// CHECK:STDERR: fail_bad_call.carbon:[[@LINE+7]]:26: error: 2 arguments passed to function expecting 1 argument [CallArgCountMismatch]
+// CHECK:STDERR: var bad_call: array(u32, Negate(1, 2));
+// CHECK:STDERR:                          ^~~~~~~~~~~~
+// CHECK:STDERR: fail_bad_call.carbon:[[@LINE-5]]:1: note: calling function declared here [InCallToEntity]
+// CHECK:STDERR: fn Negate(a: u32) -> u32 = "int.unegate";
+// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
+// CHECK:STDERR:
+var bad_call: array(u32, Negate(1, 2));
 
 // --- overflow.carbon
 
-package Overflow;
+library "[[@TEST_NAME]]";
 
 fn Negate(a: u32) -> u32 = "int.unegate";
 
@@ -119,3 +119,31 @@ 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 [concrete]
+// CHECK:STDOUT:   %u32: type = class_type @UInt, @UInt(%int_32) [concrete]
+// CHECK:STDOUT:   %Negate.type.15b: type = fn_type @Negate.1 [concrete]
+// CHECK:STDOUT:   %Negate: %Negate.type.15b = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %u32, %b.param: %u32) -> %u32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Negate.ref: %Negate.type.15b = name_ref Negate, file.%Negate.decl [concrete = constants.%Negate]
+// CHECK:STDOUT:   %a.ref: %u32 = name_ref a, %a
+// CHECK:STDOUT:   %int.unegate: init %u32 = call %Negate.ref(%a.ref)
+// CHECK:STDOUT:   %.loc13_19.1: %u32 = value_of_initializer %int.unegate
+// CHECK:STDOUT:   %.loc13_19.2: %u32 = converted %int.unegate, %.loc13_19.1
+// CHECK:STDOUT:   return %.loc13_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 35 - 2
toolchain/check/testdata/builtins/int/usub.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -12,21 +12,54 @@
 
 // --- int_sub.carbon
 
+library "[[@TEST_NAME]]";
+
 fn Sub(a: i32, b: i32) -> i32 = "int.usub";
 
 var arr: array(i32, Sub(3, 2));
 let arr_p: array(i32, 1)* = &arr;
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Sub(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- overflow.carbon
 
-package Overflow;
+library "[[@TEST_NAME]]";
 
 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 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Sub.type.765: type = fn_type @Sub.1 [concrete]
+// CHECK:STDOUT:   %Sub: %Sub.type.765 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Sub.ref: %Sub.type.765 = name_ref Sub, file.%Sub.decl [concrete = 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:   %.loc11_19.1: %i32 = value_of_initializer %int.usub
+// CHECK:STDOUT:   %.loc11_19.2: %i32 = converted %int.usub, %.loc11_19.1
+// CHECK:STDOUT:   return %.loc11_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/usub_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.usub_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +47,27 @@ fn NotPtr(a: i32, b: i32) = "int.usub_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.usub_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.usub_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 32 - 1
toolchain/check/testdata/builtins/int/xor.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -18,5 +18,36 @@ var arr: array(i32, Xor(12, 10));
 let arr_p: array(i32, 6)* = &arr;
 
 fn RuntimeCallIsValid(a: i32, b: i32) -> i32 {
+  //@dump-sem-ir-begin
   return Xor(a, b);
+  //@dump-sem-ir-end
 }
+
+// CHECK:STDOUT: --- int_xor.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %Xor.type: type = fn_type @Xor [concrete]
+// CHECK:STDOUT:   %Xor: %Xor.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @RuntimeCallIsValid(%a.param: %i32, %b.param: %i32) -> %i32 {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Xor.ref: %Xor.type = name_ref Xor, file.%Xor.decl [concrete = 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:   %.loc9_19.1: %i32 = value_of_initializer %int.xor
+// CHECK:STDOUT:   %.loc9_19.2: %i32 = converted %int.xor, %.loc9_19.1
+// CHECK:STDOUT:   return %.loc9_19.2
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @__global_init() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 27 - 1
toolchain/check/testdata/builtins/int/xor_assign.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
@@ -17,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn Builtin(a: i32*, b: i32) = "int.xor_assign";
 
 fn Call(a: i32*, b: i32) {
+  //@dump-sem-ir-begin
   Builtin(a, b);
+  //@dump-sem-ir-end
 }
 
 // --- fail_unsized.carbon
@@ -45,3 +47,27 @@ fn NotPtr(a: i32, b: i32) = "int.xor_assign";
 // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 // CHECK:STDERR:
 fn MixedTypes(a: i32*, b: i64) = "int.xor_assign";
+
+// CHECK:STDOUT: --- call.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %ptr: type = ptr_type %i32 [concrete]
+// CHECK:STDOUT:   %Builtin.type: type = fn_type @Builtin [concrete]
+// CHECK:STDOUT:   %Builtin: %Builtin.type = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Call(%a.param: %ptr, %b.param: %i32) {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   %Builtin.ref: %Builtin.type = name_ref Builtin, file.%Builtin.decl [concrete = constants.%Builtin]
+// CHECK:STDOUT:   %a.ref: %ptr = name_ref a, %a
+// CHECK:STDOUT:   %b.ref: %i32 = name_ref b, %b
+// CHECK:STDOUT:   %int.xor_assign: init %empty_tuple.type = call %Builtin.ref(%a.ref, %b.ref)
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 1 - 1
toolchain/check/testdata/builtins/int_literal/make_type.carbon

@@ -2,7 +2,7 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
-// EXTRA-ARGS: --no-dump-sem-ir
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:

+ 20 - 108
toolchain/check/testdata/builtins/no_prelude/no_op.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/no_prelude/no_op.carbon
@@ -15,7 +17,9 @@ library "[[@TEST_NAME]]";
 fn NoOp() = "no_op";
 
 fn F() {
+  //@dump-sem-ir-begin
   NoOp();
+  //@dump-sem-ir-end
 }
 
 // --- explicit_return.carbon
@@ -25,7 +29,9 @@ library "[[@TEST_NAME]]";
 fn NoOp() -> () = "no_op";
 
 fn F() {
+  //@dump-sem-ir-begin
   NoOp();
+  //@dump-sem-ir-end
 }
 
 // --- ignore_args.carbon
@@ -35,7 +41,9 @@ library "[[@TEST_NAME]]";
 fn NoOp(x: ()) -> () = "no_op";
 
 fn F() {
+  //@dump-sem-ir-begin
   NoOp(());
+  //@dump-sem-ir-end
 }
 
 // --- assign.carbon
@@ -44,7 +52,9 @@ library "[[@TEST_NAME]]";
 
 fn NoOp() = "no_op";
 
+//@dump-sem-ir-begin
 var x: () = NoOp();
+//@dump-sem-ir-end
 
 // --- fail_signature.carbon
 
@@ -62,114 +72,49 @@ fn NoOp() -> {} = "no_op";
 // CHECK:STDOUT:   %NoOp.type: type = fn_type @NoOp [concrete]
 // CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %NoOp: %NoOp.type = struct_value () [concrete]
-// CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
-// CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .NoOp = %NoOp.decl
-// CHECK:STDOUT:     .F = %F.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %NoOp.decl: %NoOp.type = fn_decl @NoOp [concrete = constants.%NoOp] {} {}
-// CHECK:STDOUT:   %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @NoOp() = "no_op";
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @F() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %NoOp.ref: %NoOp.type = name_ref NoOp, file.%NoOp.decl [concrete = constants.%NoOp]
 // CHECK:STDOUT:   %no_op: init %empty_tuple.type = call %NoOp.ref() [concrete = constants.%empty_tuple]
-// CHECK:STDOUT:   return
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: --- explicit_return.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
-// CHECK:STDOUT:   %pattern_type: type = pattern_type %empty_tuple.type [concrete]
 // CHECK:STDOUT:   %NoOp.type: type = fn_type @NoOp [concrete]
 // CHECK:STDOUT:   %NoOp: %NoOp.type = struct_value () [concrete]
-// CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
-// CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .NoOp = %NoOp.decl
-// CHECK:STDOUT:     .F = %F.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %NoOp.decl: %NoOp.type = fn_decl @NoOp [concrete = constants.%NoOp] {
-// CHECK:STDOUT:     %return.patt: %pattern_type = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %.loc4_15.1: %empty_tuple.type = tuple_literal ()
-// CHECK:STDOUT:     %.loc4_15.2: type = converted %.loc4_15.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
-// CHECK:STDOUT:     %return.param: ref %empty_tuple.type = out_param call_param0
-// CHECK:STDOUT:     %return: ref %empty_tuple.type = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @NoOp() -> %empty_tuple.type = "no_op";
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @F() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %NoOp.ref: %NoOp.type = name_ref NoOp, file.%NoOp.decl [concrete = constants.%NoOp]
 // CHECK:STDOUT:   %no_op: init %empty_tuple.type = call %NoOp.ref() [concrete = constants.%empty_tuple]
-// CHECK:STDOUT:   return
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: --- ignore_args.carbon
 // CHECK:STDOUT:
 // CHECK:STDOUT: constants {
 // CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
-// CHECK:STDOUT:   %pattern_type: type = pattern_type %empty_tuple.type [concrete]
 // CHECK:STDOUT:   %NoOp.type: type = fn_type @NoOp [concrete]
 // CHECK:STDOUT:   %NoOp: %NoOp.type = struct_value () [concrete]
-// CHECK:STDOUT:   %F.type: type = fn_type @F [concrete]
-// CHECK:STDOUT:   %F: %F.type = struct_value () [concrete]
 // CHECK:STDOUT:   %empty_tuple: %empty_tuple.type = tuple_value () [concrete]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .NoOp = %NoOp.decl
-// CHECK:STDOUT:     .F = %F.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %NoOp.decl: %NoOp.type = fn_decl @NoOp [concrete = constants.%NoOp] {
-// CHECK:STDOUT:     %x.patt: %pattern_type = binding_pattern x [concrete]
-// CHECK:STDOUT:     %x.param_patt: %pattern_type = value_param_pattern %x.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %.loc4_20.1: %empty_tuple.type = tuple_literal ()
-// CHECK:STDOUT:     %.loc4_20.2: type = converted %.loc4_20.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
-// CHECK:STDOUT:     %x.param: %empty_tuple.type = value_param call_param0
-// CHECK:STDOUT:     %.loc4_13.1: type = splice_block %.loc4_13.3 [concrete = constants.%empty_tuple.type] {
-// CHECK:STDOUT:       %.loc4_13.2: %empty_tuple.type = tuple_literal ()
-// CHECK:STDOUT:       %.loc4_13.3: type = converted %.loc4_13.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %x: %empty_tuple.type = bind_name x, %x.param
-// CHECK:STDOUT:     %return.param: ref %empty_tuple.type = out_param call_param1
-// CHECK:STDOUT:     %return: ref %empty_tuple.type = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {}
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @NoOp(%x.param: %empty_tuple.type) -> %empty_tuple.type = "no_op";
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @F() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %NoOp.ref: %NoOp.type = name_ref NoOp, file.%NoOp.decl [concrete = constants.%NoOp]
-// CHECK:STDOUT:   %.loc7_9.1: %empty_tuple.type = tuple_literal ()
+// CHECK:STDOUT:   %.loc8_9.1: %empty_tuple.type = tuple_literal ()
 // CHECK:STDOUT:   %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple]
-// CHECK:STDOUT:   %.loc7_9.2: %empty_tuple.type = converted %.loc7_9.1, %empty_tuple [concrete = constants.%empty_tuple]
-// CHECK:STDOUT:   %no_op: init %empty_tuple.type = call %NoOp.ref(%.loc7_9.2) [concrete = constants.%empty_tuple]
-// CHECK:STDOUT:   return
+// CHECK:STDOUT:   %.loc8_9.2: %empty_tuple.type = converted %.loc8_9.1, %empty_tuple [concrete = constants.%empty_tuple]
+// CHECK:STDOUT:   %no_op: init %empty_tuple.type = call %NoOp.ref(%.loc8_9.2) [concrete = constants.%empty_tuple]
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: --- assign.carbon
@@ -183,56 +128,23 @@ fn NoOp() -> {} = "no_op";
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .NoOp = %NoOp.decl
-// CHECK:STDOUT:     .x = %x
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %NoOp.decl: %NoOp.type = fn_decl @NoOp [concrete = constants.%NoOp] {} {}
 // CHECK:STDOUT:   name_binding_decl {
 // CHECK:STDOUT:     %x.patt: %pattern_type = binding_pattern x [concrete]
 // CHECK:STDOUT:     %x.var_patt: %pattern_type = var_pattern %x.patt [concrete]
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %x.var: ref %empty_tuple.type = var %x.var_patt [concrete]
-// CHECK:STDOUT:   %.loc6_9.1: type = splice_block %.loc6_9.3 [concrete = constants.%empty_tuple.type] {
-// CHECK:STDOUT:     %.loc6_9.2: %empty_tuple.type = tuple_literal ()
-// CHECK:STDOUT:     %.loc6_9.3: type = converted %.loc6_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
+// CHECK:STDOUT:   %.loc7_9.1: type = splice_block %.loc7_9.3 [concrete = constants.%empty_tuple.type] {
+// CHECK:STDOUT:     %.loc7_9.2: %empty_tuple.type = tuple_literal ()
+// CHECK:STDOUT:     %.loc7_9.3: type = converted %.loc7_9.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
 // CHECK:STDOUT:   }
 // CHECK:STDOUT:   %x: ref %empty_tuple.type = bind_name x, %x.var
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: fn @NoOp() = "no_op";
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @__global_init() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %NoOp.ref: %NoOp.type = name_ref NoOp, file.%NoOp.decl [concrete = constants.%NoOp]
 // CHECK:STDOUT:   %no_op: init %empty_tuple.type = call %NoOp.ref() [concrete = constants.%empty_tuple]
 // CHECK:STDOUT:   assign file.%x.var, %no_op
-// CHECK:STDOUT:   return
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: --- fail_signature.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %empty_struct_type: type = struct_type {} [concrete]
-// CHECK:STDOUT:   %pattern_type: type = pattern_type %empty_struct_type [concrete]
-// CHECK:STDOUT:   %NoOp.type: type = fn_type @NoOp [concrete]
-// CHECK:STDOUT:   %NoOp: %NoOp.type = struct_value () [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .NoOp = %NoOp.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %NoOp.decl: %NoOp.type = fn_decl @NoOp [concrete = constants.%NoOp] {
-// CHECK:STDOUT:     %return.patt: %pattern_type = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %.loc8_15.1: %empty_struct_type = struct_literal ()
-// CHECK:STDOUT:     %.loc8_15.2: type = converted %.loc8_15.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type]
-// CHECK:STDOUT:     %return.param: ref %empty_struct_type = out_param call_param0
-// CHECK:STDOUT:     %return: ref %empty_struct_type = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @NoOp() -> %empty_struct_type;
-// CHECK:STDOUT:

+ 23 - 51
toolchain/check/testdata/builtins/print/char.carbon

@@ -2,6 +2,8 @@
 // Exceptions. See /LICENSE for license information.
 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 //
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
 // AUTOUPDATE
 // TIP: To test this file alone, run:
 // TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/print/char.carbon
@@ -13,8 +15,10 @@ import Core library "io";
 fn PrintChar(a: i32) -> i32 = "print.char";
 
 fn Main() {
+  //@dump-sem-ir-begin
   PrintChar(1);
   Core.PrintChar(2);
+  //@dump-sem-ir-end
 }
 
 // CHECK:STDOUT: --- char.carbon
@@ -24,11 +28,8 @@ fn Main() {
 // CHECK:STDOUT:   %Int.type: type = generic_class_type @Int [concrete]
 // CHECK:STDOUT:   %Int.generic: %Int.type = struct_value () [concrete]
 // CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
-// CHECK:STDOUT:   %pattern_type.7ce: type = pattern_type %i32 [concrete]
 // CHECK:STDOUT:   %PrintChar.type.c95: type = fn_type @PrintChar.1 [concrete]
 // CHECK:STDOUT:   %PrintChar.843: %PrintChar.type.c95 = struct_value () [concrete]
-// CHECK:STDOUT:   %Main.type: type = fn_type @Main [concrete]
-// CHECK:STDOUT:   %Main: %Main.type = struct_value () [concrete]
 // CHECK:STDOUT:   %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
 // CHECK:STDOUT:   %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
 // CHECK:STDOUT:   %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
@@ -70,58 +71,29 @@ fn Main() {
 // CHECK:STDOUT:   %Core.PrintChar: %PrintChar.type.089 = import_ref Core//io, PrintChar, loaded [concrete = constants.%PrintChar.d75]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .PrintChar = %PrintChar.decl
-// CHECK:STDOUT:     .Main = %Main.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %PrintChar.decl: %PrintChar.type.c95 = fn_decl @PrintChar.1 [concrete = constants.%PrintChar.843] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.7ce = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:     %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param1 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_32.loc13_25: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
-// CHECK:STDOUT:     %i32.loc13_25: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
-// CHECK:STDOUT:     %a.param: %i32 = value_param call_param0
-// CHECK:STDOUT:     %.loc13: type = splice_block %i32.loc13_17 [concrete = constants.%i32] {
-// CHECK:STDOUT:       %int_32.loc13_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
-// CHECK:STDOUT:       %i32.loc13_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: %i32 = bind_name a, %a.param
-// CHECK:STDOUT:     %return.param: ref %i32 = out_param call_param1
-// CHECK:STDOUT:     %return: ref %i32 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Main.decl: %Main.type = fn_decl @Main [concrete = constants.%Main] {} {}
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @PrintChar.1(%a.param: %i32) -> %i32 = "print.char";
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %PrintChar.ref.loc16: %PrintChar.type.c95 = name_ref PrintChar, file.%PrintChar.decl [concrete = constants.%PrintChar.843]
+// CHECK:STDOUT:   %PrintChar.ref.loc19: %PrintChar.type.c95 = name_ref PrintChar, file.%PrintChar.decl [concrete = constants.%PrintChar.843]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
-// CHECK:STDOUT:   %impl.elem0.loc16: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
-// CHECK:STDOUT:   %bound_method.loc16_13.1: <bound method> = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ab5]
-// CHECK:STDOUT:   %specific_fn.loc16: <specific function> = specific_function %impl.elem0.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
-// CHECK:STDOUT:   %bound_method.loc16_13.2: <bound method> = bound_method %int_1, %specific_fn.loc16 [concrete = constants.%bound_method.9a1]
-// CHECK:STDOUT:   %int.convert_checked.loc16: init %i32 = call %bound_method.loc16_13.2(%int_1) [concrete = constants.%int_1.5d2]
-// CHECK:STDOUT:   %.loc16_13.1: %i32 = value_of_initializer %int.convert_checked.loc16 [concrete = constants.%int_1.5d2]
-// CHECK:STDOUT:   %.loc16_13.2: %i32 = converted %int_1, %.loc16_13.1 [concrete = constants.%int_1.5d2]
-// CHECK:STDOUT:   %print.char.loc16: init %i32 = call %PrintChar.ref.loc16(%.loc16_13.2)
+// CHECK:STDOUT:   %impl.elem0.loc19: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
+// CHECK:STDOUT:   %bound_method.loc19_13.1: <bound method> = bound_method %int_1, %impl.elem0.loc19 [concrete = constants.%Convert.bound.ab5]
+// CHECK:STDOUT:   %specific_fn.loc19: <specific function> = specific_function %impl.elem0.loc19, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
+// CHECK:STDOUT:   %bound_method.loc19_13.2: <bound method> = bound_method %int_1, %specific_fn.loc19 [concrete = constants.%bound_method.9a1]
+// CHECK:STDOUT:   %int.convert_checked.loc19: init %i32 = call %bound_method.loc19_13.2(%int_1) [concrete = constants.%int_1.5d2]
+// CHECK:STDOUT:   %.loc19_13.1: %i32 = value_of_initializer %int.convert_checked.loc19 [concrete = constants.%int_1.5d2]
+// CHECK:STDOUT:   %.loc19_13.2: %i32 = converted %int_1, %.loc19_13.1 [concrete = constants.%int_1.5d2]
+// CHECK:STDOUT:   %print.char.loc19: init %i32 = call %PrintChar.ref.loc19(%.loc19_13.2)
 // CHECK:STDOUT:   %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
-// CHECK:STDOUT:   %PrintChar.ref.loc17: %PrintChar.type.089 = name_ref PrintChar, imports.%Core.PrintChar [concrete = constants.%PrintChar.d75]
+// CHECK:STDOUT:   %PrintChar.ref.loc20: %PrintChar.type.089 = name_ref PrintChar, imports.%Core.PrintChar [concrete = constants.%PrintChar.d75]
 // CHECK:STDOUT:   %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
-// CHECK:STDOUT:   %impl.elem0.loc17: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
-// CHECK:STDOUT:   %bound_method.loc17_18.1: <bound method> = bound_method %int_2, %impl.elem0.loc17 [concrete = constants.%Convert.bound.ef9]
-// CHECK:STDOUT:   %specific_fn.loc17: <specific function> = specific_function %impl.elem0.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
-// CHECK:STDOUT:   %bound_method.loc17_18.2: <bound method> = bound_method %int_2, %specific_fn.loc17 [concrete = constants.%bound_method.b92]
-// CHECK:STDOUT:   %int.convert_checked.loc17: init %i32 = call %bound_method.loc17_18.2(%int_2) [concrete = constants.%int_2.ef8]
-// CHECK:STDOUT:   %.loc17_18.1: %i32 = value_of_initializer %int.convert_checked.loc17 [concrete = constants.%int_2.ef8]
-// CHECK:STDOUT:   %.loc17_18.2: %i32 = converted %int_2, %.loc17_18.1 [concrete = constants.%int_2.ef8]
-// CHECK:STDOUT:   %print.char.loc17: init %i32 = call %PrintChar.ref.loc17(%.loc17_18.2)
-// CHECK:STDOUT:   return
+// CHECK:STDOUT:   %impl.elem0.loc20: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
+// CHECK:STDOUT:   %bound_method.loc20_18.1: <bound method> = bound_method %int_2, %impl.elem0.loc20 [concrete = constants.%Convert.bound.ef9]
+// CHECK:STDOUT:   %specific_fn.loc20: <specific function> = specific_function %impl.elem0.loc20, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
+// CHECK:STDOUT:   %bound_method.loc20_18.2: <bound method> = bound_method %int_2, %specific_fn.loc20 [concrete = constants.%bound_method.b92]
+// CHECK:STDOUT:   %int.convert_checked.loc20: init %i32 = call %bound_method.loc20_18.2(%int_2) [concrete = constants.%int_2.ef8]
+// CHECK:STDOUT:   %.loc20_18.1: %i32 = value_of_initializer %int.convert_checked.loc20 [concrete = constants.%int_2.ef8]
+// CHECK:STDOUT:   %.loc20_18.2: %i32 = converted %int_2, %.loc20_18.1 [concrete = constants.%int_2.ef8]
+// CHECK:STDOUT:   %print.char.loc20: init %i32 = call %PrintChar.ref.loc20(%.loc20_18.2)
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 12 - 37
toolchain/check/testdata/builtins/print/int.carbon

@@ -13,9 +13,10 @@ import Core library "io";
 fn Print(a: i32) = "print.int";
 
 fn Main() {
+  //@dump-sem-ir-begin
   Print(1);
-
   Core.Print(2);
+  //@dump-sem-ir-end
 }
 
 // CHECK:STDOUT: --- int.carbon
@@ -26,11 +27,8 @@ fn Main() {
 // CHECK:STDOUT:   %empty_tuple.type: type = tuple_type () [concrete]
 // CHECK:STDOUT:   %Int.generic: %Int.type = struct_value () [concrete]
 // CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
-// CHECK:STDOUT:   %pattern_type.7ce: type = pattern_type %i32 [concrete]
 // CHECK:STDOUT:   %Print.type.980: type = fn_type @Print.1 [concrete]
 // CHECK:STDOUT:   %Print.b7c: %Print.type.980 = struct_value () [concrete]
-// CHECK:STDOUT:   %Main.type: type = fn_type @Main [concrete]
-// CHECK:STDOUT:   %Main: %Main.type = struct_value () [concrete]
 // CHECK:STDOUT:   %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
 // CHECK:STDOUT:   %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete]
 // CHECK:STDOUT:   %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete]
@@ -72,41 +70,18 @@ fn Main() {
 // CHECK:STDOUT:   %Core.Print: %Print.type.6ed = import_ref Core//io, Print, loaded [concrete = constants.%Print.723]
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .Print = %Print.decl
-// CHECK:STDOUT:     .Main = %Main.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %Print.decl: %Print.type.980 = fn_decl @Print.1 [concrete = constants.%Print.b7c] {
-// CHECK:STDOUT:     %a.patt: %pattern_type.7ce = binding_pattern a [concrete]
-// CHECK:STDOUT:     %a.param_patt: %pattern_type.7ce = value_param_pattern %a.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %a.param: %i32 = value_param call_param0
-// CHECK:STDOUT:     %.loc13: type = splice_block %i32 [concrete = constants.%i32] {
-// CHECK:STDOUT:       %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
-// CHECK:STDOUT:       %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
-// CHECK:STDOUT:     }
-// CHECK:STDOUT:     %a: %i32 = bind_name a, %a.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Main.decl: %Main.type = fn_decl @Main [concrete = constants.%Main] {} {}
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Print.1(%a.param: %i32) = "print.int";
-// CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %Print.ref.loc16: %Print.type.980 = name_ref Print, file.%Print.decl [concrete = constants.%Print.b7c]
+// CHECK:STDOUT:   %Print.ref.loc17: %Print.type.980 = name_ref Print, file.%Print.decl [concrete = constants.%Print.b7c]
 // CHECK:STDOUT:   %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
-// CHECK:STDOUT:   %impl.elem0.loc16: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
-// CHECK:STDOUT:   %bound_method.loc16_9.1: <bound method> = bound_method %int_1, %impl.elem0.loc16 [concrete = constants.%Convert.bound.ab5]
-// CHECK:STDOUT:   %specific_fn.loc16: <specific function> = specific_function %impl.elem0.loc16, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
-// CHECK:STDOUT:   %bound_method.loc16_9.2: <bound method> = bound_method %int_1, %specific_fn.loc16 [concrete = constants.%bound_method.9a1]
-// CHECK:STDOUT:   %int.convert_checked.loc16: init %i32 = call %bound_method.loc16_9.2(%int_1) [concrete = constants.%int_1.5d2]
-// CHECK:STDOUT:   %.loc16_9.1: %i32 = value_of_initializer %int.convert_checked.loc16 [concrete = constants.%int_1.5d2]
-// CHECK:STDOUT:   %.loc16_9.2: %i32 = converted %int_1, %.loc16_9.1 [concrete = constants.%int_1.5d2]
-// CHECK:STDOUT:   %print.int.loc16: init %empty_tuple.type = call %Print.ref.loc16(%.loc16_9.2)
+// CHECK:STDOUT:   %impl.elem0.loc17: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956]
+// CHECK:STDOUT:   %bound_method.loc17_9.1: <bound method> = bound_method %int_1, %impl.elem0.loc17 [concrete = constants.%Convert.bound.ab5]
+// CHECK:STDOUT:   %specific_fn.loc17: <specific function> = specific_function %impl.elem0.loc17, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn]
+// CHECK:STDOUT:   %bound_method.loc17_9.2: <bound method> = bound_method %int_1, %specific_fn.loc17 [concrete = constants.%bound_method.9a1]
+// CHECK:STDOUT:   %int.convert_checked.loc17: init %i32 = call %bound_method.loc17_9.2(%int_1) [concrete = constants.%int_1.5d2]
+// CHECK:STDOUT:   %.loc17_9.1: %i32 = value_of_initializer %int.convert_checked.loc17 [concrete = constants.%int_1.5d2]
+// CHECK:STDOUT:   %.loc17_9.2: %i32 = converted %int_1, %.loc17_9.1 [concrete = constants.%int_1.5d2]
+// CHECK:STDOUT:   %print.int.loc17: init %empty_tuple.type = call %Print.ref.loc17(%.loc17_9.2)
 // CHECK:STDOUT:   %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
 // CHECK:STDOUT:   %Print.ref.loc18: %Print.type.6ed = name_ref Print, imports.%Core.Print [concrete = constants.%Print.723]
 // CHECK:STDOUT:   %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc]
@@ -118,6 +93,6 @@ fn Main() {
 // CHECK:STDOUT:   %.loc18_14.1: %i32 = value_of_initializer %int.convert_checked.loc18 [concrete = constants.%int_2.ef8]
 // CHECK:STDOUT:   %.loc18_14.2: %i32 = converted %int_2, %.loc18_14.1 [concrete = constants.%int_2.ef8]
 // CHECK:STDOUT:   %print.int.loc18: init %empty_tuple.type = call %Print.ref.loc18(%.loc18_14.2)
-// CHECK:STDOUT:   return
+// CHECK:STDOUT:   <elided>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:

+ 81 - 0
toolchain/check/testdata/builtins/read/char.carbon

@@ -0,0 +1,81 @@
+// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+// EXTRA-ARGS: --dump-sem-ir-ranges=only
+//
+// AUTOUPDATE
+// TIP: To test this file alone, run:
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/read/char.carbon
+// TIP: To dump output, run:
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/read/char.carbon
+
+// --- char.carbon
+
+import Core library "io";
+
+fn ReadChar() -> i32 = "read.char";
+
+fn Main() {
+  //@dump-sem-ir-begin
+  let n: i32 = ReadChar();
+  let m: i32 = Core.ReadChar();
+  //@dump-sem-ir-end
+}
+
+// CHECK:STDOUT: --- char.carbon
+// CHECK:STDOUT:
+// CHECK:STDOUT: constants {
+// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
+// CHECK:STDOUT:   %Int.type: type = generic_class_type @Int [concrete]
+// CHECK:STDOUT:   %Int.generic: %Int.type = struct_value () [concrete]
+// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
+// CHECK:STDOUT:   %pattern_type.7ce: type = pattern_type %i32 [concrete]
+// CHECK:STDOUT:   %ReadChar.type.fa8: type = fn_type @ReadChar.1 [concrete]
+// CHECK:STDOUT:   %ReadChar.7f4: %ReadChar.type.fa8 = struct_value () [concrete]
+// CHECK:STDOUT:   %ReadChar.type.9f3: type = fn_type @ReadChar.2 [concrete]
+// CHECK:STDOUT:   %ReadChar.01f: %ReadChar.type.9f3 = struct_value () [concrete]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: imports {
+// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
+// CHECK:STDOUT:     .Int = %Core.Int
+// CHECK:STDOUT:     .ReadChar = %Core.ReadChar
+// CHECK:STDOUT:     import Core//prelude
+// CHECK:STDOUT:     import Core//io
+// CHECK:STDOUT:     import Core//prelude/...
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
+// CHECK:STDOUT:   %Core.ReadChar: %ReadChar.type.9f3 = import_ref Core//io, ReadChar, loaded [concrete = constants.%ReadChar.01f]
+// CHECK:STDOUT: }
+// CHECK:STDOUT:
+// CHECK:STDOUT: fn @Main() {
+// CHECK:STDOUT: !entry:
+// CHECK:STDOUT:   name_binding_decl {
+// CHECK:STDOUT:     %n.patt: %pattern_type.7ce = binding_pattern n [concrete]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %ReadChar.ref.loc8: %ReadChar.type.fa8 = name_ref ReadChar, file.%ReadChar.decl [concrete = constants.%ReadChar.7f4]
+// CHECK:STDOUT:   %read.char.loc8: init %i32 = call %ReadChar.ref.loc8()
+// CHECK:STDOUT:   %.loc8_10: type = splice_block %i32.loc8 [concrete = constants.%i32] {
+// CHECK:STDOUT:     %int_32.loc8: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
+// CHECK:STDOUT:     %i32.loc8: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc8_25.1: ref %i32 = temporary_storage
+// CHECK:STDOUT:   %.loc8_25.2: ref %i32 = temporary %.loc8_25.1, %read.char.loc8
+// CHECK:STDOUT:   %n: ref %i32 = bind_name n, %.loc8_25.2
+// CHECK:STDOUT:   name_binding_decl {
+// CHECK:STDOUT:     %m.patt: %pattern_type.7ce = binding_pattern m [concrete]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
+// CHECK:STDOUT:   %ReadChar.ref.loc9: %ReadChar.type.9f3 = name_ref ReadChar, imports.%Core.ReadChar [concrete = constants.%ReadChar.01f]
+// CHECK:STDOUT:   %read.char.loc9: init %i32 = call %ReadChar.ref.loc9()
+// CHECK:STDOUT:   %.loc9_10: type = splice_block %i32.loc9 [concrete = constants.%i32] {
+// CHECK:STDOUT:     %int_32.loc9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
+// CHECK:STDOUT:     %i32.loc9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
+// CHECK:STDOUT:   }
+// CHECK:STDOUT:   %.loc9_30.1: ref %i32 = temporary_storage
+// CHECK:STDOUT:   %.loc9_30.2: ref %i32 = temporary %.loc9_30.1, %read.char.loc9
+// CHECK:STDOUT:   %m: ref %i32 = bind_name m, %.loc9_30.2
+// CHECK:STDOUT:   <elided>
+// CHECK:STDOUT: }
+// CHECK:STDOUT:

+ 0 - 98
toolchain/check/testdata/builtins/read/int.carbon

@@ -1,98 +0,0 @@
-// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
-// Exceptions. See /LICENSE for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-// AUTOUPDATE
-// TIP: To test this file alone, run:
-// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/read/int.carbon
-// TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/read/int.carbon
-
-import Core library "io";
-
-fn ReadChar() -> i32 = "read.char";
-
-fn Main() {
-  let n: i32 = ReadChar();
-  let m: i32 = Core.ReadChar();
-}
-
-// CHECK:STDOUT: --- int.carbon
-// CHECK:STDOUT:
-// CHECK:STDOUT: constants {
-// CHECK:STDOUT:   %int_32: Core.IntLiteral = int_value 32 [concrete]
-// CHECK:STDOUT:   %Int.type: type = generic_class_type @Int [concrete]
-// CHECK:STDOUT:   %Int.generic: %Int.type = struct_value () [concrete]
-// CHECK:STDOUT:   %i32: type = class_type @Int, @Int(%int_32) [concrete]
-// CHECK:STDOUT:   %pattern_type.7ce: type = pattern_type %i32 [concrete]
-// CHECK:STDOUT:   %ReadChar.type.fa8: type = fn_type @ReadChar.1 [concrete]
-// CHECK:STDOUT:   %ReadChar.7f4: %ReadChar.type.fa8 = struct_value () [concrete]
-// CHECK:STDOUT:   %Main.type: type = fn_type @Main [concrete]
-// CHECK:STDOUT:   %Main: %Main.type = struct_value () [concrete]
-// CHECK:STDOUT:   %ReadChar.type.9f3: type = fn_type @ReadChar.2 [concrete]
-// CHECK:STDOUT:   %ReadChar.01f: %ReadChar.type.9f3 = struct_value () [concrete]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: imports {
-// CHECK:STDOUT:   %Core: <namespace> = namespace file.%Core.import, [concrete] {
-// CHECK:STDOUT:     .Int = %Core.Int
-// CHECK:STDOUT:     .ReadChar = %Core.ReadChar
-// CHECK:STDOUT:     import Core//prelude
-// CHECK:STDOUT:     import Core//io
-// CHECK:STDOUT:     import Core//prelude/...
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic]
-// CHECK:STDOUT:   %Core.ReadChar: %ReadChar.type.9f3 = import_ref Core//io, ReadChar, loaded [concrete = constants.%ReadChar.01f]
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: file {
-// CHECK:STDOUT:   package: <namespace> = namespace [concrete] {
-// CHECK:STDOUT:     .Core = imports.%Core
-// CHECK:STDOUT:     .ReadChar = %ReadChar.decl
-// CHECK:STDOUT:     .Main = %Main.decl
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.import = import Core
-// CHECK:STDOUT:   %ReadChar.decl: %ReadChar.type.fa8 = fn_decl @ReadChar.1 [concrete = constants.%ReadChar.7f4] {
-// CHECK:STDOUT:     %return.patt: %pattern_type.7ce = return_slot_pattern [concrete]
-// CHECK:STDOUT:     %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param0 [concrete]
-// CHECK:STDOUT:   } {
-// CHECK:STDOUT:     %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
-// CHECK:STDOUT:     %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
-// CHECK:STDOUT:     %return.param: ref %i32 = out_param call_param0
-// CHECK:STDOUT:     %return: ref %i32 = return_slot %return.param
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Main.decl: %Main.type = fn_decl @Main [concrete = constants.%Main] {} {}
-// CHECK:STDOUT: }
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @ReadChar.1() -> %i32 = "read.char";
-// CHECK:STDOUT:
-// CHECK:STDOUT: fn @Main() {
-// CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %n.patt: %pattern_type.7ce = binding_pattern n [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %ReadChar.ref.loc16: %ReadChar.type.fa8 = name_ref ReadChar, file.%ReadChar.decl [concrete = constants.%ReadChar.7f4]
-// CHECK:STDOUT:   %read.char.loc16: init %i32 = call %ReadChar.ref.loc16()
-// CHECK:STDOUT:   %.loc16_10: type = splice_block %i32.loc16 [concrete = constants.%i32] {
-// CHECK:STDOUT:     %int_32.loc16: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
-// CHECK:STDOUT:     %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %.loc16_25.1: ref %i32 = temporary_storage
-// CHECK:STDOUT:   %.loc16_25.2: ref %i32 = temporary %.loc16_25.1, %read.char.loc16
-// CHECK:STDOUT:   %n: ref %i32 = bind_name n, %.loc16_25.2
-// CHECK:STDOUT:   name_binding_decl {
-// CHECK:STDOUT:     %m.patt: %pattern_type.7ce = binding_pattern m [concrete]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
-// CHECK:STDOUT:   %ReadChar.ref.loc17: %ReadChar.type.9f3 = name_ref ReadChar, imports.%Core.ReadChar [concrete = constants.%ReadChar.01f]
-// CHECK:STDOUT:   %read.char.loc17: init %i32 = call %ReadChar.ref.loc17()
-// CHECK:STDOUT:   %.loc17_10: type = splice_block %i32.loc17 [concrete = constants.%i32] {
-// CHECK:STDOUT:     %int_32.loc17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
-// CHECK:STDOUT:     %i32.loc17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
-// CHECK:STDOUT:   }
-// CHECK:STDOUT:   %.loc17_30.1: ref %i32 = temporary_storage
-// CHECK:STDOUT:   %.loc17_30.2: ref %i32 = temporary %.loc17_30.1, %read.char.loc17
-// CHECK:STDOUT:   %m: ref %i32 = bind_name m, %.loc17_30.2
-// CHECK:STDOUT:   return
-// CHECK:STDOUT: }
-// CHECK:STDOUT: