From f6662807ba1b94640b9cbc9d2f922caf5ba94fdd Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 30 Aug 2023 17:11:09 -0700 Subject: [PATCH] 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. --- .../semantics/semantics_ir_formatter.cpp | 12 ++++++++++ .../testdata/array/assign_return_value.carbon | 8 +++---- .../testdata/array/assign_var.carbon | 4 ++-- .../semantics/testdata/array/base.carbon | 6 ++--- .../testdata/array/fail_invalid_type.carbon | 2 +- .../testdata/array/fail_out_of_bound.carbon | 2 +- .../testdata/array/fail_type_mismatch.carbon | 2 +- .../testdata/basics/builtin_types.carbon | 8 +++---- .../basics/fail_non_type_as_type.carbon | 2 +- .../basics/fail_qualifier_unsupported.carbon | 4 ++-- .../semantics/testdata/basics/parens.carbon | 2 +- .../in_place_tuple_initialization.carbon | 16 ++++++------- .../function/call/empty_struct.carbon | 2 +- .../testdata/function/call/empty_tuple.carbon | 2 +- .../call/fail_return_type_mismatch.carbon | 4 ++-- .../testdata/function/call/i32.carbon | 4 ++-- .../function/call/more_param_ir.carbon | 2 +- .../testdata/function/call/params_one.carbon | 2 +- .../function/call/params_one_comma.carbon | 4 ++-- .../testdata/function/call/params_two.carbon | 2 +- .../function/call/params_two_comma.carbon | 4 ++-- .../testdata/function/call/params_zero.carbon | 2 +- .../function/call/return_implicit.carbon | 4 ++-- .../function/declaration/simple.carbon | 2 +- toolchain/semantics/testdata/if/else.carbon | 6 ++--- .../semantics/testdata/if/fail_scope.carbon | 2 +- .../semantics/testdata/if/no_else.carbon | 4 ++-- .../if_expression/constant_condition.carbon | 24 +++++++++---------- .../if_expression/control_flow.carbon | 12 +++++----- .../index/array_element_access.carbon | 12 +++++----- .../index/fail_array_large_index.carbon | 6 ++--- .../index/fail_array_non_int_indexing.carbon | 6 ++--- .../fail_array_out_of_bound_access.carbon | 6 ++--- .../index/fail_empty_tuple_access.carbon | 8 +++---- .../testdata/index/fail_name_not_found.carbon | 2 +- .../index/fail_non_deterministic_type.carbon | 8 +++---- .../index/fail_tuple_large_index.carbon | 8 +++---- .../index/fail_tuple_non_int_indexing.carbon | 6 ++--- .../fail_tuple_out_of_bound_access.carbon | 6 ++--- .../index/tuple_element_access.carbon | 8 +++---- .../index/tuple_return_value_access.carbon | 8 +++---- .../ir/duplicate_name_same_line.carbon | 4 ++-- .../testdata/namespace/function.carbon | 2 +- .../testdata/namespace/nested.carbon | 2 +- .../semantics/testdata/operators/and.carbon | 12 +++++----- .../testdata/operators/assignment.carbon | 20 ++++++++-------- .../fail_assigment_to_non_assignable.carbon | 6 ++--- .../fail_type_mismatch_assignment.carbon | 2 +- .../semantics/testdata/operators/or.carbon | 12 +++++----- .../testdata/pointer/address_of_deref.carbon | 6 ++--- .../testdata/pointer/address_of_lvalue.carbon | 22 ++++++++--------- .../semantics/testdata/pointer/basic.carbon | 6 ++--- .../pointer/fail_address_of_value.carbon | 12 +++++----- .../fail_dereference_not_pointer.carbon | 6 ++--- .../pointer/fail_dereference_type.carbon | 4 ++-- .../testdata/pointer/nested_const.carbon | 4 ++-- .../semantics/testdata/struct/empty.carbon | 4 ++-- .../testdata/struct/fail_assign_empty.carbon | 2 +- .../testdata/struct/fail_assign_nested.carbon | 2 +- .../struct/fail_assign_to_empty.carbon | 2 +- .../struct/fail_field_name_mismatch.carbon | 2 +- .../struct/fail_field_type_mismatch.carbon | 2 +- .../struct/fail_member_access_type.carbon | 4 ++-- .../struct/fail_non_member_access.carbon | 4 ++-- .../struct/fail_too_few_values.carbon | 2 +- .../testdata/struct/fail_type_assign.carbon | 2 +- .../testdata/struct/fail_value_as_type.carbon | 2 +- .../testdata/struct/member_access.carbon | 8 +++---- .../testdata/struct/one_entry.carbon | 4 ++-- .../testdata/struct/tuple_as_element.carbon | 4 ++-- .../testdata/struct/two_entries.carbon | 4 ++-- .../semantics/testdata/tuples/empty.carbon | 4 ++-- .../testdata/tuples/fail_assign_empty.carbon | 2 +- .../testdata/tuples/fail_assign_nested.carbon | 2 +- .../tuples/fail_assign_to_empty.carbon | 2 +- .../tuples/fail_element_type_mismatch.carbon | 2 +- .../tuples/fail_too_few_element.carbon | 2 +- .../testdata/tuples/fail_type_assign.carbon | 2 +- .../testdata/tuples/fail_value_as_type.carbon | 2 +- .../testdata/tuples/nested_tuple.carbon | 2 +- .../testdata/tuples/one_element.carbon | 4 ++-- .../testdata/tuples/two_elements.carbon | 4 ++-- toolchain/semantics/testdata/var/decl.carbon | 2 +- .../testdata/var/decl_with_init.carbon | 2 +- .../testdata/var/fail_duplicate_decl.carbon | 4 ++-- .../var/fail_init_type_mismatch.carbon | 2 +- .../testdata/var/fail_init_with_self.carbon | 2 +- .../var/fail_lookup_outside_scope.carbon | 4 ++-- .../var/fail_storage_is_literal.carbon | 2 +- .../semantics/testdata/var/global_decl.carbon | 2 +- .../testdata/var/global_decl_with_init.carbon | 2 +- .../testdata/var/global_lookup.carbon | 4 ++-- .../var/global_lookup_in_scope.carbon | 4 ++-- .../semantics/testdata/var/lookup.carbon | 2 +- 94 files changed, 237 insertions(+), 225 deletions(-) diff --git a/toolchain/semantics/semantics_ir_formatter.cpp b/toolchain/semantics/semantics_ir_formatter.cpp index f94271a6d2f9..0bbc318eff18 100644 --- a/toolchain/semantics/semantics_ir_formatter.cpp +++ b/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; diff --git a/toolchain/semantics/testdata/array/assign_return_value.carbon b/toolchain/semantics/testdata/array/assign_return_value.carbon index dd956317882c..1b2d9f8c63e4 100644 --- a/toolchain/semantics/testdata/array/assign_return_value.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/array/assign_var.carbon b/toolchain/semantics/testdata/array/assign_var.carbon index 55c771fabc0e..7e47e0d84cb7 100644 --- a/toolchain/semantics/testdata/array/assign_var.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/array/base.carbon b/toolchain/semantics/testdata/array/base.carbon index f8741af26398..04bab91caa80 100644 --- a/toolchain/semantics/testdata/array/base.carbon +++ b/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 () diff --git a/toolchain/semantics/testdata/array/fail_invalid_type.carbon b/toolchain/semantics/testdata/array/fail_invalid_type.carbon index f85793588661..c67dad3f2c58 100644 --- a/toolchain/semantics/testdata/array/fail_invalid_type.carbon +++ b/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, -// CHECK:STDOUT: %a: [; 1] = var "a" +// CHECK:STDOUT: %a: ref [; 1] = var "a" // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/array/fail_out_of_bound.carbon b/toolchain/semantics/testdata/array/fail_out_of_bound.carbon index bb53acd0342c..6c88adccae74 100644 --- a/toolchain/semantics/testdata/array/fail_out_of_bound.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/array/fail_type_mismatch.carbon b/toolchain/semantics/testdata/array/fail_type_mismatch.carbon index cdf9ff8e96aa..1192888f3530 100644 --- a/toolchain/semantics/testdata/array/fail_type_mismatch.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/basics/builtin_types.carbon b/toolchain/semantics/testdata/basics/builtin_types.carbon index c818f38d50f2..58fb3b9609f9 100644 --- a/toolchain/semantics/testdata/basics/builtin_types.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/basics/fail_non_type_as_type.carbon b/toolchain/semantics/testdata/basics/fail_non_type_as_type.carbon index 292abd670db3..4db35ef07fe4 100644 --- a/toolchain/semantics/testdata/basics/fail_non_type_as_type.carbon +++ b/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, // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/basics/fail_qualifier_unsupported.carbon b/toolchain/semantics/testdata/basics/fail_qualifier_unsupported.carbon index 70b7681a6f43..ac094c37c1c7 100644 --- a/toolchain/semantics/testdata/basics/fail_qualifier_unsupported.carbon +++ b/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, // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/basics/parens.carbon b/toolchain/semantics/testdata/basics/parens.carbon index ef5110ba0906..3754d5055a3b 100644 --- a/toolchain/semantics/testdata/basics/parens.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/expression_category/in_place_tuple_initialization.carbon b/toolchain/semantics/testdata/expression_category/in_place_tuple_initialization.carbon index 394ff0a5d390..d9167ebc134f 100644 --- a/toolchain/semantics/testdata/expression_category/in_place_tuple_initialization.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/function/call/empty_struct.carbon b/toolchain/semantics/testdata/function/call/empty_struct.carbon index 8a9212307b16..1c74fd812524 100644 --- a/toolchain/semantics/testdata/function/call/empty_struct.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/function/call/empty_tuple.carbon b/toolchain/semantics/testdata/function/call/empty_tuple.carbon index e1efde4ff44d..b4ebbc271314 100644 --- a/toolchain/semantics/testdata/function/call/empty_tuple.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/function/call/fail_return_type_mismatch.carbon b/toolchain/semantics/testdata/function/call/fail_return_type_mismatch.carbon index 70c6a2ec5cba..1d7decc233c8 100644 --- a/toolchain/semantics/testdata/function/call/fail_return_type_mismatch.carbon +++ b/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, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/function/call/i32.carbon b/toolchain/semantics/testdata/function/call/i32.carbon index 2cd392ebe07f..7f0fe517a587 100644 --- a/toolchain/semantics/testdata/function/call/i32.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/function/call/more_param_ir.carbon b/toolchain/semantics/testdata/function/call/more_param_ir.carbon index b38c2b0dfaeb..0dcd726b6c90 100644 --- a/toolchain/semantics/testdata/function/call/more_param_ir.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/function/call/params_one.carbon b/toolchain/semantics/testdata/function/call/params_one.carbon index 2feb05b7bd1c..13dd3fc1e744 100644 --- a/toolchain/semantics/testdata/function/call/params_one.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/function/call/params_one_comma.carbon b/toolchain/semantics/testdata/function/call/params_one_comma.carbon index 39ccc118e720..ff2beb47c709 100644 --- a/toolchain/semantics/testdata/function/call/params_one_comma.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/function/call/params_two.carbon b/toolchain/semantics/testdata/function/call/params_two.carbon index 17e8218f9376..23075d4ee6d1 100644 --- a/toolchain/semantics/testdata/function/call/params_two.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/function/call/params_two_comma.carbon b/toolchain/semantics/testdata/function/call/params_two_comma.carbon index 9ccf17c9e643..af39c21db5d3 100644 --- a/toolchain/semantics/testdata/function/call/params_two_comma.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/function/call/params_zero.carbon b/toolchain/semantics/testdata/function/call/params_zero.carbon index 961433889ab2..5172c11a2f52 100644 --- a/toolchain/semantics/testdata/function/call/params_zero.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/function/call/return_implicit.carbon b/toolchain/semantics/testdata/function/call/return_implicit.carbon index 6b5c6e7f7208..9be8c63abc27 100644 --- a/toolchain/semantics/testdata/function/call/return_implicit.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/function/declaration/simple.carbon b/toolchain/semantics/testdata/function/declaration/simple.carbon index 7e6f830f4434..ef99b36009ca 100644 --- a/toolchain/semantics/testdata/function/declaration/simple.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/if/else.carbon b/toolchain/semantics/testdata/if/else.carbon index 617a5aea866e..80e904b7f87e 100644 --- a/toolchain/semantics/testdata/if/else.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/if/fail_scope.carbon b/toolchain/semantics/testdata/if/fail_scope.carbon index fef77d4a4de7..a10843436f42 100644 --- a/toolchain/semantics/testdata/if/fail_scope.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/if/no_else.carbon b/toolchain/semantics/testdata/if/no_else.carbon index 7911683e9bf1..6325a7857d21 100644 --- a/toolchain/semantics/testdata/if/no_else.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/if_expression/constant_condition.carbon b/toolchain/semantics/testdata/if_expression/constant_condition.carbon index 7b0ca80008ca..64630e3e7a79 100644 --- a/toolchain/semantics/testdata/if_expression/constant_condition.carbon +++ b/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: diff --git a/toolchain/semantics/testdata/if_expression/control_flow.carbon b/toolchain/semantics/testdata/if_expression/control_flow.carbon index ae6ab502351b..0611151480e1 100644 --- a/toolchain/semantics/testdata/if_expression/control_flow.carbon +++ b/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: diff --git a/toolchain/semantics/testdata/index/array_element_access.carbon b/toolchain/semantics/testdata/index/array_element_access.carbon index d6d1c6b107ec..e17694902e6d 100644 --- a/toolchain/semantics/testdata/index/array_element_access.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/index/fail_array_large_index.carbon b/toolchain/semantics/testdata/index/fail_array_large_index.carbon index 88cd69581a96..fbb1ec28cf80 100644 --- a/toolchain/semantics/testdata/index/fail_array_large_index.carbon +++ b/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, +// CHECK:STDOUT: %.loc11_35.1: ref i32 = array_index %a, // CHECK:STDOUT: %.loc11_35.2: i32 = bind_value %.loc11_35.1 // CHECK:STDOUT: assign %b, %.loc11_35.2 // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/index/fail_array_non_int_indexing.carbon b/toolchain/semantics/testdata/index/fail_array_non_int_indexing.carbon index 73de098406a4..48699a62a61c 100644 --- a/toolchain/semantics/testdata/index/fail_array_non_int_indexing.carbon +++ b/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, +// CHECK:STDOUT: %.loc11_19.1: ref i32 = array_index %a, // CHECK:STDOUT: %.loc11_19.2: i32 = bind_value %.loc11_19.1 // CHECK:STDOUT: assign %b, %.loc11_19.2 // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/index/fail_array_out_of_bound_access.carbon b/toolchain/semantics/testdata/index/fail_array_out_of_bound_access.carbon index 3756cfbc1481..d37566f0102c 100644 --- a/toolchain/semantics/testdata/index/fail_array_out_of_bound_access.carbon +++ b/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, +// CHECK:STDOUT: %.loc11_17.1: ref i32 = array_index %a, // CHECK:STDOUT: %.loc11_17.2: i32 = bind_value %.loc11_17.1 // CHECK:STDOUT: assign %b, %.loc11_17.2 // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/index/fail_empty_tuple_access.carbon b/toolchain/semantics/testdata/index/fail_empty_tuple_access.carbon index d1c1616f45f3..54ad833e6764 100644 --- a/toolchain/semantics/testdata/index/fail_empty_tuple_access.carbon +++ b/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: = tuple_index %.loc13_4.4, +// 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 = tuple_index %.loc13_4.4, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/index/fail_name_not_found.carbon b/toolchain/semantics/testdata/index/fail_name_not_found.carbon index 45bf2339b0bd..ee39e0cdeb4f 100644 --- a/toolchain/semantics/testdata/index/fail_name_not_found.carbon +++ b/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, // CHECK:STDOUT: return diff --git a/toolchain/semantics/testdata/index/fail_non_deterministic_type.carbon b/toolchain/semantics/testdata/index/fail_non_deterministic_type.carbon index f8bbca0d38dc..38206ce2b76d 100644 --- a/toolchain/semantics/testdata/index/fail_non_deterministic_type.carbon +++ b/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: = tuple_index %a, +// CHECK:STDOUT: %c: ref i32 = var "c" +// CHECK:STDOUT: %.loc12: ref = tuple_index %a, // CHECK:STDOUT: assign %c, // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/index/fail_tuple_large_index.carbon b/toolchain/semantics/testdata/index/fail_tuple_large_index.carbon index 1af540d047fd..27a3a7f1cf9a 100644 --- a/toolchain/semantics/testdata/index/fail_tuple_large_index.carbon +++ b/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: = tuple_index %b, +// CHECK:STDOUT: %.loc12_35: ref = tuple_index %b, // CHECK:STDOUT: assign %c, // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/index/fail_tuple_non_int_indexing.carbon b/toolchain/semantics/testdata/index/fail_tuple_non_int_indexing.carbon index 97bf48df58f2..633d007d9285 100644 --- a/toolchain/semantics/testdata/index/fail_tuple_non_int_indexing.carbon +++ b/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: = tuple_index %a, +// CHECK:STDOUT: %.loc11_19: ref = tuple_index %a, // CHECK:STDOUT: assign %b, // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/index/fail_tuple_out_of_bound_access.carbon b/toolchain/semantics/testdata/index/fail_tuple_out_of_bound_access.carbon index ddf73ce139ae..a1817c7b89fe 100644 --- a/toolchain/semantics/testdata/index/fail_tuple_out_of_bound_access.carbon +++ b/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: = tuple_index %a, +// CHECK:STDOUT: %.loc11_17: ref = tuple_index %a, // CHECK:STDOUT: assign %b, // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/index/tuple_element_access.carbon b/toolchain/semantics/testdata/index/tuple_element_access.carbon index 22bca63bb047..0f0a4603466f 100644 --- a/toolchain/semantics/testdata/index/tuple_element_access.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/index/tuple_return_value_access.carbon b/toolchain/semantics/testdata/index/tuple_return_value_access.carbon index 4e39587157d5..f21b794d53c8 100644 --- a/toolchain/semantics/testdata/index/tuple_return_value_access.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/ir/duplicate_name_same_line.carbon b/toolchain/semantics/testdata/ir/duplicate_name_same_line.carbon index b3a851b06fd2..c434f44683c1 100644 --- a/toolchain/semantics/testdata/ir/duplicate_name_same_line.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/namespace/function.carbon b/toolchain/semantics/testdata/namespace/function.carbon index fab75ee6edf7..24043cdcb0d3 100644 --- a/toolchain/semantics/testdata/namespace/function.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/namespace/nested.carbon b/toolchain/semantics/testdata/namespace/nested.carbon index 53b8b1344856..1413c779576c 100644 --- a/toolchain/semantics/testdata/namespace/nested.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/operators/and.carbon b/toolchain/semantics/testdata/operators/and.carbon index 51fca03dc883..c8f66c955cd1 100644 --- a/toolchain/semantics/testdata/operators/and.carbon +++ b/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: diff --git a/toolchain/semantics/testdata/operators/assignment.carbon b/toolchain/semantics/testdata/operators/assignment.carbon index 1f7d5648ec59..b2d2c0b9165f 100644 --- a/toolchain/semantics/testdata/operators/assignment.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/operators/fail_assigment_to_non_assignable.carbon b/toolchain/semantics/testdata/operators/fail_assigment_to_non_assignable.carbon index 6877b3dece3b..04935f809f71 100644 --- a/toolchain/semantics/testdata/operators/fail_assigment_to_non_assignable.carbon +++ b/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: diff --git a/toolchain/semantics/testdata/operators/fail_type_mismatch_assignment.carbon b/toolchain/semantics/testdata/operators/fail_type_mismatch_assignment.carbon index cc7474f8a1dc..06e5368656a9 100644 --- a/toolchain/semantics/testdata/operators/fail_type_mismatch_assignment.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/operators/or.carbon b/toolchain/semantics/testdata/operators/or.carbon index e7efdd10d9e1..737e339e615c 100644 --- a/toolchain/semantics/testdata/operators/or.carbon +++ b/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: diff --git a/toolchain/semantics/testdata/pointer/address_of_deref.carbon b/toolchain/semantics/testdata/pointer/address_of_deref.carbon index 546f11a54bca..20be82ab05af 100644 --- a/toolchain/semantics/testdata/pointer/address_of_deref.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/pointer/address_of_lvalue.carbon b/toolchain/semantics/testdata/pointer/address_of_lvalue.carbon index fcb5ff4ee3be..67a3bd899217 100644 --- a/toolchain/semantics/testdata/pointer/address_of_lvalue.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/pointer/basic.carbon b/toolchain/semantics/testdata/pointer/basic.carbon index 7aecece55157..82a1b1d57412 100644 --- a/toolchain/semantics/testdata/pointer/basic.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/pointer/fail_address_of_value.carbon b/toolchain/semantics/testdata/pointer/fail_address_of_value.carbon index 08b3c9acf36c..36b81045acb9 100644 --- a/toolchain/semantics/testdata/pointer/fail_address_of_value.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/pointer/fail_dereference_not_pointer.carbon b/toolchain/semantics/testdata/pointer/fail_dereference_not_pointer.carbon index 0a1fa9af2089..2ebaf45422fd 100644 --- a/toolchain/semantics/testdata/pointer/fail_dereference_not_pointer.carbon +++ b/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: = dereference %n +// CHECK:STDOUT: %.loc11: ref = dereference %n // CHECK:STDOUT: %.loc15_5.1: type = tuple_type () // CHECK:STDOUT: %.loc15_5.2: () = tuple_value () -// CHECK:STDOUT: %.loc15_3: = dereference %.loc15_5.2 +// CHECK:STDOUT: %.loc15_3: ref = dereference %.loc15_5.2 // CHECK:STDOUT: %.loc19_5.1: type = struct_type {} // CHECK:STDOUT: %.loc19_5.2: {} = struct_value () -// CHECK:STDOUT: %.loc19_3: = dereference %.loc19_5.2 +// CHECK:STDOUT: %.loc19_3: ref = dereference %.loc19_5.2 // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/pointer/fail_dereference_type.carbon b/toolchain/semantics/testdata/pointer/fail_dereference_type.carbon index ad114c469993..bee6b256a548 100644 --- a/toolchain/semantics/testdata/pointer/fail_dereference_type.carbon +++ b/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: = dereference i32 -// CHECK:STDOUT: %p: = var "p" +// CHECK:STDOUT: %.loc13: ref = dereference i32 +// CHECK:STDOUT: %p: ref = var "p" // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/pointer/nested_const.carbon b/toolchain/semantics/testdata/pointer/nested_const.carbon index e4e731db5963..265aa5fe8618 100644 --- a/toolchain/semantics/testdata/pointer/nested_const.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/struct/empty.carbon b/toolchain/semantics/testdata/struct/empty.carbon index f4725011831d..26dd54a12fa3 100644 --- a/toolchain/semantics/testdata/struct/empty.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/struct/fail_assign_empty.carbon b/toolchain/semantics/testdata/struct/fail_assign_empty.carbon index 61902af68e32..37c8c63921c4 100644 --- a/toolchain/semantics/testdata/struct/fail_assign_empty.carbon +++ b/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, diff --git a/toolchain/semantics/testdata/struct/fail_assign_nested.carbon b/toolchain/semantics/testdata/struct/fail_assign_nested.carbon index f0fd77cbdb88..6cdc0888bebf 100644 --- a/toolchain/semantics/testdata/struct/fail_assign_nested.carbon +++ b/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: {}} diff --git a/toolchain/semantics/testdata/struct/fail_assign_to_empty.carbon b/toolchain/semantics/testdata/struct/fail_assign_to_empty.carbon index a2e1e3bf4aff..a5b576fad981 100644 --- a/toolchain/semantics/testdata/struct/fail_assign_to_empty.carbon +++ b/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} diff --git a/toolchain/semantics/testdata/struct/fail_field_name_mismatch.carbon b/toolchain/semantics/testdata/struct/fail_field_name_mismatch.carbon index 4f88886d680e..207c35174fc2 100644 --- a/toolchain/semantics/testdata/struct/fail_field_name_mismatch.carbon +++ b/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} diff --git a/toolchain/semantics/testdata/struct/fail_field_type_mismatch.carbon b/toolchain/semantics/testdata/struct/fail_field_type_mismatch.carbon index 8ca6be4236fe..1fd28cb3edce 100644 --- a/toolchain/semantics/testdata/struct/fail_field_type_mismatch.carbon +++ b/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} diff --git a/toolchain/semantics/testdata/struct/fail_member_access_type.carbon b/toolchain/semantics/testdata/struct/fail_member_access_type.carbon index 3ac10b2a1a2a..c5a8d548c1f0 100644 --- a/toolchain/semantics/testdata/struct/fail_member_access_type.carbon +++ b/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, // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/struct/fail_non_member_access.carbon b/toolchain/semantics/testdata/struct/fail_non_member_access.carbon index 380d6075a1b6..6cedec614d9d 100644 --- a/toolchain/semantics/testdata/struct/fail_non_member_access.carbon +++ b/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, // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/struct/fail_too_few_values.carbon b/toolchain/semantics/testdata/struct/fail_too_few_values.carbon index 74731b30d01c..1cc22b1fb8b2 100644 --- a/toolchain/semantics/testdata/struct/fail_too_few_values.carbon +++ b/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} diff --git a/toolchain/semantics/testdata/struct/fail_type_assign.carbon b/toolchain/semantics/testdata/struct/fail_type_assign.carbon index 1b5eed39af6b..40c82d38e676 100644 --- a/toolchain/semantics/testdata/struct/fail_type_assign.carbon +++ b/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, // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/struct/fail_value_as_type.carbon b/toolchain/semantics/testdata/struct/fail_value_as_type.carbon index e7fcee16fca2..32811873a0bd 100644 --- a/toolchain/semantics/testdata/struct/fail_value_as_type.carbon +++ b/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: = var "x" +// CHECK:STDOUT: %x: ref = var "x" // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/struct/member_access.carbon b/toolchain/semantics/testdata/struct/member_access.carbon index 6190bcd7aa4e..15cdff82f884 100644 --- a/toolchain/semantics/testdata/struct/member_access.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/struct/one_entry.carbon b/toolchain/semantics/testdata/struct/one_entry.carbon index 1b94973c81cc..78a928776b66 100644 --- a/toolchain/semantics/testdata/struct/one_entry.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/struct/tuple_as_element.carbon b/toolchain/semantics/testdata/struct/tuple_as_element.carbon index 303c73dbb51b..7ce6aa750ebe 100644 --- a/toolchain/semantics/testdata/struct/tuple_as_element.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/struct/two_entries.carbon b/toolchain/semantics/testdata/struct/two_entries.carbon index ba506a668464..5ed7f4ade90e 100644 --- a/toolchain/semantics/testdata/struct/two_entries.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/tuples/empty.carbon b/toolchain/semantics/testdata/tuples/empty.carbon index 928ada344719..d1a4b980a8ac 100644 --- a/toolchain/semantics/testdata/tuples/empty.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/tuples/fail_assign_empty.carbon b/toolchain/semantics/testdata/tuples/fail_assign_empty.carbon index bf893e947ae2..17195ab33519 100644 --- a/toolchain/semantics/testdata/tuples/fail_assign_empty.carbon +++ b/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, diff --git a/toolchain/semantics/testdata/tuples/fail_assign_nested.carbon b/toolchain/semantics/testdata/tuples/fail_assign_nested.carbon index e4acd45668a7..8551d33012fb 100644 --- a/toolchain/semantics/testdata/tuples/fail_assign_nested.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/tuples/fail_assign_to_empty.carbon b/toolchain/semantics/testdata/tuples/fail_assign_to_empty.carbon index 85adcc7d62da..5241683524e2 100644 --- a/toolchain/semantics/testdata/tuples/fail_assign_to_empty.carbon +++ b/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, // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/tuples/fail_element_type_mismatch.carbon b/toolchain/semantics/testdata/tuples/fail_element_type_mismatch.carbon index dbcf1498e087..7aa34a99d70f 100644 --- a/toolchain/semantics/testdata/tuples/fail_element_type_mismatch.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/tuples/fail_too_few_element.carbon b/toolchain/semantics/testdata/tuples/fail_too_few_element.carbon index 5e09b4f9b6e0..2afcce634569 100644 --- a/toolchain/semantics/testdata/tuples/fail_too_few_element.carbon +++ b/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) diff --git a/toolchain/semantics/testdata/tuples/fail_type_assign.carbon b/toolchain/semantics/testdata/tuples/fail_type_assign.carbon index 45b73ba55763..48674e01e2cb 100644 --- a/toolchain/semantics/testdata/tuples/fail_type_assign.carbon +++ b/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, diff --git a/toolchain/semantics/testdata/tuples/fail_value_as_type.carbon b/toolchain/semantics/testdata/tuples/fail_value_as_type.carbon index 3d68eb8c968c..3536b12a2719 100644 --- a/toolchain/semantics/testdata/tuples/fail_value_as_type.carbon +++ b/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 () -// CHECK:STDOUT: %x: (,) = var "x" +// CHECK:STDOUT: %x: ref (,) = var "x" // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/tuples/nested_tuple.carbon b/toolchain/semantics/testdata/tuples/nested_tuple.carbon index 7101cb5d6b80..196db4ae4df6 100644 --- a/toolchain/semantics/testdata/tuples/nested_tuple.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/tuples/one_element.carbon b/toolchain/semantics/testdata/tuples/one_element.carbon index 1d1bf1e636a7..6d71bbeabc15 100644 --- a/toolchain/semantics/testdata/tuples/one_element.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/tuples/two_elements.carbon b/toolchain/semantics/testdata/tuples/two_elements.carbon index d73440067438..5f80c0cc9956 100644 --- a/toolchain/semantics/testdata/tuples/two_elements.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/var/decl.carbon b/toolchain/semantics/testdata/var/decl.carbon index 65431ed4ca09..8d1d7207f937 100644 --- a/toolchain/semantics/testdata/var/decl.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/var/decl_with_init.carbon b/toolchain/semantics/testdata/var/decl_with_init.carbon index 342c5a355ac2..d01a1c0c8814 100644 --- a/toolchain/semantics/testdata/var/decl_with_init.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/var/fail_duplicate_decl.carbon b/toolchain/semantics/testdata/var/fail_duplicate_decl.carbon index bed0e5a97098..2ed040eaa514 100644 --- a/toolchain/semantics/testdata/var/fail_duplicate_decl.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/var/fail_init_type_mismatch.carbon b/toolchain/semantics/testdata/var/fail_init_type_mismatch.carbon index 3a00850d9bb9..adddbf89f88e 100644 --- a/toolchain/semantics/testdata/var/fail_init_type_mismatch.carbon +++ b/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, // CHECK:STDOUT: return diff --git a/toolchain/semantics/testdata/var/fail_init_with_self.carbon b/toolchain/semantics/testdata/var/fail_init_with_self.carbon index ee6e69bd0c07..ce305125bfaa 100644 --- a/toolchain/semantics/testdata/var/fail_init_with_self.carbon +++ b/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, // CHECK:STDOUT: return // CHECK:STDOUT: } diff --git a/toolchain/semantics/testdata/var/fail_lookup_outside_scope.carbon b/toolchain/semantics/testdata/var/fail_lookup_outside_scope.carbon index df7ee9241a43..0ed6ac0a427d 100644 --- a/toolchain/semantics/testdata/var/fail_lookup_outside_scope.carbon +++ b/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, // 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: } diff --git a/toolchain/semantics/testdata/var/fail_storage_is_literal.carbon b/toolchain/semantics/testdata/var/fail_storage_is_literal.carbon index 2ce6068bfa56..d268ada47cfc 100644 --- a/toolchain/semantics/testdata/var/fail_storage_is_literal.carbon +++ b/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: = var "x" +// CHECK:STDOUT: %x: ref = var "x" // CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 // CHECK:STDOUT: assign %x, // CHECK:STDOUT: return diff --git a/toolchain/semantics/testdata/var/global_decl.carbon b/toolchain/semantics/testdata/var/global_decl.carbon index 2951cc465305..76301c9d7d42 100644 --- a/toolchain/semantics/testdata/var/global_decl.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/var/global_decl_with_init.carbon b/toolchain/semantics/testdata/var/global_decl_with_init.carbon index cca75c0df091..d5a24ef9ad5b 100644 --- a/toolchain/semantics/testdata/var/global_decl_with_init.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/var/global_lookup.carbon b/toolchain/semantics/testdata/var/global_lookup.carbon index 79091c708fca..271e75f8d488 100644 --- a/toolchain/semantics/testdata/var/global_lookup.carbon +++ b/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: } diff --git a/toolchain/semantics/testdata/var/global_lookup_in_scope.carbon b/toolchain/semantics/testdata/var/global_lookup_in_scope.carbon index 5287f2f0e65c..417c543e852a 100644 --- a/toolchain/semantics/testdata/var/global_lookup_in_scope.carbon +++ b/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 diff --git a/toolchain/semantics/testdata/var/lookup.carbon b/toolchain/semantics/testdata/var/lookup.carbon index 5e8adeb78385..f37b456d8ddd 100644 --- a/toolchain/semantics/testdata/var/lookup.carbon +++ b/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