Просмотр исходного кода

Include the expression category in the semantics IR dump. (#3175)

Describe the broad expression category (value / reference /
initializing) in the semantics IR textual format. This is redundant
information that can be calculated from the text that's already in the
output, but seems useful for understanding the structure of the IR.
Richard Smith 2 лет назад
Родитель
Сommit
f6662807ba
94 измененных файлов с 237 добавлено и 225 удалено
  1. 12 0
      toolchain/semantics/semantics_ir_formatter.cpp
  2. 4 4
      toolchain/semantics/testdata/array/assign_return_value.carbon
  3. 2 2
      toolchain/semantics/testdata/array/assign_var.carbon
  4. 3 3
      toolchain/semantics/testdata/array/base.carbon
  5. 1 1
      toolchain/semantics/testdata/array/fail_invalid_type.carbon
  6. 1 1
      toolchain/semantics/testdata/array/fail_out_of_bound.carbon
  7. 1 1
      toolchain/semantics/testdata/array/fail_type_mismatch.carbon
  8. 4 4
      toolchain/semantics/testdata/basics/builtin_types.carbon
  9. 1 1
      toolchain/semantics/testdata/basics/fail_non_type_as_type.carbon
  10. 2 2
      toolchain/semantics/testdata/basics/fail_qualifier_unsupported.carbon
  11. 1 1
      toolchain/semantics/testdata/basics/parens.carbon
  12. 8 8
      toolchain/semantics/testdata/expression_category/in_place_tuple_initialization.carbon
  13. 1 1
      toolchain/semantics/testdata/function/call/empty_struct.carbon
  14. 1 1
      toolchain/semantics/testdata/function/call/empty_tuple.carbon
  15. 2 2
      toolchain/semantics/testdata/function/call/fail_return_type_mismatch.carbon
  16. 2 2
      toolchain/semantics/testdata/function/call/i32.carbon
  17. 1 1
      toolchain/semantics/testdata/function/call/more_param_ir.carbon
  18. 1 1
      toolchain/semantics/testdata/function/call/params_one.carbon
  19. 2 2
      toolchain/semantics/testdata/function/call/params_one_comma.carbon
  20. 1 1
      toolchain/semantics/testdata/function/call/params_two.carbon
  21. 2 2
      toolchain/semantics/testdata/function/call/params_two_comma.carbon
  22. 1 1
      toolchain/semantics/testdata/function/call/params_zero.carbon
  23. 2 2
      toolchain/semantics/testdata/function/call/return_implicit.carbon
  24. 1 1
      toolchain/semantics/testdata/function/declaration/simple.carbon
  25. 3 3
      toolchain/semantics/testdata/if/else.carbon
  26. 1 1
      toolchain/semantics/testdata/if/fail_scope.carbon
  27. 2 2
      toolchain/semantics/testdata/if/no_else.carbon
  28. 12 12
      toolchain/semantics/testdata/if_expression/constant_condition.carbon
  29. 6 6
      toolchain/semantics/testdata/if_expression/control_flow.carbon
  30. 6 6
      toolchain/semantics/testdata/index/array_element_access.carbon
  31. 3 3
      toolchain/semantics/testdata/index/fail_array_large_index.carbon
  32. 3 3
      toolchain/semantics/testdata/index/fail_array_non_int_indexing.carbon
  33. 3 3
      toolchain/semantics/testdata/index/fail_array_out_of_bound_access.carbon
  34. 4 4
      toolchain/semantics/testdata/index/fail_empty_tuple_access.carbon
  35. 1 1
      toolchain/semantics/testdata/index/fail_name_not_found.carbon
  36. 4 4
      toolchain/semantics/testdata/index/fail_non_deterministic_type.carbon
  37. 4 4
      toolchain/semantics/testdata/index/fail_tuple_large_index.carbon
  38. 3 3
      toolchain/semantics/testdata/index/fail_tuple_non_int_indexing.carbon
  39. 3 3
      toolchain/semantics/testdata/index/fail_tuple_out_of_bound_access.carbon
  40. 4 4
      toolchain/semantics/testdata/index/tuple_element_access.carbon
  41. 4 4
      toolchain/semantics/testdata/index/tuple_return_value_access.carbon
  42. 2 2
      toolchain/semantics/testdata/ir/duplicate_name_same_line.carbon
  43. 1 1
      toolchain/semantics/testdata/namespace/function.carbon
  44. 1 1
      toolchain/semantics/testdata/namespace/nested.carbon
  45. 6 6
      toolchain/semantics/testdata/operators/and.carbon
  46. 10 10
      toolchain/semantics/testdata/operators/assignment.carbon
  47. 3 3
      toolchain/semantics/testdata/operators/fail_assigment_to_non_assignable.carbon
  48. 1 1
      toolchain/semantics/testdata/operators/fail_type_mismatch_assignment.carbon
  49. 6 6
      toolchain/semantics/testdata/operators/or.carbon
  50. 3 3
      toolchain/semantics/testdata/pointer/address_of_deref.carbon
  51. 11 11
      toolchain/semantics/testdata/pointer/address_of_lvalue.carbon
  52. 3 3
      toolchain/semantics/testdata/pointer/basic.carbon
  53. 6 6
      toolchain/semantics/testdata/pointer/fail_address_of_value.carbon
  54. 3 3
      toolchain/semantics/testdata/pointer/fail_dereference_not_pointer.carbon
  55. 2 2
      toolchain/semantics/testdata/pointer/fail_dereference_type.carbon
  56. 2 2
      toolchain/semantics/testdata/pointer/nested_const.carbon
  57. 2 2
      toolchain/semantics/testdata/struct/empty.carbon
  58. 1 1
      toolchain/semantics/testdata/struct/fail_assign_empty.carbon
  59. 1 1
      toolchain/semantics/testdata/struct/fail_assign_nested.carbon
  60. 1 1
      toolchain/semantics/testdata/struct/fail_assign_to_empty.carbon
  61. 1 1
      toolchain/semantics/testdata/struct/fail_field_name_mismatch.carbon
  62. 1 1
      toolchain/semantics/testdata/struct/fail_field_type_mismatch.carbon
  63. 2 2
      toolchain/semantics/testdata/struct/fail_member_access_type.carbon
  64. 2 2
      toolchain/semantics/testdata/struct/fail_non_member_access.carbon
  65. 1 1
      toolchain/semantics/testdata/struct/fail_too_few_values.carbon
  66. 1 1
      toolchain/semantics/testdata/struct/fail_type_assign.carbon
  67. 1 1
      toolchain/semantics/testdata/struct/fail_value_as_type.carbon
  68. 4 4
      toolchain/semantics/testdata/struct/member_access.carbon
  69. 2 2
      toolchain/semantics/testdata/struct/one_entry.carbon
  70. 2 2
      toolchain/semantics/testdata/struct/tuple_as_element.carbon
  71. 2 2
      toolchain/semantics/testdata/struct/two_entries.carbon
  72. 2 2
      toolchain/semantics/testdata/tuples/empty.carbon
  73. 1 1
      toolchain/semantics/testdata/tuples/fail_assign_empty.carbon
  74. 1 1
      toolchain/semantics/testdata/tuples/fail_assign_nested.carbon
  75. 1 1
      toolchain/semantics/testdata/tuples/fail_assign_to_empty.carbon
  76. 1 1
      toolchain/semantics/testdata/tuples/fail_element_type_mismatch.carbon
  77. 1 1
      toolchain/semantics/testdata/tuples/fail_too_few_element.carbon
  78. 1 1
      toolchain/semantics/testdata/tuples/fail_type_assign.carbon
  79. 1 1
      toolchain/semantics/testdata/tuples/fail_value_as_type.carbon
  80. 1 1
      toolchain/semantics/testdata/tuples/nested_tuple.carbon
  81. 2 2
      toolchain/semantics/testdata/tuples/one_element.carbon
  82. 2 2
      toolchain/semantics/testdata/tuples/two_elements.carbon
  83. 1 1
      toolchain/semantics/testdata/var/decl.carbon
  84. 1 1
      toolchain/semantics/testdata/var/decl_with_init.carbon
  85. 2 2
      toolchain/semantics/testdata/var/fail_duplicate_decl.carbon
  86. 1 1
      toolchain/semantics/testdata/var/fail_init_type_mismatch.carbon
  87. 1 1
      toolchain/semantics/testdata/var/fail_init_with_self.carbon
  88. 2 2
      toolchain/semantics/testdata/var/fail_lookup_outside_scope.carbon
  89. 1 1
      toolchain/semantics/testdata/var/fail_storage_is_literal.carbon
  90. 1 1
      toolchain/semantics/testdata/var/global_decl.carbon
  91. 1 1
      toolchain/semantics/testdata/var/global_decl_with_init.carbon
  92. 2 2
      toolchain/semantics/testdata/var/global_lookup.carbon
  93. 2 2
      toolchain/semantics/testdata/var/global_lookup_in_scope.carbon
  94. 1 1
      toolchain/semantics/testdata/var/lookup.carbon

+ 12 - 0
toolchain/semantics/semantics_ir_formatter.cpp

@@ -516,6 +516,18 @@ class Formatter {
       case NodeValueKind::Typed:
         FormatNodeName(node_id);
         out_ << ": ";
+        switch (GetExpressionCategory(semantics_ir_, node_id)) {
+          case ExpressionCategory::NotExpression:
+          case ExpressionCategory::Value:
+            break;
+          case ExpressionCategory::DurableReference:
+          case ExpressionCategory::EphemeralReference:
+            out_ << "ref ";
+            break;
+          case ExpressionCategory::Initializing:
+            out_ << "init ";
+            break;
+        }
         FormatType(node.type_id());
         out_ << " = ";
         break;

+ 4 - 4
toolchain/semantics/testdata/array/assign_return_value.carbon

@@ -121,10 +121,10 @@ fn Run() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc10_16: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_17: type = array_type %.loc10_16, i32
-// CHECK:STDOUT:   %t: [i32; 1] = var "t"
-// CHECK:STDOUT:   %.loc10_22.1: (i32,) = call @F()
-// CHECK:STDOUT:   %.loc10_22.2: (i32,) = temporary_storage
-// CHECK:STDOUT:   %.loc10_22.3: (i32,) = temporary %.loc10_22.2, %.loc10_22.1
+// CHECK:STDOUT:   %t: ref [i32; 1] = var "t"
+// CHECK:STDOUT:   %.loc10_22.1: init (i32,) = call @F()
+// CHECK:STDOUT:   %.loc10_22.2: ref (i32,) = temporary_storage
+// CHECK:STDOUT:   %.loc10_22.3: ref (i32,) = temporary %.loc10_22.2, %.loc10_22.1
 // CHECK:STDOUT:   %.loc10_22.4: (i32,) = bind_value %.loc10_22.3
 // CHECK:STDOUT:   %.loc10_22.5: [i32; 1] = array_value %.loc10_22.4
 // CHECK:STDOUT:   assign %t, %.loc10_22.5

+ 2 - 2
toolchain/semantics/testdata/array/assign_var.carbon

@@ -108,7 +108,7 @@ var b: [i32; 3] = a;
 // CHECK:STDOUT:   %.loc7_22.1: type = tuple_type (type, type, type)
 // CHECK:STDOUT:   %.loc7_22.2: (type, type, type) = tuple_value (%.loc7_9, %.loc7_14, %.loc7_19)
 // CHECK:STDOUT:   %.loc7_22.3: type = tuple_type (i32, i32, i32)
-// CHECK:STDOUT:   %a: (i32, i32, i32) = var "a"
+// CHECK:STDOUT:   %a: ref (i32, i32, i32) = var "a"
 // CHECK:STDOUT:   %.loc7_27.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc7_27.2: i32 = stub_reference %.loc7_27.1
 // CHECK:STDOUT:   %.loc7_30.1: i32 = int_literal 2
@@ -119,7 +119,7 @@ var b: [i32; 3] = a;
 // CHECK:STDOUT:   assign %a, %.loc7_34
 // CHECK:STDOUT:   %.loc8_14: i32 = int_literal 3
 // CHECK:STDOUT:   %.loc8_15: type = array_type %.loc8_14, i32
-// CHECK:STDOUT:   %b: [i32; 3] = var "b"
+// CHECK:STDOUT:   %b: ref [i32; 3] = var "b"
 // CHECK:STDOUT:   %.loc7_5.1: (i32, i32, i32) = bind_value %a
 // CHECK:STDOUT:   %.loc7_5.2: [i32; 3] = array_value %.loc7_5.1
 // CHECK:STDOUT:   assign %b, %.loc7_5.2

+ 3 - 3
toolchain/semantics/testdata/array/base.carbon

@@ -159,7 +159,7 @@ var c: [(); 5] = ((), (), (), (), (),);
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_14: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc7_15: type = array_type %.loc7_14, i32
-// CHECK:STDOUT:   %a: [i32; 1] = var "a"
+// CHECK:STDOUT:   %a: ref [i32; 1] = var "a"
 // CHECK:STDOUT:   %.loc7_20.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc7_20.2: i32 = stub_reference %.loc7_20.1
 // CHECK:STDOUT:   %.loc7_22.1: type = tuple_type (i32)
@@ -168,7 +168,7 @@ var c: [(); 5] = ((), (), (), (), (),);
 // CHECK:STDOUT:   assign %a, %.loc7_22.3
 // CHECK:STDOUT:   %.loc8_14: i32 = int_literal 2
 // CHECK:STDOUT:   %.loc8_15: type = array_type %.loc8_14, f64
-// CHECK:STDOUT:   %b: [f64; 2] = var "b"
+// CHECK:STDOUT:   %b: ref [f64; 2] = var "b"
 // CHECK:STDOUT:   %.loc8_20.1: f64 = real_literal 111e-1
 // CHECK:STDOUT:   %.loc8_20.2: f64 = stub_reference %.loc8_20.1
 // CHECK:STDOUT:   %.loc8_26.1: f64 = real_literal 22e-1
@@ -181,7 +181,7 @@ var c: [(); 5] = ((), (), (), (), (),);
 // CHECK:STDOUT:   %.loc9_10.2: () = tuple_value ()
 // CHECK:STDOUT:   %.loc9_13: i32 = int_literal 5
 // CHECK:STDOUT:   %.loc9_14: type = array_type %.loc9_13, ()
-// CHECK:STDOUT:   %c: [(); 5] = var "c"
+// CHECK:STDOUT:   %c: ref [(); 5] = var "c"
 // CHECK:STDOUT:   %.loc9_20.1: () = tuple_value ()
 // CHECK:STDOUT:   %.loc9_20.2: () = stub_reference %.loc9_20.1
 // CHECK:STDOUT:   %.loc9_24.1: () = tuple_value ()

+ 1 - 1
toolchain/semantics/testdata/array/fail_invalid_type.carbon

@@ -48,5 +48,5 @@ var a: [1; 1];
 // CHECK:STDOUT:   %.loc10_9: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_12: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_13: type = array_type %.loc10_12, <error>
-// CHECK:STDOUT:   %a: [<error>; 1] = var "a"
+// CHECK:STDOUT:   %a: ref [<error>; 1] = var "a"
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/array/fail_out_of_bound.carbon

@@ -76,7 +76,7 @@ var a: [i32; 1] = (1, 2, 3);
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc10_14: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_15: type = array_type %.loc10_14, i32
-// CHECK:STDOUT:   %a: [i32; 1] = var "a"
+// CHECK:STDOUT:   %a: ref [i32; 1] = var "a"
 // CHECK:STDOUT:   %.loc10_20.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_20.2: i32 = stub_reference %.loc10_20.1
 // CHECK:STDOUT:   %.loc10_23.1: i32 = int_literal 2

+ 1 - 1
toolchain/semantics/testdata/array/fail_type_mismatch.carbon

@@ -70,7 +70,7 @@ var a: [i32; 2] = (1, 2.5);
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc10_14: i32 = int_literal 2
 // CHECK:STDOUT:   %.loc10_15: type = array_type %.loc10_14, i32
-// CHECK:STDOUT:   %a: [i32; 2] = var "a"
+// CHECK:STDOUT:   %a: ref [i32; 2] = var "a"
 // CHECK:STDOUT:   %.loc10_20.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_20.2: i32 = stub_reference %.loc10_20.1
 // CHECK:STDOUT:   %.loc10_23.1: f64 = real_literal 25e-1

+ 4 - 4
toolchain/semantics/testdata/basics/builtin_types.carbon

@@ -64,15 +64,15 @@ var test_type: type = i32;
 // CHECK:STDOUT: ]
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
-// CHECK:STDOUT:   %test_i32: i32 = var "test_i32"
+// CHECK:STDOUT:   %test_i32: ref i32 = var "test_i32"
 // CHECK:STDOUT:   %.loc7: i32 = int_literal 0
 // CHECK:STDOUT:   assign %test_i32, %.loc7
-// CHECK:STDOUT:   %test_f64: f64 = var "test_f64"
+// CHECK:STDOUT:   %test_f64: ref f64 = var "test_f64"
 // CHECK:STDOUT:   %.loc8: f64 = real_literal 1e-1
 // CHECK:STDOUT:   assign %test_f64, %.loc8
-// CHECK:STDOUT:   %test_str: String = var "test_str"
+// CHECK:STDOUT:   %test_str: ref String = var "test_str"
 // CHECK:STDOUT:   %.loc9: String = string_literal "Test"
 // CHECK:STDOUT:   assign %test_str, %.loc9
-// CHECK:STDOUT:   %test_type: type = var "test_type"
+// CHECK:STDOUT:   %test_type: ref type = var "test_type"
 // CHECK:STDOUT:   assign %test_type, i32
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/basics/fail_non_type_as_type.carbon

@@ -41,7 +41,7 @@ var x: type = 42;
 // CHECK:STDOUT: ]
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
-// CHECK:STDOUT:   %x: type = var "x"
+// CHECK:STDOUT:   %x: ref type = var "x"
 // CHECK:STDOUT:   %.loc10: i32 = int_literal 42
 // CHECK:STDOUT:   assign %x, <error>
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/basics/fail_qualifier_unsupported.carbon

@@ -43,7 +43,7 @@ var y: i32 = x.b;
 // CHECK:STDOUT: ]
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
-// CHECK:STDOUT:   %x: i32 = var "x"
-// CHECK:STDOUT:   %y: i32 = var "y"
+// CHECK:STDOUT:   %x: ref i32 = var "x"
+// CHECK:STDOUT:   %y: ref i32 = var "y"
 // CHECK:STDOUT:   assign %y, <error>
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/basics/parens.carbon

@@ -43,7 +43,7 @@ var test_i32: i32 = ((1) + (2));
 // CHECK:STDOUT: ]
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
-// CHECK:STDOUT:   %test_i32: i32 = var "test_i32"
+// CHECK:STDOUT:   %test_i32: ref i32 = var "test_i32"
 // CHECK:STDOUT:   %.loc7_23: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc7_29: i32 = int_literal 2
 // CHECK:STDOUT:   %.loc7_26: i32 = add %.loc7_23, %.loc7_29

+ 8 - 8
toolchain/semantics/testdata/expression_category/in_place_tuple_initialization.carbon

@@ -173,25 +173,25 @@ fn H() -> i32 {
 // CHECK:STDOUT:   %.loc10_11: type = stub_reference i32
 // CHECK:STDOUT:   %.loc10_16: type = stub_reference i32
 // CHECK:STDOUT:   %.loc10_19: (type, type) = tuple_value (%.loc10_11, %.loc10_16)
-// CHECK:STDOUT:   %v: (i32, i32) = var "v"
+// CHECK:STDOUT:   %v: ref (i32, i32) = var "v"
 // CHECK:STDOUT:   no_op
-// CHECK:STDOUT:   %.loc10_24: (i32, i32) = call @F() to %v
+// CHECK:STDOUT:   %.loc10_24: init (i32, i32) = call @F() to %v
 // CHECK:STDOUT:   assign %v, %.loc10_24
 // CHECK:STDOUT:   no_op
-// CHECK:STDOUT:   %.loc11: (i32, i32) = call @F() to %v
+// CHECK:STDOUT:   %.loc11: init (i32, i32) = call @F() to %v
 // CHECK:STDOUT:   assign %v, %.loc11
 // CHECK:STDOUT:   no_op
-// CHECK:STDOUT:   %.loc12: (i32, i32) = call @F() to %return
+// CHECK:STDOUT:   %.loc12: init (i32, i32) = call @F() to %return
 // CHECK:STDOUT:   return %.loc12
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @H() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc16_11.1: (i32, i32) = temporary_storage
-// CHECK:STDOUT:   %.loc16_11.2: (i32, i32) = call @G() to %.loc16_11.1
+// CHECK:STDOUT:   %.loc16_11.1: ref (i32, i32) = temporary_storage
+// CHECK:STDOUT:   %.loc16_11.2: init (i32, i32) = call @G() to %.loc16_11.1
 // CHECK:STDOUT:   %.loc16_14: i32 = int_literal 0
-// CHECK:STDOUT:   %.loc16_11.3: (i32, i32) = temporary %.loc16_11.1, %.loc16_11.2
-// CHECK:STDOUT:   %.loc16_15.1: i32 = tuple_index %.loc16_11.3, %.loc16_14
+// CHECK:STDOUT:   %.loc16_11.3: ref (i32, i32) = temporary %.loc16_11.1, %.loc16_11.2
+// CHECK:STDOUT:   %.loc16_15.1: ref i32 = tuple_index %.loc16_11.3, %.loc16_14
 // CHECK:STDOUT:   %.loc16_15.2: i32 = bind_value %.loc16_15.1
 // CHECK:STDOUT:   return %.loc16_15.2
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/function/call/empty_struct.carbon

@@ -91,6 +91,6 @@ fn Main() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc12_9.1: {} = struct_value ()
 // CHECK:STDOUT:   %.loc12_9.2: {} = stub_reference %.loc12_9.1
-// CHECK:STDOUT:   %.loc12_7: {} = call @Echo(%.loc12_9.2)
+// CHECK:STDOUT:   %.loc12_7: init {} = call @Echo(%.loc12_9.2)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/function/call/empty_tuple.carbon

@@ -93,6 +93,6 @@ fn Main() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc12_9.1: () = tuple_value ()
 // CHECK:STDOUT:   %.loc12_9.2: () = stub_reference %.loc12_9.1
-// CHECK:STDOUT:   %.loc12_7: () = call @Echo(%.loc12_9.2)
+// CHECK:STDOUT:   %.loc12_7: init () = call @Echo(%.loc12_9.2)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/function/call/fail_return_type_mismatch.carbon

@@ -81,8 +81,8 @@ fn Run() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Run() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x: i32 = var "x"
-// CHECK:STDOUT:   %.loc13: f64 = call @Foo()
+// CHECK:STDOUT:   %x: ref i32 = var "x"
+// CHECK:STDOUT:   %.loc13: init f64 = call @Foo()
 // CHECK:STDOUT:   assign %x, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/function/call/i32.carbon

@@ -89,10 +89,10 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %b: i32 = var "b"
+// CHECK:STDOUT:   %b: ref i32 = var "b"
 // CHECK:STDOUT:   %.loc12_21.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc12_21.2: i32 = stub_reference %.loc12_21.1
-// CHECK:STDOUT:   %.loc12_20: i32 = call @Echo(%.loc12_21.2)
+// CHECK:STDOUT:   %.loc12_20: init i32 = call @Echo(%.loc12_21.2)
 // CHECK:STDOUT:   assign %b, %.loc12_20
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/function/call/more_param_ir.carbon

@@ -133,6 +133,6 @@ fn Main() {
 // CHECK:STDOUT:   %.loc11_25.1: i32 = int_literal 6
 // CHECK:STDOUT:   %.loc11_25.2: i32 = stub_reference %.loc11_25.1
 // CHECK:STDOUT:   %.loc11_6.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc11_6.2: () = call @Foo(%.loc11_13.2, %.loc11_20.2, %.loc11_25.2)
+// CHECK:STDOUT:   %.loc11_6.2: init () = call @Foo(%.loc11_13.2, %.loc11_20.2, %.loc11_25.2)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/function/call/params_one.carbon

@@ -87,6 +87,6 @@ fn Main() {
 // CHECK:STDOUT:   %.loc10_7.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_7.2: i32 = stub_reference %.loc10_7.1
 // CHECK:STDOUT:   %.loc10_6.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc10_6.2: () = call @Foo(%.loc10_7.2)
+// CHECK:STDOUT:   %.loc10_6.2: init () = call @Foo(%.loc10_7.2)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/function/call/params_one_comma.carbon

@@ -98,9 +98,9 @@ fn Main() {
 // CHECK:STDOUT:   %.loc10_7.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_7.2: i32 = stub_reference %.loc10_7.1
 // CHECK:STDOUT:   %.loc10_6.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc10_6.2: () = call @Foo(%.loc10_7.2)
+// CHECK:STDOUT:   %.loc10_6.2: init () = call @Foo(%.loc10_7.2)
 // CHECK:STDOUT:   %.loc11_7.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc11_7.2: i32 = stub_reference %.loc11_7.1
-// CHECK:STDOUT:   %.loc11_6: () = call @Foo(%.loc11_7.2)
+// CHECK:STDOUT:   %.loc11_6: init () = call @Foo(%.loc11_7.2)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/function/call/params_two.carbon

@@ -99,6 +99,6 @@ fn Main() {
 // CHECK:STDOUT:   %.loc10_10.1: i32 = int_literal 2
 // CHECK:STDOUT:   %.loc10_10.2: i32 = stub_reference %.loc10_10.1
 // CHECK:STDOUT:   %.loc10_6.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc10_6.2: () = call @Foo(%.loc10_7.2, %.loc10_10.2)
+// CHECK:STDOUT:   %.loc10_6.2: init () = call @Foo(%.loc10_7.2, %.loc10_10.2)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/function/call/params_two_comma.carbon

@@ -116,11 +116,11 @@ fn Main() {
 // CHECK:STDOUT:   %.loc10_10.1: i32 = int_literal 2
 // CHECK:STDOUT:   %.loc10_10.2: i32 = stub_reference %.loc10_10.1
 // CHECK:STDOUT:   %.loc10_6.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc10_6.2: () = call @Foo(%.loc10_7.2, %.loc10_10.2)
+// CHECK:STDOUT:   %.loc10_6.2: init () = call @Foo(%.loc10_7.2, %.loc10_10.2)
 // CHECK:STDOUT:   %.loc11_7.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc11_7.2: i32 = stub_reference %.loc11_7.1
 // CHECK:STDOUT:   %.loc11_10.1: i32 = int_literal 2
 // CHECK:STDOUT:   %.loc11_10.2: i32 = stub_reference %.loc11_10.1
-// CHECK:STDOUT:   %.loc11_6: () = call @Foo(%.loc11_7.2, %.loc11_10.2)
+// CHECK:STDOUT:   %.loc11_6: init () = call @Foo(%.loc11_7.2, %.loc11_10.2)
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/function/call/params_zero.carbon

@@ -68,6 +68,6 @@ fn Main() {
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc10_6.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc10_6.2: () = call @Foo()
+// CHECK:STDOUT:   %.loc10_6.2: init () = call @Foo()
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/function/call/return_implicit.carbon

@@ -77,8 +77,8 @@ fn Main() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc11_11.1: type = tuple_type ()
 // CHECK:STDOUT:   %.loc11_11.2: () = tuple_value ()
-// CHECK:STDOUT:   %b: () = var "b"
-// CHECK:STDOUT:   %.loc11_37: () = call @MakeImplicitEmptyTuple()
+// CHECK:STDOUT:   %b: ref () = var "b"
+// CHECK:STDOUT:   %.loc11_37: init () = call @MakeImplicitEmptyTuple()
 // CHECK:STDOUT:   assign %b, %.loc11_37
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/function/declaration/simple.carbon

@@ -59,6 +59,6 @@ fn G() { F(); }
 // CHECK:STDOUT: fn @G() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc9_11.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc9_11.2: () = call @F()
+// CHECK:STDOUT:   %.loc9_11.2: init () = call @F()
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 3 - 3
toolchain/semantics/testdata/if/else.carbon

@@ -133,14 +133,14 @@ fn If(b: bool) {
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.then:
 // CHECK:STDOUT:   %.loc13_6.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc13_6.2: () = call @F()
+// CHECK:STDOUT:   %.loc13_6.2: init () = call @F()
 // CHECK:STDOUT:   br !if.done
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.else:
-// CHECK:STDOUT:   %.loc15: () = call @G()
+// CHECK:STDOUT:   %.loc15: init () = call @G()
 // CHECK:STDOUT:   br !if.done
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.done:
-// CHECK:STDOUT:   %.loc17: () = call @H()
+// CHECK:STDOUT:   %.loc17: init () = call @H()
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/if/fail_scope.carbon

@@ -88,7 +88,7 @@ fn VarScope(b: bool) -> i32 {
 // CHECK:STDOUT:   if %b br !if.then else br !if.else
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.then:
-// CHECK:STDOUT:   %n: i32 = var "n"
+// CHECK:STDOUT:   %n: ref i32 = var "n"
 // CHECK:STDOUT:   %.loc9_18: i32 = int_literal 2
 // CHECK:STDOUT:   assign %n, %.loc9_18
 // CHECK:STDOUT:   %.loc9_9: i32 = bind_value %n

+ 2 - 2
toolchain/semantics/testdata/if/no_else.carbon

@@ -110,10 +110,10 @@ fn If(b: bool) {
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.then:
 // CHECK:STDOUT:   %.loc12_6.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc12_6.2: () = call @F()
+// CHECK:STDOUT:   %.loc12_6.2: init () = call @F()
 // CHECK:STDOUT:   br !if.else
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.else:
-// CHECK:STDOUT:   %.loc14: () = call @G()
+// CHECK:STDOUT:   %.loc14: init () = call @G()
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 12 - 12
toolchain/semantics/testdata/if_expression/constant_condition.carbon

@@ -187,16 +187,16 @@ fn G() -> i32 {
 // CHECK:STDOUT:   if %.loc11_13 br !if.expr.then else br !if.expr.else
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.expr.then:
-// CHECK:STDOUT:   %.loc11_24.1: i32 = call @A()
-// CHECK:STDOUT:   %.loc11_24.2: i32 = temporary_storage
-// CHECK:STDOUT:   %.loc11_24.3: i32 = temporary %.loc11_24.2, %.loc11_24.1
+// CHECK:STDOUT:   %.loc11_24.1: init i32 = call @A()
+// CHECK:STDOUT:   %.loc11_24.2: ref i32 = temporary_storage
+// CHECK:STDOUT:   %.loc11_24.3: ref i32 = temporary %.loc11_24.2, %.loc11_24.1
 // CHECK:STDOUT:   %.loc11_24.4: i32 = bind_value %.loc11_24.3
 // CHECK:STDOUT:   br !if.expr.result(%.loc11_24.4)
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.expr.else:
-// CHECK:STDOUT:   %.loc11_33.1: i32 = call @B()
-// CHECK:STDOUT:   %.loc11_33.2: i32 = temporary_storage
-// CHECK:STDOUT:   %.loc11_33.3: i32 = temporary %.loc11_33.2, %.loc11_33.1
+// CHECK:STDOUT:   %.loc11_33.1: init i32 = call @B()
+// CHECK:STDOUT:   %.loc11_33.2: ref i32 = temporary_storage
+// CHECK:STDOUT:   %.loc11_33.3: ref i32 = temporary %.loc11_33.2, %.loc11_33.1
 // CHECK:STDOUT:   %.loc11_33.4: i32 = bind_value %.loc11_33.3
 // CHECK:STDOUT:   br !if.expr.result(%.loc11_33.4)
 // CHECK:STDOUT:
@@ -211,16 +211,16 @@ fn G() -> i32 {
 // CHECK:STDOUT:   if %.loc15_13 br !if.expr.then else br !if.expr.else
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.expr.then:
-// CHECK:STDOUT:   %.loc15_25.1: i32 = call @A()
-// CHECK:STDOUT:   %.loc15_25.2: i32 = temporary_storage
-// CHECK:STDOUT:   %.loc15_25.3: i32 = temporary %.loc15_25.2, %.loc15_25.1
+// CHECK:STDOUT:   %.loc15_25.1: init i32 = call @A()
+// CHECK:STDOUT:   %.loc15_25.2: ref i32 = temporary_storage
+// CHECK:STDOUT:   %.loc15_25.3: ref i32 = temporary %.loc15_25.2, %.loc15_25.1
 // CHECK:STDOUT:   %.loc15_25.4: i32 = bind_value %.loc15_25.3
 // CHECK:STDOUT:   br !if.expr.result(%.loc15_25.4)
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.expr.else:
-// CHECK:STDOUT:   %.loc15_34.1: i32 = call @B()
-// CHECK:STDOUT:   %.loc15_34.2: i32 = temporary_storage
-// CHECK:STDOUT:   %.loc15_34.3: i32 = temporary %.loc15_34.2, %.loc15_34.1
+// CHECK:STDOUT:   %.loc15_34.1: init i32 = call @B()
+// CHECK:STDOUT:   %.loc15_34.2: ref i32 = temporary_storage
+// CHECK:STDOUT:   %.loc15_34.3: ref i32 = temporary %.loc15_34.2, %.loc15_34.1
 // CHECK:STDOUT:   %.loc15_34.4: i32 = bind_value %.loc15_34.3
 // CHECK:STDOUT:   br !if.expr.result(%.loc15_34.4)
 // CHECK:STDOUT:

+ 6 - 6
toolchain/semantics/testdata/if_expression/control_flow.carbon

@@ -139,16 +139,16 @@ fn F(b: bool) -> i32 {
 // CHECK:STDOUT:   if %b br !if.expr.then else br !if.expr.else
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.expr.then:
-// CHECK:STDOUT:   %.loc11_21.1: i32 = call @A()
-// CHECK:STDOUT:   %.loc11_21.2: i32 = temporary_storage
-// CHECK:STDOUT:   %.loc11_21.3: i32 = temporary %.loc11_21.2, %.loc11_21.1
+// CHECK:STDOUT:   %.loc11_21.1: init i32 = call @A()
+// CHECK:STDOUT:   %.loc11_21.2: ref i32 = temporary_storage
+// CHECK:STDOUT:   %.loc11_21.3: ref i32 = temporary %.loc11_21.2, %.loc11_21.1
 // CHECK:STDOUT:   %.loc11_21.4: i32 = bind_value %.loc11_21.3
 // CHECK:STDOUT:   br !if.expr.result(%.loc11_21.4)
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.expr.else:
-// CHECK:STDOUT:   %.loc11_30.1: i32 = call @B()
-// CHECK:STDOUT:   %.loc11_30.2: i32 = temporary_storage
-// CHECK:STDOUT:   %.loc11_30.3: i32 = temporary %.loc11_30.2, %.loc11_30.1
+// CHECK:STDOUT:   %.loc11_30.1: init i32 = call @B()
+// CHECK:STDOUT:   %.loc11_30.2: ref i32 = temporary_storage
+// CHECK:STDOUT:   %.loc11_30.3: ref i32 = temporary %.loc11_30.2, %.loc11_30.1
 // CHECK:STDOUT:   %.loc11_30.4: i32 = bind_value %.loc11_30.3
 // CHECK:STDOUT:   br !if.expr.result(%.loc11_30.4)
 // CHECK:STDOUT:

+ 6 - 6
toolchain/semantics/testdata/index/array_element_access.carbon

@@ -100,7 +100,7 @@ var d: i32 = a[b];
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_14: i32 = int_literal 2
 // CHECK:STDOUT:   %.loc7_15: type = array_type %.loc7_14, i32
-// CHECK:STDOUT:   %a: [i32; 2] = var "a"
+// CHECK:STDOUT:   %a: ref [i32; 2] = var "a"
 // CHECK:STDOUT:   %.loc7_20.1: i32 = int_literal 12
 // CHECK:STDOUT:   %.loc7_20.2: i32 = stub_reference %.loc7_20.1
 // CHECK:STDOUT:   %.loc7_24.1: i32 = int_literal 24
@@ -109,16 +109,16 @@ var d: i32 = a[b];
 // CHECK:STDOUT:   %.loc7_26.2: (i32, i32) = tuple_value (%.loc7_20.2, %.loc7_24.2)
 // CHECK:STDOUT:   %.loc7_26.3: [i32; 2] = array_value %.loc7_26.2
 // CHECK:STDOUT:   assign %a, %.loc7_26.3
-// CHECK:STDOUT:   %b: i32 = var "b"
+// CHECK:STDOUT:   %b: ref i32 = var "b"
 // CHECK:STDOUT:   %.loc8: i32 = int_literal 1
 // CHECK:STDOUT:   assign %b, %.loc8
-// CHECK:STDOUT:   %c: i32 = var "c"
+// CHECK:STDOUT:   %c: ref i32 = var "c"
 // CHECK:STDOUT:   %.loc9_16: i32 = int_literal 0
-// CHECK:STDOUT:   %.loc9_17.1: i32 = array_index %a, %.loc9_16
+// CHECK:STDOUT:   %.loc9_17.1: ref i32 = array_index %a, %.loc9_16
 // CHECK:STDOUT:   %.loc9_17.2: i32 = bind_value %.loc9_17.1
 // CHECK:STDOUT:   assign %c, %.loc9_17.2
-// CHECK:STDOUT:   %d: i32 = var "d"
-// CHECK:STDOUT:   %.loc10_17.1: i32 = array_index %a, %b
+// CHECK:STDOUT:   %d: ref i32 = var "d"
+// CHECK:STDOUT:   %.loc10_17.1: ref i32 = array_index %a, %b
 // CHECK:STDOUT:   %.loc10_17.2: i32 = bind_value %.loc10_17.1
 // CHECK:STDOUT:   assign %d, %.loc10_17.2
 // CHECK:STDOUT: }

+ 3 - 3
toolchain/semantics/testdata/index/fail_array_large_index.carbon

@@ -77,16 +77,16 @@ var b: i32 = a[0xFFFFFFFFFFFFFFFFF];
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_14: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc7_15: type = array_type %.loc7_14, i32
-// CHECK:STDOUT:   %a: [i32; 1] = var "a"
+// CHECK:STDOUT:   %a: ref [i32; 1] = var "a"
 // CHECK:STDOUT:   %.loc7_20.1: i32 = int_literal 12
 // CHECK:STDOUT:   %.loc7_20.2: i32 = stub_reference %.loc7_20.1
 // CHECK:STDOUT:   %.loc7_23.1: type = tuple_type (i32)
 // CHECK:STDOUT:   %.loc7_23.2: (i32,) = tuple_value (%.loc7_20.2)
 // CHECK:STDOUT:   %.loc7_23.3: [i32; 1] = array_value %.loc7_23.2
 // CHECK:STDOUT:   assign %a, %.loc7_23.3
-// CHECK:STDOUT:   %b: i32 = var "b"
+// CHECK:STDOUT:   %b: ref i32 = var "b"
 // CHECK:STDOUT:   %.loc11_16: i32 = int_literal -1
-// CHECK:STDOUT:   %.loc11_35.1: i32 = array_index %a, <error>
+// CHECK:STDOUT:   %.loc11_35.1: ref i32 = array_index %a, <error>
 // CHECK:STDOUT:   %.loc11_35.2: i32 = bind_value %.loc11_35.1
 // CHECK:STDOUT:   assign %b, %.loc11_35.2
 // CHECK:STDOUT: }

+ 3 - 3
toolchain/semantics/testdata/index/fail_array_non_int_indexing.carbon

@@ -78,16 +78,16 @@ var b: i32 = a[2.6];
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_14: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc7_15: type = array_type %.loc7_14, i32
-// CHECK:STDOUT:   %a: [i32; 1] = var "a"
+// CHECK:STDOUT:   %a: ref [i32; 1] = var "a"
 // CHECK:STDOUT:   %.loc7_20.1: i32 = int_literal 12
 // CHECK:STDOUT:   %.loc7_20.2: i32 = stub_reference %.loc7_20.1
 // CHECK:STDOUT:   %.loc7_23.1: type = tuple_type (i32)
 // CHECK:STDOUT:   %.loc7_23.2: (i32,) = tuple_value (%.loc7_20.2)
 // CHECK:STDOUT:   %.loc7_23.3: [i32; 1] = array_value %.loc7_23.2
 // CHECK:STDOUT:   assign %a, %.loc7_23.3
-// CHECK:STDOUT:   %b: i32 = var "b"
+// CHECK:STDOUT:   %b: ref i32 = var "b"
 // CHECK:STDOUT:   %.loc11_16: f64 = real_literal 26e-1
-// CHECK:STDOUT:   %.loc11_19.1: i32 = array_index %a, <error>
+// CHECK:STDOUT:   %.loc11_19.1: ref i32 = array_index %a, <error>
 // CHECK:STDOUT:   %.loc11_19.2: i32 = bind_value %.loc11_19.1
 // CHECK:STDOUT:   assign %b, %.loc11_19.2
 // CHECK:STDOUT: }

+ 3 - 3
toolchain/semantics/testdata/index/fail_array_out_of_bound_access.carbon

@@ -77,16 +77,16 @@ var b: i32 = a[2];
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_14: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc7_15: type = array_type %.loc7_14, i32
-// CHECK:STDOUT:   %a: [i32; 1] = var "a"
+// CHECK:STDOUT:   %a: ref [i32; 1] = var "a"
 // CHECK:STDOUT:   %.loc7_20.1: i32 = int_literal 12
 // CHECK:STDOUT:   %.loc7_20.2: i32 = stub_reference %.loc7_20.1
 // CHECK:STDOUT:   %.loc7_23.1: type = tuple_type (i32)
 // CHECK:STDOUT:   %.loc7_23.2: (i32,) = tuple_value (%.loc7_20.2)
 // CHECK:STDOUT:   %.loc7_23.3: [i32; 1] = array_value %.loc7_23.2
 // CHECK:STDOUT:   assign %a, %.loc7_23.3
-// CHECK:STDOUT:   %b: i32 = var "b"
+// CHECK:STDOUT:   %b: ref i32 = var "b"
 // CHECK:STDOUT:   %.loc11_16: i32 = int_literal 2
-// CHECK:STDOUT:   %.loc11_17.1: i32 = array_index %a, <error>
+// CHECK:STDOUT:   %.loc11_17.1: ref i32 = array_index %a, <error>
 // CHECK:STDOUT:   %.loc11_17.2: i32 = bind_value %.loc11_17.1
 // CHECK:STDOUT:   assign %b, %.loc11_17.2
 // CHECK:STDOUT: }

+ 4 - 4
toolchain/semantics/testdata/index/fail_empty_tuple_access.carbon

@@ -81,10 +81,10 @@ fn Run() {
 // CHECK:STDOUT: fn @Run() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc13_4.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc13_4.2: () = call @F()
+// CHECK:STDOUT:   %.loc13_4.2: init () = call @F()
 // CHECK:STDOUT:   %.loc13_7: i32 = int_literal 0
-// CHECK:STDOUT:   %.loc13_4.3: () = temporary_storage
-// CHECK:STDOUT:   %.loc13_4.4: () = temporary %.loc13_4.3, %.loc13_4.2
-// CHECK:STDOUT:   %.loc13_8: <error> = tuple_index %.loc13_4.4, <error>
+// CHECK:STDOUT:   %.loc13_4.3: ref () = temporary_storage
+// CHECK:STDOUT:   %.loc13_4.4: ref () = temporary %.loc13_4.3, %.loc13_4.2
+// CHECK:STDOUT:   %.loc13_8: ref <error> = tuple_index %.loc13_4.4, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/index/fail_name_not_found.carbon

@@ -57,7 +57,7 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %b: i32 = var "b"
+// CHECK:STDOUT:   %b: ref i32 = var "b"
 // CHECK:STDOUT:   %.loc11: i32 = int_literal 0
 // CHECK:STDOUT:   assign %b, <error>
 // CHECK:STDOUT:   return

+ 4 - 4
toolchain/semantics/testdata/index/fail_non_deterministic_type.carbon

@@ -100,17 +100,17 @@ var c: i32 = a[b];
 // CHECK:STDOUT:   %.loc7_17.1: type = tuple_type (type, type)
 // CHECK:STDOUT:   %.loc7_17.2: (type, type) = tuple_value (%.loc7_9, %.loc7_14)
 // CHECK:STDOUT:   %.loc7_17.3: type = tuple_type (i32, i32)
-// CHECK:STDOUT:   %a: (i32, i32) = var "a"
+// CHECK:STDOUT:   %a: ref (i32, i32) = var "a"
 // CHECK:STDOUT:   %.loc7_22.1: i32 = int_literal 2
 // CHECK:STDOUT:   %.loc7_22.2: i32 = stub_reference %.loc7_22.1
 // CHECK:STDOUT:   %.loc7_25.1: i32 = int_literal 3
 // CHECK:STDOUT:   %.loc7_25.2: i32 = stub_reference %.loc7_25.1
 // CHECK:STDOUT:   %.loc7_26: (i32, i32) = tuple_value (%.loc7_22.2, %.loc7_25.2)
 // CHECK:STDOUT:   assign %a, %.loc7_26
-// CHECK:STDOUT:   %b: i32 = var "b"
+// CHECK:STDOUT:   %b: ref i32 = var "b"
 // CHECK:STDOUT:   %.loc8: i32 = int_literal 0
 // CHECK:STDOUT:   assign %b, %.loc8
-// CHECK:STDOUT:   %c: i32 = var "c"
-// CHECK:STDOUT:   %.loc12: <error> = tuple_index %a, <error>
+// CHECK:STDOUT:   %c: ref i32 = var "c"
+// CHECK:STDOUT:   %.loc12: ref <error> = tuple_index %a, <error>
 // CHECK:STDOUT:   assign %c, <error>
 // CHECK:STDOUT: }

+ 4 - 4
toolchain/semantics/testdata/index/fail_tuple_large_index.carbon

@@ -97,18 +97,18 @@ var c: i32 = b[0xFFFFFFFFFFFFFFFFF];
 // CHECK:STDOUT:   %.loc7_13.1: type = tuple_type (type)
 // CHECK:STDOUT:   %.loc7_13.2: (type,) = tuple_value (%.loc7_9)
 // CHECK:STDOUT:   %.loc7_13.3: type = tuple_type (i32)
-// CHECK:STDOUT:   %a: (i32,) = var "a"
+// CHECK:STDOUT:   %a: ref (i32,) = var "a"
 // CHECK:STDOUT:   %.loc7_18.1: i32 = int_literal 12
 // CHECK:STDOUT:   %.loc7_18.2: i32 = stub_reference %.loc7_18.1
 // CHECK:STDOUT:   %.loc7_21: (i32,) = tuple_value (%.loc7_18.2)
 // CHECK:STDOUT:   assign %a, %.loc7_21
 // CHECK:STDOUT:   %.loc8_9: type = stub_reference i32
 // CHECK:STDOUT:   %.loc8_13: (type,) = tuple_value (%.loc8_9)
-// CHECK:STDOUT:   %b: (i32,) = var "b"
+// CHECK:STDOUT:   %b: ref (i32,) = var "b"
 // CHECK:STDOUT:   %.loc7_5: (i32,) = bind_value %a
 // CHECK:STDOUT:   assign %b, %.loc7_5
-// CHECK:STDOUT:   %c: i32 = var "c"
+// CHECK:STDOUT:   %c: ref i32 = var "c"
 // CHECK:STDOUT:   %.loc12_16: i32 = int_literal -1
-// CHECK:STDOUT:   %.loc12_35: <error> = tuple_index %b, <error>
+// CHECK:STDOUT:   %.loc12_35: ref <error> = tuple_index %b, <error>
 // CHECK:STDOUT:   assign %c, <error>
 // CHECK:STDOUT: }

+ 3 - 3
toolchain/semantics/testdata/index/fail_tuple_non_int_indexing.carbon

@@ -95,15 +95,15 @@ var b: i32 = a[2.6];
 // CHECK:STDOUT:   %.loc7_17.1: type = tuple_type (type, type)
 // CHECK:STDOUT:   %.loc7_17.2: (type, type) = tuple_value (%.loc7_9, %.loc7_14)
 // CHECK:STDOUT:   %.loc7_17.3: type = tuple_type (i32, i32)
-// CHECK:STDOUT:   %a: (i32, i32) = var "a"
+// CHECK:STDOUT:   %a: ref (i32, i32) = var "a"
 // CHECK:STDOUT:   %.loc7_22.1: i32 = int_literal 12
 // CHECK:STDOUT:   %.loc7_22.2: i32 = stub_reference %.loc7_22.1
 // CHECK:STDOUT:   %.loc7_26.1: i32 = int_literal 6
 // CHECK:STDOUT:   %.loc7_26.2: i32 = stub_reference %.loc7_26.1
 // CHECK:STDOUT:   %.loc7_27: (i32, i32) = tuple_value (%.loc7_22.2, %.loc7_26.2)
 // CHECK:STDOUT:   assign %a, %.loc7_27
-// CHECK:STDOUT:   %b: i32 = var "b"
+// CHECK:STDOUT:   %b: ref i32 = var "b"
 // CHECK:STDOUT:   %.loc11_16: f64 = real_literal 26e-1
-// CHECK:STDOUT:   %.loc11_19: <error> = tuple_index %a, <error>
+// CHECK:STDOUT:   %.loc11_19: ref <error> = tuple_index %a, <error>
 // CHECK:STDOUT:   assign %b, <error>
 // CHECK:STDOUT: }

+ 3 - 3
toolchain/semantics/testdata/index/fail_tuple_out_of_bound_access.carbon

@@ -94,15 +94,15 @@ var b: i32 = a[2];
 // CHECK:STDOUT:   %.loc7_17.1: type = tuple_type (type, type)
 // CHECK:STDOUT:   %.loc7_17.2: (type, type) = tuple_value (%.loc7_9, %.loc7_14)
 // CHECK:STDOUT:   %.loc7_17.3: type = tuple_type (i32, i32)
-// CHECK:STDOUT:   %a: (i32, i32) = var "a"
+// CHECK:STDOUT:   %a: ref (i32, i32) = var "a"
 // CHECK:STDOUT:   %.loc7_22.1: i32 = int_literal 12
 // CHECK:STDOUT:   %.loc7_22.2: i32 = stub_reference %.loc7_22.1
 // CHECK:STDOUT:   %.loc7_26.1: i32 = int_literal 6
 // CHECK:STDOUT:   %.loc7_26.2: i32 = stub_reference %.loc7_26.1
 // CHECK:STDOUT:   %.loc7_27: (i32, i32) = tuple_value (%.loc7_22.2, %.loc7_26.2)
 // CHECK:STDOUT:   assign %a, %.loc7_27
-// CHECK:STDOUT:   %b: i32 = var "b"
+// CHECK:STDOUT:   %b: ref i32 = var "b"
 // CHECK:STDOUT:   %.loc11_16: i32 = int_literal 2
-// CHECK:STDOUT:   %.loc11_17: <error> = tuple_index %a, <error>
+// CHECK:STDOUT:   %.loc11_17: ref <error> = tuple_index %a, <error>
 // CHECK:STDOUT:   assign %b, <error>
 // CHECK:STDOUT: }

+ 4 - 4
toolchain/semantics/testdata/index/tuple_element_access.carbon

@@ -96,19 +96,19 @@ var c: i32 = b[0];
 // CHECK:STDOUT:   %.loc7_13.1: type = tuple_type (type)
 // CHECK:STDOUT:   %.loc7_13.2: (type,) = tuple_value (%.loc7_9)
 // CHECK:STDOUT:   %.loc7_13.3: type = tuple_type (i32)
-// CHECK:STDOUT:   %a: (i32,) = var "a"
+// CHECK:STDOUT:   %a: ref (i32,) = var "a"
 // CHECK:STDOUT:   %.loc7_18.1: i32 = int_literal 12
 // CHECK:STDOUT:   %.loc7_18.2: i32 = stub_reference %.loc7_18.1
 // CHECK:STDOUT:   %.loc7_21: (i32,) = tuple_value (%.loc7_18.2)
 // CHECK:STDOUT:   assign %a, %.loc7_21
 // CHECK:STDOUT:   %.loc8_9: type = stub_reference i32
 // CHECK:STDOUT:   %.loc8_13: (type,) = tuple_value (%.loc8_9)
-// CHECK:STDOUT:   %b: (i32,) = var "b"
+// CHECK:STDOUT:   %b: ref (i32,) = var "b"
 // CHECK:STDOUT:   %.loc7_5: (i32,) = bind_value %a
 // CHECK:STDOUT:   assign %b, %.loc7_5
-// CHECK:STDOUT:   %c: i32 = var "c"
+// CHECK:STDOUT:   %c: ref i32 = var "c"
 // CHECK:STDOUT:   %.loc9_16: i32 = int_literal 0
-// CHECK:STDOUT:   %.loc9_17.1: i32 = tuple_index %b, %.loc9_16
+// CHECK:STDOUT:   %.loc9_17.1: ref i32 = tuple_index %b, %.loc9_16
 // CHECK:STDOUT:   %.loc9_17.2: i32 = bind_value %.loc9_17.1
 // CHECK:STDOUT:   assign %c, %.loc9_17.2
 // CHECK:STDOUT: }

+ 4 - 4
toolchain/semantics/testdata/index/tuple_return_value_access.carbon

@@ -115,11 +115,11 @@ fn Run() -> i32 {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Run() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc10_11.1: (i32,) = call @F()
+// CHECK:STDOUT:   %.loc10_11.1: init (i32,) = call @F()
 // CHECK:STDOUT:   %.loc10_14: i32 = int_literal 0
-// CHECK:STDOUT:   %.loc10_11.2: (i32,) = temporary_storage
-// CHECK:STDOUT:   %.loc10_11.3: (i32,) = temporary %.loc10_11.2, %.loc10_11.1
-// CHECK:STDOUT:   %.loc10_15.1: i32 = tuple_index %.loc10_11.3, %.loc10_14
+// CHECK:STDOUT:   %.loc10_11.2: ref (i32,) = temporary_storage
+// CHECK:STDOUT:   %.loc10_11.3: ref (i32,) = temporary %.loc10_11.2, %.loc10_11.1
+// CHECK:STDOUT:   %.loc10_15.1: ref i32 = tuple_index %.loc10_11.3, %.loc10_14
 // CHECK:STDOUT:   %.loc10_15.2: i32 = bind_value %.loc10_15.1
 // CHECK:STDOUT:   return %.loc10_15.2
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/ir/duplicate_name_same_line.carbon

@@ -71,14 +71,14 @@ fn A() { var n: i32 = 1; if (true) { var n: i32 = 2; } }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @A() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %n.loc7_14: i32 = var "n"
+// CHECK:STDOUT:   %n.loc7_14: ref i32 = var "n"
 // CHECK:STDOUT:   %.loc7_23: i32 = int_literal 1
 // CHECK:STDOUT:   assign %n.loc7_14, %.loc7_23
 // CHECK:STDOUT:   %.loc7_30: bool = bool_literal true
 // CHECK:STDOUT:   if %.loc7_30 br !if.then else br !if.else
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.then:
-// CHECK:STDOUT:   %n.loc7_42: i32 = var "n"
+// CHECK:STDOUT:   %n.loc7_42: ref i32 = var "n"
 // CHECK:STDOUT:   %.loc7_51: i32 = int_literal 2
 // CHECK:STDOUT:   assign %n.loc7_42, %.loc7_51
 // CHECK:STDOUT:   br !if.else

+ 1 - 1
toolchain/semantics/testdata/namespace/function.carbon

@@ -92,6 +92,6 @@ fn Bar() {
 // CHECK:STDOUT: fn @Bar() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc17_10.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc17_10.2: () = call @Baz.2()
+// CHECK:STDOUT:   %.loc17_10.2: init () = call @Baz.2()
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/namespace/nested.carbon

@@ -80,6 +80,6 @@ fn Foo.Bar.Baz() {
 // CHECK:STDOUT: fn @Baz() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc14_14.1: type = tuple_type ()
-// CHECK:STDOUT:   %.loc14_14.2: () = call @Wiz()
+// CHECK:STDOUT:   %.loc14_14.2: init () = call @Wiz()
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 6 - 6
toolchain/semantics/testdata/operators/and.carbon

@@ -125,17 +125,17 @@ fn And() -> bool {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @And() -> bool {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc11_11.1: bool = call @F()
-// CHECK:STDOUT:   %.loc11_11.2: bool = temporary_storage
-// CHECK:STDOUT:   %.loc11_11.3: bool = temporary %.loc11_11.2, %.loc11_11.1
+// CHECK:STDOUT:   %.loc11_11.1: init bool = call @F()
+// CHECK:STDOUT:   %.loc11_11.2: ref bool = temporary_storage
+// CHECK:STDOUT:   %.loc11_11.3: ref bool = temporary %.loc11_11.2, %.loc11_11.1
 // CHECK:STDOUT:   %.loc11_11.4: bool = bind_value %.loc11_11.3
 // CHECK:STDOUT:   %.loc11_14.1: bool = bool_literal false
 // CHECK:STDOUT:   if %.loc11_11.4 br !and.rhs else br !and.result(%.loc11_14.1)
 // CHECK:STDOUT:
 // CHECK:STDOUT: !and.rhs:
-// CHECK:STDOUT:   %.loc11_19.1: bool = call @G()
-// CHECK:STDOUT:   %.loc11_19.2: bool = temporary_storage
-// CHECK:STDOUT:   %.loc11_19.3: bool = temporary %.loc11_19.2, %.loc11_19.1
+// CHECK:STDOUT:   %.loc11_19.1: init bool = call @G()
+// CHECK:STDOUT:   %.loc11_19.2: ref bool = temporary_storage
+// CHECK:STDOUT:   %.loc11_19.3: ref bool = temporary %.loc11_19.2, %.loc11_19.1
 // CHECK:STDOUT:   %.loc11_19.4: bool = bind_value %.loc11_19.3
 // CHECK:STDOUT:   br !and.result(%.loc11_19.4)
 // CHECK:STDOUT:

+ 10 - 10
toolchain/semantics/testdata/operators/assignment.carbon

@@ -238,7 +238,7 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %a: i32 = var "a"
+// CHECK:STDOUT:   %a: ref i32 = var "a"
 // CHECK:STDOUT:   %.loc8: i32 = int_literal 12
 // CHECK:STDOUT:   assign %a, %.loc8
 // CHECK:STDOUT:   %.loc9: i32 = int_literal -7
@@ -248,7 +248,7 @@ fn Main() {
 // CHECK:STDOUT:   %.loc11_19.1: type = tuple_type (type, type)
 // CHECK:STDOUT:   %.loc11_19.2: (type, type) = tuple_value (%.loc11_11, %.loc11_16)
 // CHECK:STDOUT:   %.loc11_19.3: type = tuple_type (i32, i32)
-// CHECK:STDOUT:   %b: (i32, i32) = var "b"
+// CHECK:STDOUT:   %b: ref (i32, i32) = var "b"
 // CHECK:STDOUT:   %.loc11_24.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc11_24.2: i32 = stub_reference %.loc11_24.1
 // CHECK:STDOUT:   %.loc11_27.1: i32 = int_literal 2
@@ -256,33 +256,33 @@ fn Main() {
 // CHECK:STDOUT:   %.loc11_28: (i32, i32) = tuple_value (%.loc11_24.2, %.loc11_27.2)
 // CHECK:STDOUT:   assign %b, %.loc11_28
 // CHECK:STDOUT:   %.loc12_5: i32 = int_literal 0
-// CHECK:STDOUT:   %.loc12_6: i32 = tuple_index %b, %.loc12_5
+// CHECK:STDOUT:   %.loc12_6: ref i32 = tuple_index %b, %.loc12_5
 // CHECK:STDOUT:   %.loc12_10: i32 = int_literal 3
 // CHECK:STDOUT:   assign %.loc12_6, %.loc12_10
 // CHECK:STDOUT:   %.loc13_5: i32 = int_literal 1
-// CHECK:STDOUT:   %.loc13_6: i32 = tuple_index %b, %.loc13_5
+// CHECK:STDOUT:   %.loc13_6: ref i32 = tuple_index %b, %.loc13_5
 // CHECK:STDOUT:   %.loc13_10: i32 = int_literal 4
 // CHECK:STDOUT:   assign %.loc13_6, %.loc13_10
 // CHECK:STDOUT:   %.loc15_27: type = struct_type {.a: i32, .b: i32}
-// CHECK:STDOUT:   %c: {.a: i32, .b: i32} = var "c"
+// CHECK:STDOUT:   %c: ref {.a: i32, .b: i32} = var "c"
 // CHECK:STDOUT:   %.loc15_37: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc15_35: i32 = stub_reference %.loc15_37
 // CHECK:STDOUT:   %.loc15_45: i32 = int_literal 2
 // CHECK:STDOUT:   %.loc15_43: i32 = stub_reference %.loc15_45
 // CHECK:STDOUT:   %.loc15_46: {.a: i32, .b: i32} = struct_value (%.loc15_35, %.loc15_43)
 // CHECK:STDOUT:   assign %c, %.loc15_46
-// CHECK:STDOUT:   %.loc16_4: i32 = struct_access %c, member0
+// CHECK:STDOUT:   %.loc16_4: ref i32 = struct_access %c, member0
 // CHECK:STDOUT:   %.loc16_9: i32 = int_literal 3
 // CHECK:STDOUT:   assign %.loc16_4, %.loc16_9
-// CHECK:STDOUT:   %.loc17_4: i32 = struct_access %c, member1
+// CHECK:STDOUT:   %.loc17_4: ref i32 = struct_access %c, member1
 // CHECK:STDOUT:   %.loc17_9: i32 = int_literal 4
 // CHECK:STDOUT:   assign %.loc17_4, %.loc17_9
 // CHECK:STDOUT:   %.loc19_13: type = ptr_type i32
-// CHECK:STDOUT:   %p: i32* = var "p"
+// CHECK:STDOUT:   %p: ref i32* = var "p"
 // CHECK:STDOUT:   %.loc19_17: i32* = address_of %a
 // CHECK:STDOUT:   assign %p, %.loc19_17
 // CHECK:STDOUT:   %.loc19_7.1: i32* = bind_value %p
-// CHECK:STDOUT:   %.loc20_3: i32 = dereference %.loc19_7.1
+// CHECK:STDOUT:   %.loc20_3: ref i32 = dereference %.loc19_7.1
 // CHECK:STDOUT:   %.loc20_8: i32 = int_literal 5
 // CHECK:STDOUT:   assign %.loc20_3, %.loc20_8
 // CHECK:STDOUT:   %.loc22_8: bool = bool_literal true
@@ -298,7 +298,7 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: !if.expr.result:
 // CHECK:STDOUT:   %.loc22_5: i32* = block_arg !if.expr.result
-// CHECK:STDOUT:   %.loc22_3: i32 = dereference %.loc22_5
+// CHECK:STDOUT:   %.loc22_3: ref i32 = dereference %.loc22_5
 // CHECK:STDOUT:   %.loc22_31: i32 = int_literal 10
 // CHECK:STDOUT:   assign %.loc22_3, %.loc22_31
 // CHECK:STDOUT:   return

+ 3 - 3
toolchain/semantics/testdata/operators/fail_assigment_to_non_assignable.carbon

@@ -308,7 +308,7 @@ fn Main() {
 // CHECK:STDOUT:   %.loc13_3: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc13_7: i32 = int_literal 2
 // CHECK:STDOUT:   assign %.loc13_3, %.loc13_7
-// CHECK:STDOUT:   %.loc17_4: i32 = call @F()
+// CHECK:STDOUT:   %.loc17_4: init i32 = call @F()
 // CHECK:STDOUT:   %.loc17_9: i32 = int_literal 1
 // CHECK:STDOUT:   assign %.loc17_4, %.loc17_9
 // CHECK:STDOUT:   %.loc21_4.1: i32 = int_literal 1
@@ -323,7 +323,7 @@ fn Main() {
 // CHECK:STDOUT:   %.loc21_16.2: i32 = stub_reference %.loc21_16.1
 // CHECK:STDOUT:   %.loc21_17: (i32, i32) = tuple_value (%.loc21_13.2, %.loc21_16.2)
 // CHECK:STDOUT:   assign %.loc21_8.2, %.loc21_17
-// CHECK:STDOUT:   %n: i32 = var "n"
+// CHECK:STDOUT:   %n: ref i32 = var "n"
 // CHECK:STDOUT:   %.loc22_16: i32 = int_literal 0
 // CHECK:STDOUT:   assign %n, %.loc22_16
 // CHECK:STDOUT:   %.loc22_7.1: i32 = bind_value %n
@@ -366,7 +366,7 @@ fn Main() {
 // CHECK:STDOUT:   %.loc38_4: i32 = block_arg !if.expr.result.loc38
 // CHECK:STDOUT:   %.loc38_29: i32 = int_literal 3
 // CHECK:STDOUT:   assign %.loc38_4, %.loc38_29
-// CHECK:STDOUT:   %a: i32 = var "a"
+// CHECK:STDOUT:   %a: ref i32 = var "a"
 // CHECK:STDOUT:   %.loc45_7: bool = bool_literal true
 // CHECK:STDOUT:   if %.loc45_7 br !if.expr.then.loc45 else br !if.expr.else.loc45
 // CHECK:STDOUT:

+ 1 - 1
toolchain/semantics/testdata/operators/fail_type_mismatch_assignment.carbon

@@ -63,7 +63,7 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %a: i32 = var "a"
+// CHECK:STDOUT:   %a: ref i32 = var "a"
 // CHECK:STDOUT:   %.loc8: i32 = int_literal 3
 // CHECK:STDOUT:   assign %a, %.loc8
 // CHECK:STDOUT:   %.loc12: f64 = real_literal 56e-1

+ 6 - 6
toolchain/semantics/testdata/operators/or.carbon

@@ -127,18 +127,18 @@ fn Or() -> bool {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Or() -> bool {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc11_11.1: bool = call @F()
-// CHECK:STDOUT:   %.loc11_11.2: bool = temporary_storage
-// CHECK:STDOUT:   %.loc11_11.3: bool = temporary %.loc11_11.2, %.loc11_11.1
+// CHECK:STDOUT:   %.loc11_11.1: init bool = call @F()
+// CHECK:STDOUT:   %.loc11_11.2: ref bool = temporary_storage
+// CHECK:STDOUT:   %.loc11_11.3: ref bool = temporary %.loc11_11.2, %.loc11_11.1
 // CHECK:STDOUT:   %.loc11_11.4: bool = bind_value %.loc11_11.3
 // CHECK:STDOUT:   %.loc11_14.1: bool = not %.loc11_11.4
 // CHECK:STDOUT:   %.loc11_14.2: bool = bool_literal true
 // CHECK:STDOUT:   if %.loc11_14.1 br !or.rhs else br !or.result(%.loc11_14.2)
 // CHECK:STDOUT:
 // CHECK:STDOUT: !or.rhs:
-// CHECK:STDOUT:   %.loc11_18.1: bool = call @G()
-// CHECK:STDOUT:   %.loc11_18.2: bool = temporary_storage
-// CHECK:STDOUT:   %.loc11_18.3: bool = temporary %.loc11_18.2, %.loc11_18.1
+// CHECK:STDOUT:   %.loc11_18.1: init bool = call @G()
+// CHECK:STDOUT:   %.loc11_18.2: ref bool = temporary_storage
+// CHECK:STDOUT:   %.loc11_18.3: ref bool = temporary %.loc11_18.2, %.loc11_18.1
 // CHECK:STDOUT:   %.loc11_18.4: bool = bind_value %.loc11_18.3
 // CHECK:STDOUT:   br !or.result(%.loc11_18.4)
 // CHECK:STDOUT:

+ 3 - 3
toolchain/semantics/testdata/pointer/address_of_deref.carbon

@@ -72,14 +72,14 @@ fn F() -> i32 {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %n: i32 = var "n"
+// CHECK:STDOUT:   %n: ref i32 = var "n"
 // CHECK:STDOUT:   %.loc8: i32 = int_literal 0
 // CHECK:STDOUT:   assign %n, %.loc8
 // CHECK:STDOUT:   %.loc9_13.1: type = ptr_type i32
 // CHECK:STDOUT:   %.loc9_13.2: i32* = address_of %n
-// CHECK:STDOUT:   %.loc9_12: i32 = dereference %.loc9_13.2
+// CHECK:STDOUT:   %.loc9_12: ref i32 = dereference %.loc9_13.2
 // CHECK:STDOUT:   %.loc9_11: i32* = address_of %.loc9_12
-// CHECK:STDOUT:   %.loc9_10.1: i32 = dereference %.loc9_11
+// CHECK:STDOUT:   %.loc9_10.1: ref i32 = dereference %.loc9_11
 // CHECK:STDOUT:   %.loc9_10.2: i32 = bind_value %.loc9_10.1
 // CHECK:STDOUT:   return %.loc9_10.2
 // CHECK:STDOUT: }

+ 11 - 11
toolchain/semantics/testdata/pointer/address_of_lvalue.carbon

@@ -210,7 +210,7 @@ fn F() {
 // CHECK:STDOUT: fn @F() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc8_27: type = struct_type {.a: i32, .b: i32}
-// CHECK:STDOUT:   %s: {.a: i32, .b: i32} = var "s"
+// CHECK:STDOUT:   %s: ref {.a: i32, .b: i32} = var "s"
 // CHECK:STDOUT:   %.loc8_37: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc8_35: i32 = stub_reference %.loc8_37
 // CHECK:STDOUT:   %.loc8_45: i32 = int_literal 2
@@ -219,17 +219,17 @@ fn F() {
 // CHECK:STDOUT:   assign %s, %.loc8_46
 // CHECK:STDOUT:   %.loc10_27: type = struct_type {.a: i32, .b: i32}
 // CHECK:STDOUT:   %.loc10_28: type = ptr_type {.a: i32, .b: i32}
-// CHECK:STDOUT:   %p: {.a: i32, .b: i32}* = var "p"
+// CHECK:STDOUT:   %p: ref {.a: i32, .b: i32}* = var "p"
 // CHECK:STDOUT:   %.loc10_32: {.a: i32, .b: i32}* = address_of %s
 // CHECK:STDOUT:   assign %p, %.loc10_32
 // CHECK:STDOUT:   %.loc11_13: type = ptr_type i32
-// CHECK:STDOUT:   %q: i32* = var "q"
-// CHECK:STDOUT:   %.loc11_19: i32 = struct_access %s, member0
+// CHECK:STDOUT:   %q: ref i32* = var "q"
+// CHECK:STDOUT:   %.loc11_19: ref i32 = struct_access %s, member0
 // CHECK:STDOUT:   %.loc11_17: i32* = address_of %.loc11_19
 // CHECK:STDOUT:   assign %q, %.loc11_17
 // CHECK:STDOUT:   %.loc12_13: type = ptr_type i32
-// CHECK:STDOUT:   %r: i32* = var "r"
-// CHECK:STDOUT:   %.loc12_19: i32 = struct_access %s, member1
+// CHECK:STDOUT:   %r: ref i32* = var "r"
+// CHECK:STDOUT:   %.loc12_19: ref i32 = struct_access %s, member1
 // CHECK:STDOUT:   %.loc12_17: i32* = address_of %.loc12_19
 // CHECK:STDOUT:   assign %r, %.loc12_17
 // CHECK:STDOUT:   %.loc14_11: type = stub_reference i32
@@ -237,7 +237,7 @@ fn F() {
 // CHECK:STDOUT:   %.loc14_19.1: type = tuple_type (type, type)
 // CHECK:STDOUT:   %.loc14_19.2: (type, type) = tuple_value (%.loc14_11, %.loc14_16)
 // CHECK:STDOUT:   %.loc14_19.3: type = tuple_type (i32, i32)
-// CHECK:STDOUT:   %t: (i32, i32) = var "t"
+// CHECK:STDOUT:   %t: ref (i32, i32) = var "t"
 // CHECK:STDOUT:   %.loc14_24.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc14_24.2: i32 = stub_reference %.loc14_24.1
 // CHECK:STDOUT:   %.loc14_27.1: i32 = int_literal 2
@@ -245,15 +245,15 @@ fn F() {
 // CHECK:STDOUT:   %.loc14_28: (i32, i32) = tuple_value (%.loc14_24.2, %.loc14_27.2)
 // CHECK:STDOUT:   assign %t, %.loc14_28
 // CHECK:STDOUT:   %.loc15_14: type = ptr_type i32
-// CHECK:STDOUT:   %t0: i32* = var "t0"
+// CHECK:STDOUT:   %t0: ref i32* = var "t0"
 // CHECK:STDOUT:   %.loc15_21: i32 = int_literal 0
-// CHECK:STDOUT:   %.loc15_22: i32 = tuple_index %t, %.loc15_21
+// CHECK:STDOUT:   %.loc15_22: ref i32 = tuple_index %t, %.loc15_21
 // CHECK:STDOUT:   %.loc15_18: i32* = address_of %.loc15_22
 // CHECK:STDOUT:   assign %t0, %.loc15_18
 // CHECK:STDOUT:   %.loc16_14: type = ptr_type i32
-// CHECK:STDOUT:   %t1: i32* = var "t1"
+// CHECK:STDOUT:   %t1: ref i32* = var "t1"
 // CHECK:STDOUT:   %.loc16_21: i32 = int_literal 1
-// CHECK:STDOUT:   %.loc16_22: i32 = tuple_index %t, %.loc16_21
+// CHECK:STDOUT:   %.loc16_22: ref i32 = tuple_index %t, %.loc16_21
 // CHECK:STDOUT:   %.loc16_18: i32* = address_of %.loc16_22
 // CHECK:STDOUT:   assign %t1, %.loc16_18
 // CHECK:STDOUT:   return

+ 3 - 3
toolchain/semantics/testdata/pointer/basic.carbon

@@ -77,15 +77,15 @@ fn F() -> i32 {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F() -> i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %n: i32 = var "n"
+// CHECK:STDOUT:   %n: ref i32 = var "n"
 // CHECK:STDOUT:   %.loc8: i32 = int_literal 0
 // CHECK:STDOUT:   assign %n, %.loc8
 // CHECK:STDOUT:   %.loc9_13: type = ptr_type i32
-// CHECK:STDOUT:   %p: i32* = var "p"
+// CHECK:STDOUT:   %p: ref i32* = var "p"
 // CHECK:STDOUT:   %.loc9_17: i32* = address_of %n
 // CHECK:STDOUT:   assign %p, %.loc9_17
 // CHECK:STDOUT:   %.loc9_7: i32* = bind_value %p
-// CHECK:STDOUT:   %.loc11_10.1: i32 = dereference %.loc9_7
+// CHECK:STDOUT:   %.loc11_10.1: ref i32 = dereference %.loc9_7
 // CHECK:STDOUT:   %.loc11_10.2: i32 = bind_value %.loc11_10.1
 // CHECK:STDOUT:   return %.loc11_10.2
 // CHECK:STDOUT: }

+ 6 - 6
toolchain/semantics/testdata/pointer/fail_address_of_value.carbon

@@ -393,10 +393,10 @@ fn AddressOfParameter(param: i32) {
 // CHECK:STDOUT:   %.loc42_9: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc42_7: i32 = add %.loc42_5, %.loc42_9
 // CHECK:STDOUT:   %.loc42_3: i32* = address_of %.loc42_7
-// CHECK:STDOUT:   %.loc46_5.1: {.a: i32} = call @H()
-// CHECK:STDOUT:   %.loc46_5.2: {.a: i32} = temporary_storage
-// CHECK:STDOUT:   %.loc46_5.3: {.a: i32} = temporary %.loc46_5.2, %.loc46_5.1
-// CHECK:STDOUT:   %.loc46_7: i32 = struct_access %.loc46_5.3, member0
+// CHECK:STDOUT:   %.loc46_5.1: init {.a: i32} = call @H()
+// CHECK:STDOUT:   %.loc46_5.2: ref {.a: i32} = temporary_storage
+// CHECK:STDOUT:   %.loc46_5.3: ref {.a: i32} = temporary %.loc46_5.2, %.loc46_5.1
+// CHECK:STDOUT:   %.loc46_7: ref i32 = struct_access %.loc46_5.3, member0
 // CHECK:STDOUT:   %.loc46_3: i32* = address_of %.loc46_7
 // CHECK:STDOUT:   %.loc50_9: bool = bool_literal true
 // CHECK:STDOUT:   %.loc50_5: bool = not %.loc50_9
@@ -406,7 +406,7 @@ fn AddressOfParameter(param: i32) {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @AddressOfCall() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc57_5: i32 = call @G()
+// CHECK:STDOUT:   %.loc57_5: init i32 = call @G()
 // CHECK:STDOUT:   %.loc57_3: i32* = address_of %.loc57_5
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }
@@ -437,7 +437,7 @@ fn AddressOfParameter(param: i32) {
 // CHECK:STDOUT: fn @AddressOfParameter(%param: i32) {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc82_22: type = ptr_type i32
-// CHECK:STDOUT:   %param_addr: i32* = var "param_addr"
+// CHECK:STDOUT:   %param_addr: ref i32* = var "param_addr"
 // CHECK:STDOUT:   %.loc82_26: i32* = address_of %param
 // CHECK:STDOUT:   assign %param_addr, %.loc82_26
 // CHECK:STDOUT:   return

+ 3 - 3
toolchain/semantics/testdata/pointer/fail_dereference_not_pointer.carbon

@@ -82,12 +82,12 @@ fn Deref(n: i32) {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Deref(%n: i32) {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc11: <error> = dereference %n
+// CHECK:STDOUT:   %.loc11: ref <error> = dereference %n
 // CHECK:STDOUT:   %.loc15_5.1: type = tuple_type ()
 // CHECK:STDOUT:   %.loc15_5.2: () = tuple_value ()
-// CHECK:STDOUT:   %.loc15_3: <error> = dereference %.loc15_5.2
+// CHECK:STDOUT:   %.loc15_3: ref <error> = dereference %.loc15_5.2
 // CHECK:STDOUT:   %.loc19_5.1: type = struct_type {}
 // CHECK:STDOUT:   %.loc19_5.2: {} = struct_value ()
-// CHECK:STDOUT:   %.loc19_3: <error> = dereference %.loc19_5.2
+// CHECK:STDOUT:   %.loc19_3: ref <error> = dereference %.loc19_5.2
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/pointer/fail_dereference_type.carbon

@@ -40,6 +40,6 @@ var p: *i32;
 // CHECK:STDOUT: ]
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
-// CHECK:STDOUT:   %.loc13: <error> = dereference i32
-// CHECK:STDOUT:   %p: <error> = var "p"
+// CHECK:STDOUT:   %.loc13: ref <error> = dereference i32
+// CHECK:STDOUT:   %p: ref <error> = var "p"
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/pointer/nested_const.carbon

@@ -82,9 +82,9 @@ fn F(p: const (const (const i32*)*)) -> const i32 {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @F(%p: const (const (const i32*)*)) -> const i32 {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %.loc9_11.1: const (const i32*) = dereference %p
+// CHECK:STDOUT:   %.loc9_11.1: ref const (const i32*) = dereference %p
 // CHECK:STDOUT:   %.loc9_11.2: const (const i32*) = bind_value %.loc9_11.1
-// CHECK:STDOUT:   %.loc9_10.1: const i32 = dereference %.loc9_11.2
+// CHECK:STDOUT:   %.loc9_10.1: ref const i32 = dereference %.loc9_11.2
 // CHECK:STDOUT:   %.loc9_10.2: const i32 = bind_value %.loc9_10.1
 // CHECK:STDOUT:   return %.loc9_10.2
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/struct/empty.carbon

@@ -53,11 +53,11 @@ var y: {} = x;
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_9.1: type = struct_type {}
 // CHECK:STDOUT:   %.loc7_9.2: {} = struct_value ()
-// CHECK:STDOUT:   %x: {} = var "x"
+// CHECK:STDOUT:   %x: ref {} = var "x"
 // CHECK:STDOUT:   %.loc7_14: {} = struct_value ()
 // CHECK:STDOUT:   assign %x, %.loc7_14
 // CHECK:STDOUT:   %.loc8: {} = struct_value ()
-// CHECK:STDOUT:   %y: {} = var "y"
+// CHECK:STDOUT:   %y: ref {} = var "y"
 // CHECK:STDOUT:   %.loc7_5: {} = bind_value %x
 // CHECK:STDOUT:   assign %y, %.loc7_5
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/struct/fail_assign_empty.carbon

@@ -53,7 +53,7 @@ var x: {.a: i32} = {};
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc10_16: type = struct_type {.a: i32}
-// CHECK:STDOUT:   %x: {.a: i32} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: i32} = var "x"
 // CHECK:STDOUT:   %.loc10_21.1: type = struct_type {}
 // CHECK:STDOUT:   %.loc10_21.2: {} = struct_value ()
 // CHECK:STDOUT:   assign %x, <error>

+ 1 - 1
toolchain/semantics/testdata/struct/fail_assign_nested.carbon

@@ -71,7 +71,7 @@ var x: {.a: {}} = {.b = {}};
 // CHECK:STDOUT:   %.loc10_14.1: type = struct_type {}
 // CHECK:STDOUT:   %.loc10_14.2: {} = struct_value ()
 // CHECK:STDOUT:   %.loc10_15: type = struct_type {.a: {}}
-// CHECK:STDOUT:   %x: {.a: {}} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: {}} = var "x"
 // CHECK:STDOUT:   %.loc10_26: {} = struct_value ()
 // CHECK:STDOUT:   %.loc10_23: {} = stub_reference %.loc10_26
 // CHECK:STDOUT:   %.loc10_27.1: type = struct_type {.b: {}}

+ 1 - 1
toolchain/semantics/testdata/struct/fail_assign_to_empty.carbon

@@ -63,7 +63,7 @@ var x: {} = {.a = 1};
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc10_9.1: type = struct_type {}
 // CHECK:STDOUT:   %.loc10_9.2: {} = struct_value ()
-// CHECK:STDOUT:   %x: {} = var "x"
+// CHECK:STDOUT:   %x: ref {} = var "x"
 // CHECK:STDOUT:   %.loc10_19: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_17: i32 = stub_reference %.loc10_19
 // CHECK:STDOUT:   %.loc10_20.1: type = struct_type {.a: i32}

+ 1 - 1
toolchain/semantics/testdata/struct/fail_field_name_mismatch.carbon

@@ -66,7 +66,7 @@ var x: {.a: i32} = {.b = 1};
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc10_16: type = struct_type {.a: i32}
-// CHECK:STDOUT:   %x: {.a: i32} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: i32} = var "x"
 // CHECK:STDOUT:   %.loc10_26: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_24: i32 = stub_reference %.loc10_26
 // CHECK:STDOUT:   %.loc10_27.1: type = struct_type {.b: i32}

+ 1 - 1
toolchain/semantics/testdata/struct/fail_field_type_mismatch.carbon

@@ -67,7 +67,7 @@ var x: {.a: i32} = {.b = 1.0};
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc10_16: type = struct_type {.a: i32}
-// CHECK:STDOUT:   %x: {.a: i32} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: i32} = var "x"
 // CHECK:STDOUT:   %.loc10_26: f64 = real_literal 10e-1
 // CHECK:STDOUT:   %.loc10_24: f64 = stub_reference %.loc10_26
 // CHECK:STDOUT:   %.loc10_29.1: type = struct_type {.b: f64}

+ 2 - 2
toolchain/semantics/testdata/struct/fail_member_access_type.carbon

@@ -70,11 +70,11 @@ var y: i32 = x.b;
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_16: type = struct_type {.a: f64}
-// CHECK:STDOUT:   %x: {.a: f64} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: f64} = var "x"
 // CHECK:STDOUT:   %.loc7_26: f64 = real_literal 40e-1
 // CHECK:STDOUT:   %.loc7_24: f64 = stub_reference %.loc7_26
 // CHECK:STDOUT:   %.loc7_29: {.a: f64} = struct_value (%.loc7_24)
 // CHECK:STDOUT:   assign %x, %.loc7_29
-// CHECK:STDOUT:   %y: i32 = var "y"
+// CHECK:STDOUT:   %y: ref i32 = var "y"
 // CHECK:STDOUT:   assign %y, <error>
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/struct/fail_non_member_access.carbon

@@ -69,11 +69,11 @@ var y: i32 = x.b;
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_16: type = struct_type {.a: i32}
-// CHECK:STDOUT:   %x: {.a: i32} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: i32} = var "x"
 // CHECK:STDOUT:   %.loc7_26: i32 = int_literal 4
 // CHECK:STDOUT:   %.loc7_24: i32 = stub_reference %.loc7_26
 // CHECK:STDOUT:   %.loc7_27: {.a: i32} = struct_value (%.loc7_24)
 // CHECK:STDOUT:   assign %x, %.loc7_27
-// CHECK:STDOUT:   %y: i32 = var "y"
+// CHECK:STDOUT:   %y: ref i32 = var "y"
 // CHECK:STDOUT:   assign %y, <error>
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/struct/fail_too_few_values.carbon

@@ -69,7 +69,7 @@ var x: {.a: i32, .b: i32} = {.a = 1};
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc10_25: type = struct_type {.a: i32, .b: i32}
-// CHECK:STDOUT:   %x: {.a: i32, .b: i32} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: i32, .b: i32} = var "x"
 // CHECK:STDOUT:   %.loc10_35: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_33: i32 = stub_reference %.loc10_35
 // CHECK:STDOUT:   %.loc10_36.1: type = struct_type {.a: i32}

+ 1 - 1
toolchain/semantics/testdata/struct/fail_type_assign.carbon

@@ -55,7 +55,7 @@ var x: {.a: i32} = {.a: i32};
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc10_16: type = struct_type {.a: i32}
-// CHECK:STDOUT:   %x: {.a: i32} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: i32} = var "x"
 // CHECK:STDOUT:   %.loc10_28: type = struct_type {.a: i32}
 // CHECK:STDOUT:   assign %x, <error>
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/struct/fail_value_as_type.carbon

@@ -58,5 +58,5 @@ var x: {.a = 1};
 // CHECK:STDOUT:   %.loc10_12: i32 = stub_reference %.loc10_14
 // CHECK:STDOUT:   %.loc10_15.1: type = struct_type {.a: i32}
 // CHECK:STDOUT:   %.loc10_15.2: {.a: i32} = struct_value (%.loc10_12)
-// CHECK:STDOUT:   %x: <error> = var "x"
+// CHECK:STDOUT:   %x: ref <error> = var "x"
 // CHECK:STDOUT: }

+ 4 - 4
toolchain/semantics/testdata/struct/member_access.carbon

@@ -90,18 +90,18 @@ var z: i32 = y;
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_25: type = struct_type {.a: f64, .b: i32}
-// CHECK:STDOUT:   %x: {.a: f64, .b: i32} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: f64, .b: i32} = var "x"
 // CHECK:STDOUT:   %.loc7_35: f64 = real_literal 0e-1
 // CHECK:STDOUT:   %.loc7_33: f64 = stub_reference %.loc7_35
 // CHECK:STDOUT:   %.loc7_45: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc7_43: i32 = stub_reference %.loc7_45
 // CHECK:STDOUT:   %.loc7_46: {.a: f64, .b: i32} = struct_value (%.loc7_33, %.loc7_43)
 // CHECK:STDOUT:   assign %x, %.loc7_46
-// CHECK:STDOUT:   %y: i32 = var "y"
-// CHECK:STDOUT:   %.loc8_15.1: i32 = struct_access %x, member1
+// CHECK:STDOUT:   %y: ref i32 = var "y"
+// CHECK:STDOUT:   %.loc8_15.1: ref i32 = struct_access %x, member1
 // CHECK:STDOUT:   %.loc8_15.2: i32 = bind_value %.loc8_15.1
 // CHECK:STDOUT:   assign %y, %.loc8_15.2
-// CHECK:STDOUT:   %z: i32 = var "z"
+// CHECK:STDOUT:   %z: ref i32 = var "z"
 // CHECK:STDOUT:   %.loc8_5: i32 = bind_value %y
 // CHECK:STDOUT:   assign %z, %.loc8_5
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/struct/one_entry.carbon

@@ -74,13 +74,13 @@ var y: {.a: i32} = x;
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_16: type = struct_type {.a: i32}
-// CHECK:STDOUT:   %x: {.a: i32} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: i32} = var "x"
 // CHECK:STDOUT:   %.loc7_26: i32 = int_literal 4
 // CHECK:STDOUT:   %.loc7_24: i32 = stub_reference %.loc7_26
 // CHECK:STDOUT:   %.loc7_27: {.a: i32} = struct_value (%.loc7_24)
 // CHECK:STDOUT:   assign %x, %.loc7_27
 // CHECK:STDOUT:   %.loc8: type = struct_type {.a: i32}
-// CHECK:STDOUT:   %y: {.a: i32} = var "y"
+// CHECK:STDOUT:   %y: ref {.a: i32} = var "y"
 // CHECK:STDOUT:   %.loc7_5: {.a: i32} = bind_value %x
 // CHECK:STDOUT:   assign %y, %.loc7_5
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/struct/tuple_as_element.carbon

@@ -126,7 +126,7 @@ var y: {.a: i32, .b: (i32,)} = x;
 // CHECK:STDOUT:   %.loc7_27.2: (type,) = tuple_value (%.loc7_23)
 // CHECK:STDOUT:   %.loc7_27.3: type = tuple_type (i32)
 // CHECK:STDOUT:   %.loc7_28: type = struct_type {.a: i32, .b: (i32,)}
-// CHECK:STDOUT:   %x: {.a: i32, .b: (i32,)} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: i32, .b: (i32,)} = var "x"
 // CHECK:STDOUT:   %.loc7_38: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc7_36: i32 = stub_reference %.loc7_38
 // CHECK:STDOUT:   %.loc7_47.1: i32 = int_literal 2
@@ -138,7 +138,7 @@ var y: {.a: i32, .b: (i32,)} = x;
 // CHECK:STDOUT:   %.loc8_23: type = stub_reference i32
 // CHECK:STDOUT:   %.loc8_27: (type,) = tuple_value (%.loc8_23)
 // CHECK:STDOUT:   %.loc8_28: type = struct_type {.a: i32, .b: (i32,)}
-// CHECK:STDOUT:   %y: {.a: i32, .b: (i32,)} = var "y"
+// CHECK:STDOUT:   %y: ref {.a: i32, .b: (i32,)} = var "y"
 // CHECK:STDOUT:   %.loc7_5: {.a: i32, .b: (i32,)} = bind_value %x
 // CHECK:STDOUT:   assign %y, %.loc7_5
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/struct/two_entries.carbon

@@ -89,7 +89,7 @@ var y: {.a: i32, .b: i32} = x;
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_25: type = struct_type {.a: i32, .b: i32}
-// CHECK:STDOUT:   %x: {.a: i32, .b: i32} = var "x"
+// CHECK:STDOUT:   %x: ref {.a: i32, .b: i32} = var "x"
 // CHECK:STDOUT:   %.loc7_35: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc7_33: i32 = stub_reference %.loc7_35
 // CHECK:STDOUT:   %.loc7_43: i32 = int_literal 2
@@ -97,7 +97,7 @@ var y: {.a: i32, .b: i32} = x;
 // CHECK:STDOUT:   %.loc7_44: {.a: i32, .b: i32} = struct_value (%.loc7_33, %.loc7_41)
 // CHECK:STDOUT:   assign %x, %.loc7_44
 // CHECK:STDOUT:   %.loc8: type = struct_type {.a: i32, .b: i32}
-// CHECK:STDOUT:   %y: {.a: i32, .b: i32} = var "y"
+// CHECK:STDOUT:   %y: ref {.a: i32, .b: i32} = var "y"
 // CHECK:STDOUT:   %.loc7_5: {.a: i32, .b: i32} = bind_value %x
 // CHECK:STDOUT:   assign %y, %.loc7_5
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/tuples/empty.carbon

@@ -55,11 +55,11 @@ var y: () = x;
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7_9.1: type = tuple_type ()
 // CHECK:STDOUT:   %.loc7_9.2: () = tuple_value ()
-// CHECK:STDOUT:   %x: () = var "x"
+// CHECK:STDOUT:   %x: ref () = var "x"
 // CHECK:STDOUT:   %.loc7_14: () = tuple_value ()
 // CHECK:STDOUT:   assign %x, %.loc7_14
 // CHECK:STDOUT:   %.loc8: () = tuple_value ()
-// CHECK:STDOUT:   %y: () = var "y"
+// CHECK:STDOUT:   %y: ref () = var "y"
 // CHECK:STDOUT:   %.loc7_5: () = bind_value %x
 // CHECK:STDOUT:   assign %y, %.loc7_5
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/tuples/fail_assign_empty.carbon

@@ -68,7 +68,7 @@ var x: (i32,) = ();
 // CHECK:STDOUT:   %.loc10_13.1: type = tuple_type (type)
 // CHECK:STDOUT:   %.loc10_13.2: (type,) = tuple_value (%.loc10_9)
 // CHECK:STDOUT:   %.loc10_13.3: type = tuple_type (i32)
-// CHECK:STDOUT:   %x: (i32,) = var "x"
+// CHECK:STDOUT:   %x: ref (i32,) = var "x"
 // CHECK:STDOUT:   %.loc10_18.1: type = tuple_type ()
 // CHECK:STDOUT:   %.loc10_18.2: () = tuple_value ()
 // CHECK:STDOUT:   assign %x, <error>

+ 1 - 1
toolchain/semantics/testdata/tuples/fail_assign_nested.carbon

@@ -178,7 +178,7 @@ var x: ((i32, i32), (i32, i32)) = ((1, 2, 3), (4, 5, 6));
 // CHECK:STDOUT:   %.loc10_31.2: ((type, type), (type, type)) = tuple_value (%.loc10_18.3, %.loc10_30.2)
 // CHECK:STDOUT:   %.loc10_18.4: type = tuple_type (i32, i32)
 // CHECK:STDOUT:   %.loc10_31.3: type = tuple_type ((i32, i32), (i32, i32))
-// CHECK:STDOUT:   %x: ((i32, i32), (i32, i32)) = var "x"
+// CHECK:STDOUT:   %x: ref ((i32, i32), (i32, i32)) = var "x"
 // CHECK:STDOUT:   %.loc10_37.1: i32 = int_literal 1
 // CHECK:STDOUT:   %.loc10_37.2: i32 = stub_reference %.loc10_37.1
 // CHECK:STDOUT:   %.loc10_40.1: i32 = int_literal 2

+ 1 - 1
toolchain/semantics/testdata/tuples/fail_assign_to_empty.carbon

@@ -50,7 +50,7 @@ var x: () = (66);
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc10_9.1: type = tuple_type ()
 // CHECK:STDOUT:   %.loc10_9.2: () = tuple_value ()
-// CHECK:STDOUT:   %x: () = var "x"
+// CHECK:STDOUT:   %x: ref () = var "x"
 // CHECK:STDOUT:   %.loc10_14: i32 = int_literal 66
 // CHECK:STDOUT:   assign %x, <error>
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/tuples/fail_element_type_mismatch.carbon

@@ -91,7 +91,7 @@ var x: (i32, i32) = (2, 65.89);
 // CHECK:STDOUT:   %.loc10_17.1: type = tuple_type (type, type)
 // CHECK:STDOUT:   %.loc10_17.2: (type, type) = tuple_value (%.loc10_9, %.loc10_14)
 // CHECK:STDOUT:   %.loc10_17.3: type = tuple_type (i32, i32)
-// CHECK:STDOUT:   %x: (i32, i32) = var "x"
+// CHECK:STDOUT:   %x: ref (i32, i32) = var "x"
 // CHECK:STDOUT:   %.loc10_22.1: i32 = int_literal 2
 // CHECK:STDOUT:   %.loc10_22.2: i32 = stub_reference %.loc10_22.1
 // CHECK:STDOUT:   %.loc10_25.1: f64 = real_literal 6589e-2

+ 1 - 1
toolchain/semantics/testdata/tuples/fail_too_few_element.carbon

@@ -83,7 +83,7 @@ var x: (i32, i32) = (2, );
 // CHECK:STDOUT:   %.loc10_17.1: type = tuple_type (type, type)
 // CHECK:STDOUT:   %.loc10_17.2: (type, type) = tuple_value (%.loc10_9, %.loc10_14)
 // CHECK:STDOUT:   %.loc10_17.3: type = tuple_type (i32, i32)
-// CHECK:STDOUT:   %x: (i32, i32) = var "x"
+// CHECK:STDOUT:   %x: ref (i32, i32) = var "x"
 // CHECK:STDOUT:   %.loc10_22.1: i32 = int_literal 2
 // CHECK:STDOUT:   %.loc10_22.2: i32 = stub_reference %.loc10_22.1
 // CHECK:STDOUT:   %.loc10_25.1: type = tuple_type (i32)

+ 1 - 1
toolchain/semantics/testdata/tuples/fail_type_assign.carbon

@@ -68,7 +68,7 @@ var x: (i32, ) = (i32, );
 // CHECK:STDOUT:   %.loc10_14.1: type = tuple_type (type)
 // CHECK:STDOUT:   %.loc10_14.2: (type,) = tuple_value (%.loc10_9)
 // CHECK:STDOUT:   %.loc10_14.3: type = tuple_type (i32)
-// CHECK:STDOUT:   %x: (i32,) = var "x"
+// CHECK:STDOUT:   %x: ref (i32,) = var "x"
 // CHECK:STDOUT:   %.loc10_19: type = stub_reference i32
 // CHECK:STDOUT:   %.loc10_24: (type,) = tuple_value (%.loc10_19)
 // CHECK:STDOUT:   assign %x, <error>

+ 1 - 1
toolchain/semantics/testdata/tuples/fail_value_as_type.carbon

@@ -63,5 +63,5 @@ var x: (1, );
 // CHECK:STDOUT:   %.loc10_12.1: type = tuple_type (i32)
 // CHECK:STDOUT:   %.loc10_12.2: (i32,) = tuple_value (%.loc10_9.2)
 // CHECK:STDOUT:   %.loc10_12.3: type = tuple_type (<error>)
-// CHECK:STDOUT:   %x: (<error>,) = var "x"
+// CHECK:STDOUT:   %x: ref (<error>,) = var "x"
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/tuples/nested_tuple.carbon

@@ -122,7 +122,7 @@ var x: ((i32, i32), i32) = ((12, 76), 6);
 // CHECK:STDOUT:   %.loc7_24.2: ((type, type), type) = tuple_value (%.loc7_18.3, %.loc7_21)
 // CHECK:STDOUT:   %.loc7_18.4: type = tuple_type (i32, i32)
 // CHECK:STDOUT:   %.loc7_24.3: type = tuple_type ((i32, i32), i32)
-// CHECK:STDOUT:   %x: ((i32, i32), i32) = var "x"
+// CHECK:STDOUT:   %x: ref ((i32, i32), i32) = var "x"
 // CHECK:STDOUT:   %.loc7_30.1: i32 = int_literal 12
 // CHECK:STDOUT:   %.loc7_30.2: i32 = stub_reference %.loc7_30.1
 // CHECK:STDOUT:   %.loc7_34.1: i32 = int_literal 76

+ 2 - 2
toolchain/semantics/testdata/tuples/one_element.carbon

@@ -83,14 +83,14 @@ var y: (i32,) = x;
 // CHECK:STDOUT:   %.loc7_13.1: type = tuple_type (type)
 // CHECK:STDOUT:   %.loc7_13.2: (type,) = tuple_value (%.loc7_9)
 // CHECK:STDOUT:   %.loc7_13.3: type = tuple_type (i32)
-// CHECK:STDOUT:   %x: (i32,) = var "x"
+// CHECK:STDOUT:   %x: ref (i32,) = var "x"
 // CHECK:STDOUT:   %.loc7_18.1: i32 = int_literal 4
 // CHECK:STDOUT:   %.loc7_18.2: i32 = stub_reference %.loc7_18.1
 // CHECK:STDOUT:   %.loc7_20: (i32,) = tuple_value (%.loc7_18.2)
 // CHECK:STDOUT:   assign %x, %.loc7_20
 // CHECK:STDOUT:   %.loc8_9: type = stub_reference i32
 // CHECK:STDOUT:   %.loc8_13: (type,) = tuple_value (%.loc8_9)
-// CHECK:STDOUT:   %y: (i32,) = var "y"
+// CHECK:STDOUT:   %y: ref (i32,) = var "y"
 // CHECK:STDOUT:   %.loc7_5: (i32,) = bind_value %x
 // CHECK:STDOUT:   assign %y, %.loc7_5
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/tuples/two_elements.carbon

@@ -98,7 +98,7 @@ var y: (i32, i32) = x;
 // CHECK:STDOUT:   %.loc7_17.1: type = tuple_type (type, type)
 // CHECK:STDOUT:   %.loc7_17.2: (type, type) = tuple_value (%.loc7_9, %.loc7_14)
 // CHECK:STDOUT:   %.loc7_17.3: type = tuple_type (i32, i32)
-// CHECK:STDOUT:   %x: (i32, i32) = var "x"
+// CHECK:STDOUT:   %x: ref (i32, i32) = var "x"
 // CHECK:STDOUT:   %.loc7_22.1: i32 = int_literal 4
 // CHECK:STDOUT:   %.loc7_22.2: i32 = stub_reference %.loc7_22.1
 // CHECK:STDOUT:   %.loc7_25.1: i32 = int_literal 102
@@ -108,7 +108,7 @@ var y: (i32, i32) = x;
 // CHECK:STDOUT:   %.loc8_9: type = stub_reference i32
 // CHECK:STDOUT:   %.loc8_14: type = stub_reference i32
 // CHECK:STDOUT:   %.loc8_17: (type, type) = tuple_value (%.loc8_9, %.loc8_14)
-// CHECK:STDOUT:   %y: (i32, i32) = var "y"
+// CHECK:STDOUT:   %y: ref (i32, i32) = var "y"
 // CHECK:STDOUT:   %.loc7_5: (i32, i32) = bind_value %x
 // CHECK:STDOUT:   assign %y, %.loc7_5
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/var/decl.carbon

@@ -48,6 +48,6 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x: i32 = var "x"
+// CHECK:STDOUT:   %x: ref i32 = var "x"
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/var/decl_with_init.carbon

@@ -53,7 +53,7 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x: i32 = var "x"
+// CHECK:STDOUT:   %x: ref i32 = var "x"
 // CHECK:STDOUT:   %.loc8: i32 = int_literal 0
 // CHECK:STDOUT:   assign %x, %.loc8
 // CHECK:STDOUT:   return

+ 2 - 2
toolchain/semantics/testdata/var/fail_duplicate_decl.carbon

@@ -68,10 +68,10 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x.loc9: i32 = var "x"
+// CHECK:STDOUT:   %x.loc9: ref i32 = var "x"
 // CHECK:STDOUT:   %.loc9: i32 = int_literal 0
 // CHECK:STDOUT:   assign %x.loc9, %.loc9
-// CHECK:STDOUT:   %x.loc16: i32 = var "x"
+// CHECK:STDOUT:   %x.loc16: ref i32 = var "x"
 // CHECK:STDOUT:   %.loc16: i32 = int_literal 0
 // CHECK:STDOUT:   assign %x.loc16, %.loc16
 // CHECK:STDOUT:   return

+ 1 - 1
toolchain/semantics/testdata/var/fail_init_type_mismatch.carbon

@@ -57,7 +57,7 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x: i32 = var "x"
+// CHECK:STDOUT:   %x: ref i32 = var "x"
 // CHECK:STDOUT:   %.loc11: f64 = real_literal 10e-1
 // CHECK:STDOUT:   assign %x, <error>
 // CHECK:STDOUT:   return

+ 1 - 1
toolchain/semantics/testdata/var/fail_init_with_self.carbon

@@ -53,7 +53,7 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x: i32 = var "x"
+// CHECK:STDOUT:   %x: ref i32 = var "x"
 // CHECK:STDOUT:   assign %x, <error>
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/var/fail_lookup_outside_scope.carbon

@@ -54,12 +54,12 @@ var y: i32 = x;
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
 // CHECK:STDOUT:   %.loc7 = fn_decl @Main
-// CHECK:STDOUT:   %y: i32 = var "y"
+// CHECK:STDOUT:   %y: ref i32 = var "y"
 // CHECK:STDOUT:   assign %y, <error>
 // CHECK:STDOUT: }
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x: i32 = var "x"
+// CHECK:STDOUT:   %x: ref i32 = var "x"
 // CHECK:STDOUT:   return
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/var/fail_storage_is_literal.carbon

@@ -60,7 +60,7 @@ fn Main() {
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
 // CHECK:STDOUT:   %.loc11_10: i32 = int_literal 1
-// CHECK:STDOUT:   %x: <error> = var "x"
+// CHECK:STDOUT:   %x: ref <error> = var "x"
 // CHECK:STDOUT:   %.loc11_14: i32 = int_literal 1
 // CHECK:STDOUT:   assign %x, <error>
 // CHECK:STDOUT:   return

+ 1 - 1
toolchain/semantics/testdata/var/global_decl.carbon

@@ -33,5 +33,5 @@ var x: i32;
 // CHECK:STDOUT: ]
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
-// CHECK:STDOUT:   %x: i32 = var "x"
+// CHECK:STDOUT:   %x: ref i32 = var "x"
 // CHECK:STDOUT: }

+ 1 - 1
toolchain/semantics/testdata/var/global_decl_with_init.carbon

@@ -38,7 +38,7 @@ var x: i32 = 0;
 // CHECK:STDOUT: ]
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
-// CHECK:STDOUT:   %x: i32 = var "x"
+// CHECK:STDOUT:   %x: ref i32 = var "x"
 // CHECK:STDOUT:   %.loc7: i32 = int_literal 0
 // CHECK:STDOUT:   assign %x, %.loc7
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/var/global_lookup.carbon

@@ -46,10 +46,10 @@ var y: i32 = x;
 // CHECK:STDOUT: ]
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
-// CHECK:STDOUT:   %x: i32 = var "x"
+// CHECK:STDOUT:   %x: ref i32 = var "x"
 // CHECK:STDOUT:   %.loc7_14: i32 = int_literal 0
 // CHECK:STDOUT:   assign %x, %.loc7_14
-// CHECK:STDOUT:   %y: i32 = var "y"
+// CHECK:STDOUT:   %y: ref i32 = var "y"
 // CHECK:STDOUT:   %.loc7_5: i32 = bind_value %x
 // CHECK:STDOUT:   assign %y, %.loc7_5
 // CHECK:STDOUT: }

+ 2 - 2
toolchain/semantics/testdata/var/global_lookup_in_scope.carbon

@@ -57,7 +57,7 @@ fn Main() {
 // CHECK:STDOUT: ]
 // CHECK:STDOUT:
 // CHECK:STDOUT: package {
-// CHECK:STDOUT:   %x: i32 = var "x"
+// CHECK:STDOUT:   %x: ref i32 = var "x"
 // CHECK:STDOUT:   %.loc7: i32 = int_literal 0
 // CHECK:STDOUT:   assign %x, %.loc7
 // CHECK:STDOUT:   %.loc9 = fn_decl @Main
@@ -65,7 +65,7 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %y: i32 = var "y"
+// CHECK:STDOUT:   %y: ref i32 = var "y"
 // CHECK:STDOUT:   %.loc7: i32 = bind_value package.%x
 // CHECK:STDOUT:   assign %y, %.loc7
 // CHECK:STDOUT:   return

+ 1 - 1
toolchain/semantics/testdata/var/lookup.carbon

@@ -54,7 +54,7 @@ fn Main() {
 // CHECK:STDOUT:
 // CHECK:STDOUT: fn @Main() {
 // CHECK:STDOUT: !entry:
-// CHECK:STDOUT:   %x: i32 = var "x"
+// CHECK:STDOUT:   %x: ref i32 = var "x"
 // CHECK:STDOUT:   %.loc8: i32 = int_literal 0
 // CHECK:STDOUT:   assign %x, %.loc8
 // CHECK:STDOUT:   return