mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Model var as a pattern operator (#4720)
Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
6572da7314
commit
13434f0e8a
@@ -37,7 +37,16 @@ var x: {.a: i32} = {};
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc15_1: %struct_type.a = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a = var x
|
||||
// CHECK:STDOUT: %.loc15_16: type = splice_block %struct_type.a [template = constants.%struct_type.a] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -35,7 +35,15 @@ var x: {} = {.a = 1};
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc15_1: %empty_struct_type = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %empty_struct_type = var x
|
||||
// CHECK:STDOUT: %.loc15_9.1: type = splice_block %.loc15_9.3 [template = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc15_9.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc15_9.3: type = converted %.loc15_9.2, constants.%empty_struct_type [template = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %x.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+40
-4
@@ -81,8 +81,8 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4};
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: .v = @__global_init.%v
|
||||
// CHECK:STDOUT: .w = @__global_init.%w
|
||||
// CHECK:STDOUT: .v = %v
|
||||
// CHECK:STDOUT: .w = %w
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
@@ -104,9 +104,47 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4};
|
||||
// CHECK:STDOUT: %return.param: ref <error> = out_param runtime_param0
|
||||
// CHECK:STDOUT: %return: ref <error> = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: <error> = binding_pattern v
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.1: <error> = splice_block <error> [template = <error>] {
|
||||
// CHECK:STDOUT: %int_32.loc27_13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc27_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc27_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc27_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: <error> = bind_name v, <error>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %w.patt: %i32 = binding_pattern w
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc36: type = splice_block %i32.loc36 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc36: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc36: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %w: %i32 = bind_name w, <error>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a.ba9 = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc45_1: %struct_type.a.ba9 = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a.ba9 = var x
|
||||
// CHECK:STDOUT: %.loc45_16: type = splice_block %struct_type.a [template = constants.%struct_type.a.ba9] {
|
||||
// CHECK:STDOUT: %int_32.loc45: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc45: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.ba9]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a.ba9 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %struct_type.b.c = binding_pattern y
|
||||
// CHECK:STDOUT: %.loc54_1: %struct_type.b.c = var_pattern %y.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %struct_type.b.c = var y
|
||||
// CHECK:STDOUT: %.loc54_25: type = splice_block %struct_type.b.c [template = constants.%struct_type.b.c] {
|
||||
// CHECK:STDOUT: %int_32.loc54_13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc54_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc54_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc54_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %i32} [template = constants.%struct_type.b.c]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %struct_type.b.c = bind_name y, %y.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -116,11 +154,9 @@ var y: {.b: i32, .c: i32} = {.b = 3, .b = 4};
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_1.loc27: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc27: %struct_type.a.a6c = struct_literal (%int_1.loc27)
|
||||
// CHECK:STDOUT: %v: <error> = bind_name v, <error>
|
||||
// CHECK:STDOUT: %int_1.loc36: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2.loc36: Core.IntLiteral = int_value 2 [template = constants.%int_2]
|
||||
// CHECK:STDOUT: %def.ref: <error> = name_ref def, <error> [template = <error>]
|
||||
// CHECK:STDOUT: %w: %i32 = bind_name w, <error>
|
||||
// CHECK:STDOUT: %int_1.loc45: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
||||
// CHECK:STDOUT: %int_2.loc45: Core.IntLiteral = int_value 2 [template = constants.%int_2]
|
||||
// CHECK:STDOUT: assign file.%x.var, <error>
|
||||
|
||||
@@ -46,9 +46,27 @@ var y: {.b: i32} = x;
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc15_1: %struct_type.a = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a = var x
|
||||
// CHECK:STDOUT: %.loc15_16: type = splice_block %struct_type.a [template = constants.%struct_type.a] {
|
||||
// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %struct_type.b.0a3 = binding_pattern y
|
||||
// CHECK:STDOUT: %.loc21_1: %struct_type.b.0a3 = var_pattern %y.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %struct_type.b.0a3 = var y
|
||||
// CHECK:STDOUT: %.loc21_16: type = splice_block %struct_type.b [template = constants.%struct_type.b.0a3] {
|
||||
// CHECK:STDOUT: %int_32.loc21: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %i32} [template = constants.%struct_type.b.0a3]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %struct_type.b.0a3 = bind_name y, %y.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -38,7 +38,16 @@ var x: {.a: i32} = {.b = 1.0};
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc15_1: %struct_type.a = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a = var x
|
||||
// CHECK:STDOUT: %.loc15_16: type = splice_block %struct_type.a [template = constants.%struct_type.a] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -18,6 +18,9 @@ var y: i32 = x.b;
|
||||
// CHECK:STDOUT: --- fail_member_access_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
|
||||
// CHECK:STDOUT: %Float.type: type = fn_type @Float [template]
|
||||
// CHECK:STDOUT: %Float: %Float.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: f64} [template]
|
||||
// CHECK:STDOUT: %float: f64 = float_literal 4 [template]
|
||||
// CHECK:STDOUT: %struct: %struct_type.a = struct_value (%float) [template]
|
||||
@@ -41,9 +44,28 @@ var y: i32 = x.b;
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc11_1: %struct_type.a = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a = var x
|
||||
// CHECK:STDOUT: %.loc11_16: type = splice_block %struct_type.a [template = constants.%struct_type.a] {
|
||||
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64]
|
||||
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64]
|
||||
// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %float.make_type [template = f64]
|
||||
// CHECK:STDOUT: %.loc11_13.2: type = converted %float.make_type, %.loc11_13.1 [template = f64]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: f64} [template = constants.%struct_type.a]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %i32 = binding_pattern y
|
||||
// CHECK:STDOUT: %.loc16_1: %i32 = var_pattern %y.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %i32 = var y
|
||||
// CHECK:STDOUT: %.loc16_8: type = splice_block %i32 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -52,8 +74,8 @@ var y: i32 = x.b;
|
||||
// CHECK:STDOUT: %float: f64 = float_literal 4 [template = constants.%float]
|
||||
// CHECK:STDOUT: %.loc11_29.1: %struct_type.a = struct_literal (%float)
|
||||
// CHECK:STDOUT: %.loc11_29.2: init %struct_type.a = struct_init (%float) to file.%x.var [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc11_30: init %struct_type.a = converted %.loc11_29.1, %.loc11_29.2 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_30
|
||||
// CHECK:STDOUT: %.loc11_1: init %struct_type.a = converted %.loc11_29.1, %.loc11_29.2 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_1
|
||||
// CHECK:STDOUT: %x.ref: ref %struct_type.a = name_ref x, file.%x
|
||||
// CHECK:STDOUT: assign file.%y.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
|
||||
@@ -49,9 +49,26 @@ var y: i32 = x.b;
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a.ba9 = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc11_1: %struct_type.a.ba9 = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a.ba9 = var x
|
||||
// CHECK:STDOUT: %.loc11_16: type = splice_block %struct_type.a [template = constants.%struct_type.a.ba9] {
|
||||
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.ba9]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a.ba9 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %i32 = binding_pattern y
|
||||
// CHECK:STDOUT: %.loc16_1: %i32 = var_pattern %y.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %i32 = var y
|
||||
// CHECK:STDOUT: %.loc16_8: type = splice_block %i32.loc16 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -65,8 +82,8 @@ var y: i32 = x.b;
|
||||
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_4, %int.convert_checked [template = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %.loc11_27.3: init %struct_type.a.ba9 = struct_init (%.loc11_27.2) to file.%x.var [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc11_28: init %struct_type.a.ba9 = converted %.loc11_27.1, %.loc11_27.3 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_28
|
||||
// CHECK:STDOUT: %.loc11_1: init %struct_type.a.ba9 = converted %.loc11_27.1, %.loc11_27.3 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_1
|
||||
// CHECK:STDOUT: %x.ref: ref %struct_type.a.ba9 = name_ref x, file.%x
|
||||
// CHECK:STDOUT: assign file.%y.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
|
||||
@@ -38,7 +38,18 @@ var x: {.a: i32, .b: i32} = {.a = 1};
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a.b = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc15_1: %struct_type.a.b = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a.b = var x
|
||||
// CHECK:STDOUT: %.loc15_25: type = splice_block %struct_type.a.b [template = constants.%struct_type.a.b] {
|
||||
// CHECK:STDOUT: %int_32.loc15_13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a.b = bind_name x, %x.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+11
-2
@@ -10,10 +10,10 @@
|
||||
|
||||
// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `type` to `{.a: i32}` [ImplicitAsConversionFailure]
|
||||
// CHECK:STDERR: var x: {.a: i32} = {.a: i32};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_type_assign.carbon:[[@LINE+4]]:1: note: type `type` does not implement interface `Core.ImplicitAs({.a: i32})` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var x: {.a: i32} = {.a: i32};
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var x: {.a: i32} = {.a: i32};
|
||||
|
||||
@@ -40,7 +40,16 @@ var x: {.a: i32} = {.a: i32};
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc18_1: %struct_type.a = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a = var x
|
||||
// CHECK:STDOUT: %.loc18_16: type = splice_block %struct_type.a [template = constants.%struct_type.a] {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a = bind_name x, %x.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+12
-1
@@ -20,6 +20,8 @@ var x: {.a = 1};
|
||||
// CHECK:STDOUT: --- fail_value_as_type.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: Core.IntLiteral} [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -36,7 +38,16 @@ var x: {.a = 1};
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: <error> = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc18_1: <error> = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref <error> = var x
|
||||
// CHECK:STDOUT: %x: ref <error> = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %.1: <error> = splice_block <error> [template = <error>] {
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc18_15.1: %struct_type.a = struct_literal (%int_1)
|
||||
// CHECK:STDOUT: %.loc18_15.2: type = converted %.loc18_15.1, <error> [template = <error>]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: <error> = bind_name x, <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+149
-12
@@ -45,10 +45,10 @@ var c_bad: C({.c = 1, .d = 2}) = F();
|
||||
impl package Implicit;
|
||||
// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+7]]:1: error: cannot implicitly convert from `C({.a = 1, .b = 2})` to `C({.a = 3, .b = 4})` [ImplicitAsConversionFailure]
|
||||
// CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_bad_value.impl.carbon:[[@LINE+4]]:1: note: type `C({.a = 1, .b = 2})` does not implement interface `Core.ImplicitAs(C({.a = 3, .b = 4}))` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
|
||||
@@ -68,6 +68,7 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %Convert.specific_fn.d62: <specific function> = specific_function %Convert.bound.d04, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [template]
|
||||
// CHECK:STDOUT: %struct.92d: %struct_type.a.ba9 = struct_value (%int_0.6a9) [template]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [template]
|
||||
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template]
|
||||
// CHECK:STDOUT: %struct_type.b.c.929: type = struct_type {.b: %i32, .c: %tuple.type.a1c} [template]
|
||||
// CHECK:STDOUT: %struct_type.a.d.3d9: type = struct_type {.a: %struct_type.b.c.929, .d: %i32} [template]
|
||||
@@ -117,9 +118,34 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a_ref.patt: %struct_type.a.ba9 = binding_pattern a_ref
|
||||
// CHECK:STDOUT: %.loc4_1: %struct_type.a.ba9 = var_pattern %a_ref.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a_ref.var: ref %struct_type.a.ba9 = var a_ref
|
||||
// CHECK:STDOUT: %.loc4_20: type = splice_block %struct_type.a [template = constants.%struct_type.a.ba9] {
|
||||
// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a.ba9]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a_ref: ref %struct_type.a.ba9 = bind_name a_ref, %a_ref.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b_ref.patt: %struct_type.a.d.3d9 = binding_pattern b_ref
|
||||
// CHECK:STDOUT: %.loc5_1: %struct_type.a.d.3d9 = var_pattern %b_ref.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b_ref.var: ref %struct_type.a.d.3d9 = var b_ref
|
||||
// CHECK:STDOUT: %.loc5_47: type = splice_block %struct_type.a.d [template = constants.%struct_type.a.d.3d9] {
|
||||
// CHECK:STDOUT: %int_32.loc5_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc5_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_36.1: %tuple.type.85c = tuple_literal (%i32.loc5_32)
|
||||
// CHECK:STDOUT: %.loc5_36.2: type = converted %.loc5_36.1, constants.%tuple.type.a1c [template = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %tuple.type.a1c} [template = constants.%struct_type.b.c.929]
|
||||
// CHECK:STDOUT: %int_32.loc5_44: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_44: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a.d: type = struct_type {.a: %struct_type.b.c.929, .d: %i32} [template = constants.%struct_type.a.d.3d9]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b_ref: ref %struct_type.a.d.3d9 = bind_name b_ref, %b_ref.var
|
||||
// CHECK:STDOUT: %C.decl: %C.type = class_decl @C [template = constants.%C.generic] {
|
||||
// CHECK:STDOUT: %S.patt.loc8_9.1: %struct_type.a.b.501 = symbolic_binding_pattern S, 0 [symbolic = %S.patt.loc8_9.2 (constants.%S.patt)]
|
||||
@@ -187,8 +213,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %int.convert_checked.loc4: init %i32 = call %Convert.specific_fn.loc4(%int_0.loc4) [template = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc4_31.2: init %i32 = converted %int_0.loc4, %int.convert_checked.loc4 [template = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc4_31.3: init %struct_type.a.ba9 = struct_init (%.loc4_31.2) to file.%a_ref.var [template = constants.%struct.92d]
|
||||
// CHECK:STDOUT: %.loc4_32: init %struct_type.a.ba9 = converted %.loc4_31.1, %.loc4_31.3 [template = constants.%struct.92d]
|
||||
// CHECK:STDOUT: assign file.%a_ref.var, %.loc4_32
|
||||
// CHECK:STDOUT: %.loc4_1: init %struct_type.a.ba9 = converted %.loc4_31.1, %.loc4_31.3 [template = constants.%struct.92d]
|
||||
// CHECK:STDOUT: assign file.%a_ref.var, %.loc4_1
|
||||
// CHECK:STDOUT: %int_0.loc6_17: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %int_0.loc6_26: Core.IntLiteral = int_value 0 [template = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc6_28.1: %tuple.type.985 = tuple_literal (%int_0.loc6_26)
|
||||
@@ -222,8 +248,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %.loc6_38.5: ref %i32 = struct_access file.%b_ref.var, element1
|
||||
// CHECK:STDOUT: %.loc6_38.6: init %i32 = initialize_from %.loc6_38.4 to %.loc6_38.5 [template = constants.%int_0.6a9]
|
||||
// CHECK:STDOUT: %.loc6_38.7: init %struct_type.a.d.3d9 = struct_init (%.loc6_38.3, %.loc6_38.6) to file.%b_ref.var [template = constants.%struct.20d]
|
||||
// CHECK:STDOUT: %.loc6_39: init %struct_type.a.d.3d9 = converted %.loc6_38.1, %.loc6_38.7 [template = constants.%struct.20d]
|
||||
// CHECK:STDOUT: assign file.%b_ref.var, %.loc6_39
|
||||
// CHECK:STDOUT: %.loc5: init %struct_type.a.d.3d9 = converted %.loc6_38.1, %.loc6_38.7 [template = constants.%struct.20d]
|
||||
// CHECK:STDOUT: assign file.%b_ref.var, %.loc5
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -243,6 +269,7 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [template]
|
||||
// CHECK:STDOUT: %tuple.type.dd4: type = tuple_type (%i32) [template]
|
||||
// CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %tuple.type.dd4} [template]
|
||||
// CHECK:STDOUT: %struct_type.a.d.9db: type = struct_type {.a: %struct_type.b.c, .d: %i32} [template]
|
||||
@@ -253,7 +280,18 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %struct_type.a.b.5ca: type = struct_type {.a: %i32, .b: %i32} [template]
|
||||
// CHECK:STDOUT: %S: %struct_type.a.b.5ca = bind_symbolic_name S, 0 [symbolic]
|
||||
// CHECK:STDOUT: %S.patt: %struct_type.a.b.5ca = symbolic_binding_pattern S, 0 [symbolic]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
|
||||
// CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template]
|
||||
// CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.847: <witness> = impl_witness (imports.%import_ref.773), @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound.dc5: <bound method> = bound_method %int_1.5b8, %Convert.4cb [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.51b: <specific function> = specific_function %Convert.bound.dc5, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_1.47b: %i32 = int_value 1 [template]
|
||||
// CHECK:STDOUT: %Convert.bound.30f: <bound method> = bound_method %int_2.ecc, %Convert.4cb [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.9b5: <specific function> = specific_function %Convert.bound.30f, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [template]
|
||||
// CHECK:STDOUT: %struct: %struct_type.a.b.5ca = struct_value (%int_1.47b, %int_2.d0d) [template]
|
||||
// CHECK:STDOUT: %C.a8a: type = class_type @C, @C(%struct) [template]
|
||||
@@ -289,11 +327,61 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %Implicit.import = import Implicit
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %a.patt: %struct_type.a = binding_pattern a
|
||||
// CHECK:STDOUT: %.loc4_1: %struct_type.a = var_pattern %a.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %struct_type.a = var a
|
||||
// CHECK:STDOUT: %.loc4_16: type = splice_block %struct_type.a [template = constants.%struct_type.a] {
|
||||
// CHECK:STDOUT: %int_32.loc4: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc4: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %i32} [template = constants.%struct_type.a]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %struct_type.a = bind_name a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %b.patt: %struct_type.a.d.9db = binding_pattern b
|
||||
// CHECK:STDOUT: %.loc5_1: %struct_type.a.d.9db = var_pattern %b.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %struct_type.a.d.9db = var b
|
||||
// CHECK:STDOUT: %.loc5_43: type = splice_block %struct_type.a.d [template = constants.%struct_type.a.d.9db] {
|
||||
// CHECK:STDOUT: %int_32.loc5_18: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_18: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc5_28: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_28: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc5_32.1: %tuple.type.85c = tuple_literal (%i32.loc5_28)
|
||||
// CHECK:STDOUT: %.loc5_32.2: type = converted %.loc5_32.1, constants.%tuple.type.dd4 [template = constants.%tuple.type.dd4]
|
||||
// CHECK:STDOUT: %struct_type.b.c: type = struct_type {.b: %i32, .c: %tuple.type.dd4} [template = constants.%struct_type.b.c]
|
||||
// CHECK:STDOUT: %int_32.loc5_40: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc5_40: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a.d: type = struct_type {.a: %struct_type.b.c, .d: %i32} [template = constants.%struct_type.a.d.9db]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %struct_type.a.d.9db = bind_name b, %b.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %C.a8a = binding_pattern c
|
||||
// CHECK:STDOUT: %.loc6_1: %C.a8a = var_pattern %c.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %C.a8a = var c
|
||||
// CHECK:STDOUT: %.loc6_26.1: type = splice_block %C [template = constants.%C.a8a] {
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.bb9 [template = constants.%C.generic]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc6_25.1: %struct_type.a.b.cfd = struct_literal (%int_1, %int_2)
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_25.1: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
|
||||
// CHECK:STDOUT: %Convert.bound.loc6_25.1: <bound method> = bound_method %int_1, %impl.elem0.loc6_25.1 [template = constants.%Convert.bound.dc5]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc6_25.1: <specific function> = specific_function %Convert.bound.loc6_25.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.51b]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc6_25.1: init %i32 = call %Convert.specific_fn.loc6_25.1(%int_1) [template = constants.%int_1.47b]
|
||||
// CHECK:STDOUT: %.loc6_25.2: %i32 = value_of_initializer %int.convert_checked.loc6_25.1 [template = constants.%int_1.47b]
|
||||
// CHECK:STDOUT: %.loc6_25.3: %i32 = converted %int_1, %.loc6_25.2 [template = constants.%int_1.47b]
|
||||
// CHECK:STDOUT: %impl.elem0.loc6_25.2: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
|
||||
// CHECK:STDOUT: %Convert.bound.loc6_25.2: <bound method> = bound_method %int_2, %impl.elem0.loc6_25.2 [template = constants.%Convert.bound.30f]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc6_25.2: <specific function> = specific_function %Convert.bound.loc6_25.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.9b5]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc6_25.2: init %i32 = call %Convert.specific_fn.loc6_25.2(%int_2) [template = constants.%int_2.d0d]
|
||||
// CHECK:STDOUT: %.loc6_25.4: %i32 = value_of_initializer %int.convert_checked.loc6_25.2 [template = constants.%int_2.d0d]
|
||||
// CHECK:STDOUT: %.loc6_25.5: %i32 = converted %int_2, %.loc6_25.4 [template = constants.%int_2.d0d]
|
||||
// CHECK:STDOUT: %struct: %struct_type.a.b.5ca = struct_value (%.loc6_25.3, %.loc6_25.5) [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc6_26.2: %struct_type.a.b.5ca = converted %.loc6_25.1, %struct [template = constants.%struct]
|
||||
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%struct) [template = constants.%C.a8a]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: ref %C.a8a = bind_name c, %c.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -316,8 +404,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %.loc4_20.1: ref %i32 = struct_access %a_ref.ref, element0
|
||||
// CHECK:STDOUT: %.loc4_20.2: %i32 = bind_value %.loc4_20.1
|
||||
// CHECK:STDOUT: %.loc4_20.3: init %struct_type.a = struct_init (%.loc4_20.2) to file.%a.var
|
||||
// CHECK:STDOUT: %.loc4_25: init %struct_type.a = converted %a_ref.ref, %.loc4_20.3
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc4_25
|
||||
// CHECK:STDOUT: %.loc4_1: init %struct_type.a = converted %a_ref.ref, %.loc4_20.3
|
||||
// CHECK:STDOUT: assign file.%a.var, %.loc4_1
|
||||
// CHECK:STDOUT: %b_ref.ref: ref %struct_type.a.d.9db = name_ref b_ref, imports.%import_ref.1d0
|
||||
// CHECK:STDOUT: %.loc5_47.1: ref %struct_type.b.c = struct_access %b_ref.ref, element0
|
||||
// CHECK:STDOUT: %.loc5_47.2: ref %i32 = struct_access %.loc5_47.1, element0
|
||||
@@ -339,8 +427,8 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %.loc5_47.17: ref %i32 = struct_access file.%b.var, element1
|
||||
// CHECK:STDOUT: %.loc5_47.18: init %i32 = initialize_from %.loc5_47.16 to %.loc5_47.17
|
||||
// CHECK:STDOUT: %.loc5_47.19: init %struct_type.a.d.9db = struct_init (%.loc5_47.14, %.loc5_47.18) to file.%b.var
|
||||
// CHECK:STDOUT: %.loc5_52: init %struct_type.a.d.9db = converted %b_ref.ref, %.loc5_47.19
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc5_52
|
||||
// CHECK:STDOUT: %.loc5_1: init %struct_type.a.d.9db = converted %b_ref.ref, %.loc5_47.19
|
||||
// CHECK:STDOUT: assign file.%b.var, %.loc5_1
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.b37 [template = constants.%F]
|
||||
// CHECK:STDOUT: %.loc6: ref %C.a8a = splice_block file.%c.var {}
|
||||
// CHECK:STDOUT: %F.call: init %C.a8a = call %F.ref() to %.loc6
|
||||
@@ -372,6 +460,9 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: %i32} [template]
|
||||
// CHECK:STDOUT: %S: %struct_type.a.b = bind_symbolic_name S, 0 [symbolic]
|
||||
// CHECK:STDOUT: %S.patt: %struct_type.a.b = symbolic_binding_pattern S, 0 [symbolic]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
|
||||
// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [template]
|
||||
// CHECK:STDOUT: %struct_type.c.d: type = struct_type {.c: Core.IntLiteral, .d: Core.IntLiteral} [template]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [template]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_2.d0d: %i32 = int_value 2 [template]
|
||||
@@ -404,8 +495,18 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %Implicit.import = import Implicit
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c_bad.patt: <error> = binding_pattern c_bad
|
||||
// CHECK:STDOUT: %.loc11_1: <error> = var_pattern %c_bad.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c_bad.var: ref <error> = var c_bad
|
||||
// CHECK:STDOUT: %c_bad: ref <error> = bind_name c_bad, %c_bad.var
|
||||
// CHECK:STDOUT: %.1: <error> = splice_block <error> [template = <error>] {
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.bb9 [template = constants.%C.generic]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc11_29: %struct_type.c.d = struct_literal (%int_1, %int_2)
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c_bad: <error> = bind_name c_bad, <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic class @C(constants.%S: %struct_type.a.b) [from "implicit.carbon"] {
|
||||
@@ -454,7 +555,18 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %struct_type.a.b.5ca: type = struct_type {.a: %i32, .b: %i32} [template]
|
||||
// CHECK:STDOUT: %S: %struct_type.a.b.5ca = bind_symbolic_name S, 0 [symbolic]
|
||||
// CHECK:STDOUT: %S.patt: %struct_type.a.b.5ca = symbolic_binding_pattern S, 0 [symbolic]
|
||||
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [template]
|
||||
// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [template]
|
||||
// CHECK:STDOUT: %struct_type.a.b.cfd: type = struct_type {.a: Core.IntLiteral, .b: Core.IntLiteral} [template]
|
||||
// CHECK:STDOUT: %Convert.type.ea0: type = fn_type @Convert.1, @ImplicitAs(%i32) [template]
|
||||
// CHECK:STDOUT: %impl_witness.847: <witness> = impl_witness (imports.%import_ref.773), @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.type.e14: type = fn_type @Convert.2, @impl.1(%int_32) [template]
|
||||
// CHECK:STDOUT: %Convert.4cb: %Convert.type.e14 = struct_value () [template]
|
||||
// CHECK:STDOUT: %Convert.bound.a00: <bound method> = bound_method %int_3.1ba, %Convert.4cb [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.dec: <specific function> = specific_function %Convert.bound.a00, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_3.d47: %i32 = int_value 3 [template]
|
||||
// CHECK:STDOUT: %Convert.bound.694: <bound method> = bound_method %int_4.0c1, %Convert.4cb [template]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.739: <specific function> = specific_function %Convert.bound.694, @Convert.2(%int_32) [template]
|
||||
// CHECK:STDOUT: %int_4.ea3: %i32 = int_value 4 [template]
|
||||
// CHECK:STDOUT: %struct.8e6: %struct_type.a.b.5ca = struct_value (%int_3.d47, %int_4.ea3) [template]
|
||||
// CHECK:STDOUT: %C.5a7: type = class_type @C, @C(%struct.8e6) [template]
|
||||
@@ -491,7 +603,32 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %Implicit.import = import Implicit
|
||||
// CHECK:STDOUT: %default.import = import <invalid>
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c_bad.patt: %C.5a7 = binding_pattern c_bad
|
||||
// CHECK:STDOUT: %.loc10_1: %C.5a7 = var_pattern %c_bad.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c_bad.var: ref %C.5a7 = var c_bad
|
||||
// CHECK:STDOUT: %.loc10_30.1: type = splice_block %C [template = constants.%C.5a7] {
|
||||
// CHECK:STDOUT: %C.ref: %C.type = name_ref C, imports.%import_ref.bb9 [template = constants.%C.generic]
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [template = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [template = constants.%int_4.0c1]
|
||||
// CHECK:STDOUT: %.loc10_29.1: %struct_type.a.b.cfd = struct_literal (%int_3, %int_4)
|
||||
// CHECK:STDOUT: %impl.elem0.loc10_29.1: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
|
||||
// CHECK:STDOUT: %Convert.bound.loc10_29.1: <bound method> = bound_method %int_3, %impl.elem0.loc10_29.1 [template = constants.%Convert.bound.a00]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc10_29.1: <specific function> = specific_function %Convert.bound.loc10_29.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.dec]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc10_29.1: init %i32 = call %Convert.specific_fn.loc10_29.1(%int_3) [template = constants.%int_3.d47]
|
||||
// CHECK:STDOUT: %.loc10_29.2: %i32 = value_of_initializer %int.convert_checked.loc10_29.1 [template = constants.%int_3.d47]
|
||||
// CHECK:STDOUT: %.loc10_29.3: %i32 = converted %int_3, %.loc10_29.2 [template = constants.%int_3.d47]
|
||||
// CHECK:STDOUT: %impl.elem0.loc10_29.2: %Convert.type.ea0 = impl_witness_access constants.%impl_witness.847, element0 [template = constants.%Convert.4cb]
|
||||
// CHECK:STDOUT: %Convert.bound.loc10_29.2: <bound method> = bound_method %int_4, %impl.elem0.loc10_29.2 [template = constants.%Convert.bound.694]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc10_29.2: <specific function> = specific_function %Convert.bound.loc10_29.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.739]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc10_29.2: init %i32 = call %Convert.specific_fn.loc10_29.2(%int_4) [template = constants.%int_4.ea3]
|
||||
// CHECK:STDOUT: %.loc10_29.4: %i32 = value_of_initializer %int.convert_checked.loc10_29.2 [template = constants.%int_4.ea3]
|
||||
// CHECK:STDOUT: %.loc10_29.5: %i32 = converted %int_4, %.loc10_29.4 [template = constants.%int_4.ea3]
|
||||
// CHECK:STDOUT: %struct: %struct_type.a.b.5ca = struct_value (%.loc10_29.3, %.loc10_29.5) [template = constants.%struct.8e6]
|
||||
// CHECK:STDOUT: %.loc10_30.2: %struct_type.a.b.5ca = converted %.loc10_29.1, %struct [template = constants.%struct.8e6]
|
||||
// CHECK:STDOUT: %C: type = class_type @C, @C(constants.%struct.8e6) [template = constants.%C.5a7]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c_bad: ref %C.5a7 = bind_name c_bad, %c_bad.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -513,7 +650,7 @@ var c_bad: C({.a = 3, .b = 4}) = F();
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, imports.%import_ref.b37 [template = constants.%F]
|
||||
// CHECK:STDOUT: %.loc10_36: ref %C.a8a = temporary_storage
|
||||
// CHECK:STDOUT: %F.call: init %C.a8a = call %F.ref() to %.loc10_36
|
||||
// CHECK:STDOUT: %.loc10_37: %C.5a7 = converted %F.call, <error> [template = <error>]
|
||||
// CHECK:STDOUT: %.loc10_1: %C.5a7 = converted %F.call, <error> [template = <error>]
|
||||
// CHECK:STDOUT: assign file.%c_bad.var, <error>
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
+34
-2
@@ -15,6 +15,9 @@ var z: i32 = y;
|
||||
// CHECK:STDOUT: --- member_access.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template]
|
||||
// CHECK:STDOUT: %Float.type: type = fn_type @Float [template]
|
||||
// CHECK:STDOUT: %Float: %Float.type = struct_value () [template]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
|
||||
// CHECK:STDOUT: %struct_type.a.b.ddf: type = struct_type {.a: f64, .b: %i32} [template]
|
||||
@@ -49,11 +52,40 @@ var z: i32 = y;
|
||||
// CHECK:STDOUT: .z = %z
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a.b.ddf = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc11_1: %struct_type.a.b.ddf = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a.b.ddf = var x
|
||||
// CHECK:STDOUT: %.loc11_25: type = splice_block %struct_type.a.b [template = constants.%struct_type.a.b.ddf] {
|
||||
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64]
|
||||
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64]
|
||||
// CHECK:STDOUT: %.loc11_13.1: type = value_of_initializer %float.make_type [template = f64]
|
||||
// CHECK:STDOUT: %.loc11_13.2: type = converted %float.make_type, %.loc11_13.1 [template = f64]
|
||||
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: f64, .b: %i32} [template = constants.%struct_type.a.b.ddf]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a.b.ddf = bind_name x, %x.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %i32 = binding_pattern y
|
||||
// CHECK:STDOUT: %.loc12_1: %i32 = var_pattern %y.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %i32 = var y
|
||||
// CHECK:STDOUT: %.loc12_8: type = splice_block %i32.loc12 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %i32 = bind_name y, %y.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %z.patt: %i32 = binding_pattern z
|
||||
// CHECK:STDOUT: %.loc13_1: %i32 = var_pattern %z.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %z.var: ref %i32 = var z
|
||||
// CHECK:STDOUT: %.loc13_8: type = splice_block %i32.loc13 [template = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %z: ref %i32 = bind_name z, %z.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -72,8 +104,8 @@ var z: i32 = y;
|
||||
// CHECK:STDOUT: %.loc11_46.5: ref %i32 = struct_access file.%x.var, element1
|
||||
// CHECK:STDOUT: %.loc11_46.6: init %i32 = initialize_from %.loc11_46.4 to %.loc11_46.5 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc11_46.7: init %struct_type.a.b.ddf = struct_init (%.loc11_46.3, %.loc11_46.6) to file.%x.var [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc11_47: init %struct_type.a.b.ddf = converted %.loc11_46.1, %.loc11_46.7 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_47
|
||||
// CHECK:STDOUT: %.loc11_1: init %struct_type.a.b.ddf = converted %.loc11_46.1, %.loc11_46.7 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_1
|
||||
// CHECK:STDOUT: %x.ref: ref %struct_type.a.b.ddf = name_ref x, file.%x
|
||||
// CHECK:STDOUT: %.loc12_15.1: ref %i32 = struct_access %x.ref, element1
|
||||
// CHECK:STDOUT: %.loc12_15.2: %i32 = bind_value %.loc12_15.1
|
||||
|
||||
@@ -65,8 +65,11 @@ fn G() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %struct_type.a.b.2f9 = binding_pattern v
|
||||
// CHECK:STDOUT: %.loc14_3.1: %struct_type.a.b.2f9 = var_pattern %v.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref %struct_type.a.b.2f9 = var v
|
||||
// CHECK:STDOUT: %v: ref %struct_type.a.b.2f9 = bind_name v, %v.var
|
||||
// CHECK:STDOUT: %F.ref.loc14_61: %F.type = name_ref F, file.%F.decl [template = constants.%F]
|
||||
// CHECK:STDOUT: %.loc14_74.1: ref %tuple.type.189 = struct_access %v.var, element0
|
||||
// CHECK:STDOUT: %F.call.loc14_63: init %tuple.type.189 = call %F.ref.loc14_61() to %.loc14_74.1
|
||||
@@ -75,8 +78,28 @@ fn G() {
|
||||
// CHECK:STDOUT: %F.call.loc14_73: init %tuple.type.189 = call %F.ref.loc14_71() to %.loc14_74.2
|
||||
// CHECK:STDOUT: %.loc14_74.3: %struct_type.a.b.2f9 = struct_literal (%F.call.loc14_63, %F.call.loc14_73)
|
||||
// CHECK:STDOUT: %.loc14_74.4: init %struct_type.a.b.2f9 = struct_init (%F.call.loc14_63, %F.call.loc14_73) to %v.var
|
||||
// CHECK:STDOUT: %.loc14_75: init %struct_type.a.b.2f9 = converted %.loc14_74.3, %.loc14_74.4
|
||||
// CHECK:STDOUT: assign %v.var, %.loc14_75
|
||||
// CHECK:STDOUT: %.loc14_3.2: init %struct_type.a.b.2f9 = converted %.loc14_74.3, %.loc14_74.4
|
||||
// CHECK:STDOUT: assign %v.var, %.loc14_3.2
|
||||
// CHECK:STDOUT: %.loc14_51: type = splice_block %struct_type.a.b [template = constants.%struct_type.a.b.2f9] {
|
||||
// CHECK:STDOUT: %int_32.loc14_16: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_21: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_21: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_26: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_26: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc14_29.1: %tuple.type.ff9 = tuple_literal (%i32.loc14_16, %i32.loc14_21, %i32.loc14_26)
|
||||
// CHECK:STDOUT: %.loc14_29.2: type = converted %.loc14_29.1, constants.%tuple.type.189 [template = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %int_32.loc14_37: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_37: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_42: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_42: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_47: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_47: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc14_50.1: %tuple.type.ff9 = tuple_literal (%i32.loc14_37, %i32.loc14_42, %i32.loc14_47)
|
||||
// CHECK:STDOUT: %.loc14_50.2: type = converted %.loc14_50.1, constants.%tuple.type.189 [template = constants.%tuple.type.189]
|
||||
// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %tuple.type.189, .b: %tuple.type.189} [template = constants.%struct_type.a.b.2f9]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref %struct_type.a.b.2f9 = bind_name v, %v.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+20
-4
@@ -23,9 +23,25 @@ var y: {} = x;
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %empty_struct_type = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc11_1: %empty_struct_type = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %empty_struct_type = var x
|
||||
// CHECK:STDOUT: %.loc11_9.1: type = splice_block %.loc11_9.3 [template = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc11_9.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc11_9.3: type = converted %.loc11_9.2, constants.%empty_struct_type [template = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %empty_struct_type = bind_name x, %x.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %empty_struct_type = binding_pattern y
|
||||
// CHECK:STDOUT: %.loc12_1: %empty_struct_type = var_pattern %y.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %empty_struct_type = var y
|
||||
// CHECK:STDOUT: %.loc12_9.1: type = splice_block %.loc12_9.3 [template = constants.%empty_struct_type] {
|
||||
// CHECK:STDOUT: %.loc12_9.2: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc12_9.3: type = converted %.loc12_9.2, constants.%empty_struct_type [template = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %empty_struct_type = bind_name y, %y.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -33,12 +49,12 @@ var y: {} = x;
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %.loc11_14.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc11_14.2: init %empty_struct_type = struct_init () to file.%x.var [template = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc11_15: init %empty_struct_type = converted %.loc11_14.1, %.loc11_14.2 [template = constants.%empty_struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_15
|
||||
// CHECK:STDOUT: %.loc11_1: init %empty_struct_type = converted %.loc11_14.1, %.loc11_14.2 [template = constants.%empty_struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_1
|
||||
// CHECK:STDOUT: %x.ref: ref %empty_struct_type = name_ref x, file.%x
|
||||
// CHECK:STDOUT: %.loc12_13: init %empty_struct_type = struct_init () to file.%y.var [template = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %.loc12_14: init %empty_struct_type = converted %x.ref, %.loc12_13 [template = constants.%empty_struct]
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc12_14
|
||||
// CHECK:STDOUT: %.loc12_1: init %empty_struct_type = converted %x.ref, %.loc12_13 [template = constants.%empty_struct]
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc12_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -26,7 +26,16 @@ var x: {.a: {}} = {.b = {}};
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a.225 = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc15_1: %struct_type.a.225 = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a.225 = var x
|
||||
// CHECK:STDOUT: %.loc15_15: type = splice_block %struct_type.a [template = constants.%struct_type.a.225] {
|
||||
// CHECK:STDOUT: %.loc15_14.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc15_14.2: type = converted %.loc15_14.1, constants.%empty_struct_type [template = constants.%empty_struct_type]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_struct_type} [template = constants.%struct_type.a.225]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a.225 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -25,6 +25,7 @@ var p: Incomplete* = &s.a;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %Incomplete: type = class_type @Incomplete [template]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %Incomplete} [template]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [template]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -35,9 +36,25 @@ var p: Incomplete* = &s.a;
|
||||
// CHECK:STDOUT: .p = %p
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Incomplete.decl: type = class_decl @Incomplete [template = constants.%Incomplete] {} {}
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %s.patt: <error> = binding_pattern s
|
||||
// CHECK:STDOUT: %.loc20_1: <error> = var_pattern %s.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %s.var: ref <error> = var s
|
||||
// CHECK:STDOUT: %s: ref <error> = bind_name s, %s.var
|
||||
// CHECK:STDOUT: %.loc20_23: type = splice_block %struct_type.a [template = constants.%struct_type.a] {
|
||||
// CHECK:STDOUT: %Incomplete.ref.loc20: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete]
|
||||
// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %Incomplete} [template = constants.%struct_type.a]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %s: <error> = bind_name s, <error>
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %p.patt: %ptr = binding_pattern p
|
||||
// CHECK:STDOUT: %.loc22_1: %ptr = var_pattern %p.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p.var: ref %ptr = var p
|
||||
// CHECK:STDOUT: %.loc22_18: type = splice_block %ptr [template = constants.%ptr] {
|
||||
// CHECK:STDOUT: %Incomplete.ref.loc22: type = name_ref Incomplete, %Incomplete.decl [template = constants.%Incomplete]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Incomplete [template = constants.%ptr]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p: ref %ptr = bind_name p, %p.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -45,7 +62,7 @@ var p: Incomplete* = &s.a;
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @__global_init() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %s.ref: ref <error> = name_ref s, file.%s
|
||||
// CHECK:STDOUT: %s.ref: <error> = name_ref s, file.%s
|
||||
// CHECK:STDOUT: %a.ref: <error> = name_ref a, <error> [template = <error>]
|
||||
// CHECK:STDOUT: %addr: <error> = addr_of %a.ref [template = <error>]
|
||||
// CHECK:STDOUT: assign file.%p.var, <error>
|
||||
|
||||
+22
-4
@@ -45,9 +45,27 @@ var y: {.a: i32} = x;
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a.ba9 = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc11_1: %struct_type.a.ba9 = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a.ba9 = var x
|
||||
// CHECK:STDOUT: %.loc11_16: type = splice_block %struct_type.a.loc11 [template = constants.%struct_type.a.ba9] {
|
||||
// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a.loc11: type = struct_type {.a: %i32} [template = constants.%struct_type.a.ba9]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a.ba9 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %struct_type.a.ba9 = binding_pattern y
|
||||
// CHECK:STDOUT: %.loc12_1: %struct_type.a.ba9 = var_pattern %y.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %struct_type.a.ba9 = var y
|
||||
// CHECK:STDOUT: %.loc12_16: type = splice_block %struct_type.a.loc12 [template = constants.%struct_type.a.ba9] {
|
||||
// CHECK:STDOUT: %int_32.loc12: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a.loc12: type = struct_type {.a: %i32} [template = constants.%struct_type.a.ba9]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %struct_type.a.ba9 = bind_name y, %y.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -61,14 +79,14 @@ var y: {.a: i32} = x;
|
||||
// CHECK:STDOUT: %int.convert_checked: init %i32 = call %Convert.specific_fn(%int_4) [template = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %.loc11_27.2: init %i32 = converted %int_4, %int.convert_checked [template = constants.%int_4.940]
|
||||
// CHECK:STDOUT: %.loc11_27.3: init %struct_type.a.ba9 = struct_init (%.loc11_27.2) to file.%x.var [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc11_28: init %struct_type.a.ba9 = converted %.loc11_27.1, %.loc11_27.3 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_28
|
||||
// CHECK:STDOUT: %.loc11_1: init %struct_type.a.ba9 = converted %.loc11_27.1, %.loc11_27.3 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_1
|
||||
// CHECK:STDOUT: %x.ref: ref %struct_type.a.ba9 = name_ref x, file.%x
|
||||
// CHECK:STDOUT: %.loc12_20.1: ref %i32 = struct_access %x.ref, element0
|
||||
// CHECK:STDOUT: %.loc12_20.2: %i32 = bind_value %.loc12_20.1
|
||||
// CHECK:STDOUT: %.loc12_20.3: init %struct_type.a.ba9 = struct_init (%.loc12_20.2) to file.%y.var
|
||||
// CHECK:STDOUT: %.loc12_21: init %struct_type.a.ba9 = converted %x.ref, %.loc12_20.3
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc12_21
|
||||
// CHECK:STDOUT: %.loc12_1: init %struct_type.a.ba9 = converted %x.ref, %.loc12_20.3
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc12_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+35
-11
@@ -76,13 +76,13 @@ fn F() -> {.a: i32, .b: f64} {
|
||||
// CHECK:STDOUT: %return.patt: %struct_type.a.b = return_slot_pattern
|
||||
// CHECK:STDOUT: %return.param_patt: %struct_type.a.b = out_param_pattern %return.patt, runtime_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_64: Core.IntLiteral = int_value 64 [template = constants.%int_64]
|
||||
// CHECK:STDOUT: %float.make_type: init type = call constants.%Float(%int_64) [template = f64]
|
||||
// CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %float.make_type [template = f64]
|
||||
// CHECK:STDOUT: %.loc14_25.2: type = converted %float.make_type, %.loc14_25.1 [template = f64]
|
||||
// CHECK:STDOUT: %struct_type.a.b: type = struct_type {.a: %i32, .b: f64} [template = constants.%struct_type.a.b]
|
||||
// CHECK:STDOUT: %int_32.loc14: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_64.loc14: Core.IntLiteral = int_value 64 [template = constants.%int_64]
|
||||
// CHECK:STDOUT: %float.make_type.loc14: init type = call constants.%Float(%int_64.loc14) [template = f64]
|
||||
// CHECK:STDOUT: %.loc14_25.1: type = value_of_initializer %float.make_type.loc14 [template = f64]
|
||||
// CHECK:STDOUT: %.loc14_25.2: type = converted %float.make_type.loc14, %.loc14_25.1 [template = f64]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc14: type = struct_type {.a: %i32, .b: f64} [template = constants.%struct_type.a.b]
|
||||
// CHECK:STDOUT: %return.param: ref %struct_type.a.b = out_param runtime_param0
|
||||
// CHECK:STDOUT: %return: ref %struct_type.a.b = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
@@ -94,24 +94,48 @@ fn F() -> {.a: i32, .b: f64} {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() -> %return.param_patt: %struct_type.a.b {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a.b = binding_pattern x
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %MakeF64.ref: %MakeF64.type = name_ref MakeF64, file.%MakeF64.decl [template = constants.%MakeF64]
|
||||
// CHECK:STDOUT: %MakeF64.call: init f64 = call %MakeF64.ref()
|
||||
// CHECK:STDOUT: %MakeI32.ref: %MakeI32.type = name_ref MakeI32, file.%MakeI32.decl [template = constants.%MakeI32]
|
||||
// CHECK:STDOUT: %MakeI32.call: init %i32 = call %MakeI32.ref()
|
||||
// CHECK:STDOUT: %.loc15_62.1: %struct_type.b.a = struct_literal (%MakeF64.call, %MakeI32.call)
|
||||
// CHECK:STDOUT: %.loc15_27: type = splice_block %struct_type.a.b.loc15 [template = constants.%struct_type.a.b] {
|
||||
// CHECK:STDOUT: %int_32.loc15: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_64.loc15: Core.IntLiteral = int_value 64 [template = constants.%int_64]
|
||||
// CHECK:STDOUT: %float.make_type.loc15: init type = call constants.%Float(%int_64.loc15) [template = f64]
|
||||
// CHECK:STDOUT: %.loc15_24.1: type = value_of_initializer %float.make_type.loc15 [template = f64]
|
||||
// CHECK:STDOUT: %.loc15_24.2: type = converted %float.make_type.loc15, %.loc15_24.1 [template = f64]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc15: type = struct_type {.a: %i32, .b: f64} [template = constants.%struct_type.a.b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc15_62.2: %i32 = value_of_initializer %MakeI32.call
|
||||
// CHECK:STDOUT: %.loc15_62.3: %i32 = converted %MakeI32.call, %.loc15_62.2
|
||||
// CHECK:STDOUT: %.loc15_62.4: f64 = value_of_initializer %MakeF64.call
|
||||
// CHECK:STDOUT: %.loc15_62.5: f64 = converted %MakeF64.call, %.loc15_62.4
|
||||
// CHECK:STDOUT: %struct.loc15: %struct_type.a.b = struct_value (%.loc15_62.3, %.loc15_62.5)
|
||||
// CHECK:STDOUT: %.loc15_63: %struct_type.a.b = converted %.loc15_62.1, %struct.loc15
|
||||
// CHECK:STDOUT: %x: %struct_type.a.b = bind_name x, %.loc15_63
|
||||
// CHECK:STDOUT: %.loc15_62.6: %struct_type.a.b = converted %.loc15_62.1, %struct.loc15
|
||||
// CHECK:STDOUT: %x: %struct_type.a.b = bind_name x, %.loc15_62.6
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %struct_type.b.a = binding_pattern y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.ref: %struct_type.a.b = name_ref x, %x
|
||||
// CHECK:STDOUT: %.loc16_27: type = splice_block %struct_type.b.a [template = constants.%struct_type.b.a] {
|
||||
// CHECK:STDOUT: %int_64.loc16: Core.IntLiteral = int_value 64 [template = constants.%int_64]
|
||||
// CHECK:STDOUT: %float.make_type.loc16: init type = call constants.%Float(%int_64.loc16) [template = f64]
|
||||
// CHECK:STDOUT: %.loc16_15.1: type = value_of_initializer %float.make_type.loc16 [template = f64]
|
||||
// CHECK:STDOUT: %.loc16_15.2: type = converted %float.make_type.loc16, %.loc16_15.1 [template = f64]
|
||||
// CHECK:STDOUT: %int_32.loc16: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc16: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.b.a: type = struct_type {.b: f64, .a: %i32} [template = constants.%struct_type.b.a]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc16_31.1: f64 = struct_access %x.ref, element1
|
||||
// CHECK:STDOUT: %.loc16_31.2: %i32 = struct_access %x.ref, element0
|
||||
// CHECK:STDOUT: %struct.loc16: %struct_type.b.a = struct_value (%.loc16_31.1, %.loc16_31.2)
|
||||
// CHECK:STDOUT: %.loc16_32: %struct_type.b.a = converted %x.ref, %struct.loc16
|
||||
// CHECK:STDOUT: %y: %struct_type.b.a = bind_name y, %.loc16_32
|
||||
// CHECK:STDOUT: %.loc16_31.3: %struct_type.b.a = converted %x.ref, %struct.loc16
|
||||
// CHECK:STDOUT: %y: %struct_type.b.a = bind_name y, %.loc16_31.3
|
||||
// CHECK:STDOUT: %y.ref: %struct_type.b.a = name_ref y, %y
|
||||
// CHECK:STDOUT: %.loc17_10.1: %i32 = struct_access %y.ref, element1
|
||||
// CHECK:STDOUT: %.loc17_10.2: ref %i32 = struct_access %return, element1
|
||||
|
||||
+31
-4
@@ -16,6 +16,7 @@ var y: {.a: i32, .b: (i32,)} = x;
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [template]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [template]
|
||||
// CHECK:STDOUT: %tuple.type.85c: type = tuple_type (type) [template]
|
||||
// CHECK:STDOUT: %tuple.type.a1c: type = tuple_type (%i32) [template]
|
||||
// CHECK:STDOUT: %struct_type.a.b.3d5: type = struct_type {.a: %i32, .b: %tuple.type.a1c} [template]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [template]
|
||||
@@ -52,9 +53,35 @@ var y: {.a: i32, .b: (i32,)} = x;
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a.b.3d5 = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc11_1: %struct_type.a.b.3d5 = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a.b.3d5 = var x
|
||||
// CHECK:STDOUT: %.loc11_28: type = splice_block %struct_type.a.b.loc11 [template = constants.%struct_type.a.b.3d5] {
|
||||
// CHECK:STDOUT: %int_32.loc11_13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_23: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc11_27.1: %tuple.type.85c = tuple_literal (%i32.loc11_23)
|
||||
// CHECK:STDOUT: %.loc11_27.2: type = converted %.loc11_27.1, constants.%tuple.type.a1c [template = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc11: type = struct_type {.a: %i32, .b: %tuple.type.a1c} [template = constants.%struct_type.a.b.3d5]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a.b.3d5 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %struct_type.a.b.3d5 = binding_pattern y
|
||||
// CHECK:STDOUT: %.loc12_1: %struct_type.a.b.3d5 = var_pattern %y.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %struct_type.a.b.3d5 = var y
|
||||
// CHECK:STDOUT: %.loc12_28: type = splice_block %struct_type.a.b.loc12 [template = constants.%struct_type.a.b.3d5] {
|
||||
// CHECK:STDOUT: %int_32.loc12_13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc12_23: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12_23: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc12_27.1: %tuple.type.85c = tuple_literal (%i32.loc12_23)
|
||||
// CHECK:STDOUT: %.loc12_27.2: type = converted %.loc12_27.1, constants.%tuple.type.a1c [template = constants.%tuple.type.a1c]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc12: type = struct_type {.a: %i32, .b: %tuple.type.a1c} [template = constants.%struct_type.a.b.3d5]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %struct_type.a.b.3d5 = bind_name y, %y.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -81,8 +108,8 @@ var y: {.a: i32, .b: (i32,)} = x;
|
||||
// CHECK:STDOUT: %.loc11_50.6: init %tuple.type.a1c = converted %.loc11_49.1, %.loc11_49.3 [template = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_50.7: init %tuple.type.a1c = initialize_from %.loc11_50.6 to %.loc11_50.5 [template = constants.%tuple]
|
||||
// CHECK:STDOUT: %.loc11_50.8: init %struct_type.a.b.3d5 = struct_init (%.loc11_50.4, %.loc11_50.7) to file.%x.var [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc11_51: init %struct_type.a.b.3d5 = converted %.loc11_50.1, %.loc11_50.8 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_51
|
||||
// CHECK:STDOUT: %.loc11_1: init %struct_type.a.b.3d5 = converted %.loc11_50.1, %.loc11_50.8 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc11_1
|
||||
// CHECK:STDOUT: %x.ref: ref %struct_type.a.b.3d5 = name_ref x, file.%x
|
||||
// CHECK:STDOUT: %.loc12_32.1: ref %i32 = struct_access %x.ref, element0
|
||||
// CHECK:STDOUT: %.loc12_32.2: %i32 = bind_value %.loc12_32.1
|
||||
@@ -96,8 +123,8 @@ var y: {.a: i32, .b: (i32,)} = x;
|
||||
// CHECK:STDOUT: %.loc12_32.9: init %tuple.type.a1c = converted %.loc12_32.5, %.loc12_32.8
|
||||
// CHECK:STDOUT: %.loc12_32.10: init %tuple.type.a1c = initialize_from %.loc12_32.9 to %.loc12_32.7
|
||||
// CHECK:STDOUT: %.loc12_32.11: init %struct_type.a.b.3d5 = struct_init (%.loc12_32.4, %.loc12_32.10) to file.%y.var
|
||||
// CHECK:STDOUT: %.loc12_33: init %struct_type.a.b.3d5 = converted %x.ref, %.loc12_32.11
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc12_33
|
||||
// CHECK:STDOUT: %.loc12_1: init %struct_type.a.b.3d5 = converted %x.ref, %.loc12_32.11
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc12_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+66
-24
@@ -48,15 +48,73 @@ var y: {.a: i32, .b: i32} = x;
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [template] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .v = @__global_init.%v
|
||||
// CHECK:STDOUT: .w = @__global_init.%w
|
||||
// CHECK:STDOUT: .v = %v
|
||||
// CHECK:STDOUT: .w = %w
|
||||
// CHECK:STDOUT: .x = %x
|
||||
// CHECK:STDOUT: .y = %y
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %v.patt: %struct_type.a.b.501 = binding_pattern v
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc11_25: type = splice_block %struct_type.a.b.loc11 [template = constants.%struct_type.a.b.501] {
|
||||
// CHECK:STDOUT: %int_32.loc11_13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc11_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc11_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc11: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.501]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_44.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc11_44.1: <bound method> = bound_method @__global_init.%int_1.loc11, %impl.elem0.loc11_44.1 [template = constants.%Convert.bound.ab5]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc11_44.1: <specific function> = specific_function %Convert.bound.loc11_44.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_44.1: init %i32 = call %Convert.specific_fn.loc11_44.1(@__global_init.%int_1.loc11) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc11_44.1: %i32 = value_of_initializer %int.convert_checked.loc11_44.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc11_44.2: %i32 = converted @__global_init.%int_1.loc11, %.loc11_44.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_44.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc11_44.2: <bound method> = bound_method @__global_init.%int_2.loc11, %impl.elem0.loc11_44.2 [template = constants.%Convert.bound.ef9]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc11_44.2: <specific function> = specific_function %Convert.bound.loc11_44.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_44.2: init %i32 = call %Convert.specific_fn.loc11_44.2(@__global_init.%int_2.loc11) [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc11_44.3: %i32 = value_of_initializer %int.convert_checked.loc11_44.2 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc11_44.4: %i32 = converted @__global_init.%int_2.loc11, %.loc11_44.3 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%.loc11_44.2, %.loc11_44.4) [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc11_44.5: %struct_type.a.b.501 = converted @__global_init.%.loc11, %struct [template = constants.%struct]
|
||||
// CHECK:STDOUT: %v: %struct_type.a.b.501 = bind_name v, %.loc11_44.5
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %w.patt: %struct_type.a.b.501 = binding_pattern w
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %.loc12: type = splice_block %struct_type.a.b.loc12 [template = constants.%struct_type.a.b.501] {
|
||||
// CHECK:STDOUT: %int_32.loc12_13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc12_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc12_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc12: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.501]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %w: %struct_type.a.b.501 = bind_name w, @__global_init.%v.ref
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: %struct_type.a.b.501 = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc14_1: %struct_type.a.b.501 = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref %struct_type.a.b.501 = var x
|
||||
// CHECK:STDOUT: %.loc14_25: type = splice_block %struct_type.a.b.loc14 [template = constants.%struct_type.a.b.501] {
|
||||
// CHECK:STDOUT: %int_32.loc14_13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc14_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc14_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc14: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.501]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref %struct_type.a.b.501 = bind_name x, %x.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %y.patt: %struct_type.a.b.501 = binding_pattern y
|
||||
// CHECK:STDOUT: %.loc15_1: %struct_type.a.b.501 = var_pattern %y.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y.var: ref %struct_type.a.b.501 = var y
|
||||
// CHECK:STDOUT: %.loc15_25: type = splice_block %struct_type.a.b.loc15 [template = constants.%struct_type.a.b.501] {
|
||||
// CHECK:STDOUT: %int_32.loc15_13: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_13: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc15_22: Core.IntLiteral = int_value 32 [template = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc15_22: type = class_type @Int, @Int(constants.%int_32) [template = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc15: type = struct_type {.a: %i32, .b: %i32} [template = constants.%struct_type.a.b.501]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %y: ref %struct_type.a.b.501 = bind_name y, %y.var
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -64,24 +122,8 @@ var y: {.a: i32, .b: i32} = x;
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_1.loc11: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2.loc11: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc11_44.1: %struct_type.a.b.cfd = struct_literal (%int_1.loc11, %int_2.loc11)
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_44.1: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc11_44.1: <bound method> = bound_method %int_1.loc11, %impl.elem0.loc11_44.1 [template = constants.%Convert.bound.ab5]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc11_44.1: <specific function> = specific_function %Convert.bound.loc11_44.1, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.70c]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_44.1: init %i32 = call %Convert.specific_fn.loc11_44.1(%int_1.loc11) [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc11_44.2: %i32 = value_of_initializer %int.convert_checked.loc11_44.1 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %.loc11_44.3: %i32 = converted %int_1.loc11, %.loc11_44.2 [template = constants.%int_1.5d2]
|
||||
// CHECK:STDOUT: %impl.elem0.loc11_44.2: %Convert.type.1b6 = impl_witness_access constants.%impl_witness.d39, element0 [template = constants.%Convert.956]
|
||||
// CHECK:STDOUT: %Convert.bound.loc11_44.2: <bound method> = bound_method %int_2.loc11, %impl.elem0.loc11_44.2 [template = constants.%Convert.bound.ef9]
|
||||
// CHECK:STDOUT: %Convert.specific_fn.loc11_44.2: <specific function> = specific_function %Convert.bound.loc11_44.2, @Convert.2(constants.%int_32) [template = constants.%Convert.specific_fn.787]
|
||||
// CHECK:STDOUT: %int.convert_checked.loc11_44.2: init %i32 = call %Convert.specific_fn.loc11_44.2(%int_2.loc11) [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc11_44.4: %i32 = value_of_initializer %int.convert_checked.loc11_44.2 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc11_44.5: %i32 = converted %int_2.loc11, %.loc11_44.4 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %struct: %struct_type.a.b.501 = struct_value (%.loc11_44.3, %.loc11_44.5) [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc11_45: %struct_type.a.b.501 = converted %.loc11_44.1, %struct [template = constants.%struct]
|
||||
// CHECK:STDOUT: %v: %struct_type.a.b.501 = bind_name v, %.loc11_45
|
||||
// CHECK:STDOUT: %v.ref: %struct_type.a.b.501 = name_ref v, %v
|
||||
// CHECK:STDOUT: %w: %struct_type.a.b.501 = bind_name w, %v.ref
|
||||
// CHECK:STDOUT: %.loc11: %struct_type.a.b.cfd = struct_literal (%int_1.loc11, %int_2.loc11)
|
||||
// CHECK:STDOUT: %v.ref: %struct_type.a.b.501 = name_ref v, file.%v
|
||||
// CHECK:STDOUT: %int_1.loc14: Core.IntLiteral = int_value 1 [template = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %int_2.loc14: Core.IntLiteral = int_value 2 [template = constants.%int_2.ecc]
|
||||
// CHECK:STDOUT: %.loc14_44.1: %struct_type.a.b.cfd = struct_literal (%int_1.loc14, %int_2.loc14)
|
||||
@@ -100,8 +142,8 @@ var y: {.a: i32, .b: i32} = x;
|
||||
// CHECK:STDOUT: %.loc14_44.6: ref %i32 = struct_access file.%x.var, element1
|
||||
// CHECK:STDOUT: %.loc14_44.7: init %i32 = initialize_from %.loc14_44.5 to %.loc14_44.6 [template = constants.%int_2.ef8]
|
||||
// CHECK:STDOUT: %.loc14_44.8: init %struct_type.a.b.501 = struct_init (%.loc14_44.4, %.loc14_44.7) to file.%x.var [template = constants.%struct]
|
||||
// CHECK:STDOUT: %.loc14_45: init %struct_type.a.b.501 = converted %.loc14_44.1, %.loc14_44.8 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc14_45
|
||||
// CHECK:STDOUT: %.loc14_1: init %struct_type.a.b.501 = converted %.loc14_44.1, %.loc14_44.8 [template = constants.%struct]
|
||||
// CHECK:STDOUT: assign file.%x.var, %.loc14_1
|
||||
// CHECK:STDOUT: %x.ref: ref %struct_type.a.b.501 = name_ref x, file.%x
|
||||
// CHECK:STDOUT: %.loc15_29.1: ref %i32 = struct_access %x.ref, element0
|
||||
// CHECK:STDOUT: %.loc15_29.2: %i32 = bind_value %.loc15_29.1
|
||||
@@ -112,8 +154,8 @@ var y: {.a: i32, .b: i32} = x;
|
||||
// CHECK:STDOUT: %.loc15_29.7: ref %i32 = struct_access file.%y.var, element1
|
||||
// CHECK:STDOUT: %.loc15_29.8: init %i32 = initialize_from %.loc15_29.6 to %.loc15_29.7
|
||||
// CHECK:STDOUT: %.loc15_29.9: init %struct_type.a.b.501 = struct_init (%.loc15_29.4, %.loc15_29.8) to file.%y.var
|
||||
// CHECK:STDOUT: %.loc15_30: init %struct_type.a.b.501 = converted %x.ref, %.loc15_29.9
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc15_30
|
||||
// CHECK:STDOUT: %.loc15_1: init %struct_type.a.b.501 = converted %x.ref, %.loc15_29.9
|
||||
// CHECK:STDOUT: assign file.%y.var, %.loc15_1
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
Reference in New Issue
Block a user