mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 16:01:05 +01:00
Implement unused pattern bindings, continued (#6518)
Implementation of unused pattern bindings #2022, continued. Whereas previous PR #6460 took care of parsing, and PR #6479 prepared the stage by using _ in some test cases, this PR has the the actual implementation, using a simple dataflow analysis. --------- Co-authored-by: Burak Emir <bqe@google.com> Co-authored-by: jonmeow <jperkins@google.com>
This commit is contained in:
co-authored by
Burak Emir
jonmeow
parent
bea24a8bee
commit
fdb188ccfd
+67
-67
@@ -75,7 +75,7 @@ fn CallImplicitGenericParam(n: i32) -> i32* {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn TupleParam[T:! type](x: (T, i32)) {}
|
||||
fn TupleParam[T:! type](unused x: (T, i32)) {}
|
||||
|
||||
fn CallTupleParam() {
|
||||
TupleParam((1, 2));
|
||||
@@ -85,7 +85,7 @@ fn CallTupleParam() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn StructParam[T:! type](x: {.a: T, .b: i32}) {}
|
||||
fn StructParam[T:! type](unused x: {.a: T, .b: i32}) {}
|
||||
|
||||
fn CallStructParam() {
|
||||
StructParam({.a = 1, .b = 2});
|
||||
@@ -95,15 +95,15 @@ fn CallStructParam() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn BigStructParam[T:! type](x: {.c: T, .d: i32, .e: i32}) {}
|
||||
fn BigStructParam[T:! type](unused x: {.c: T, .d: i32, .e: i32}) {}
|
||||
|
||||
fn CallBigStructParam() {
|
||||
// CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: BigStructParam({.c = 3, .d = 4});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_bigger_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn BigStructParam[T:! type](x: {.c: T, .d: i32, .e: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn BigStructParam[T:! type](unused x: {.c: T, .d: i32, .e: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
BigStructParam({.c = 3, .d = 4});
|
||||
}
|
||||
@@ -112,15 +112,15 @@ fn CallBigStructParam() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn SmallStructParam[T:! type](x: {.f: T, .g: i32}) {}
|
||||
fn SmallStructParam[T:! type](unused x: {.f: T, .g: i32}) {}
|
||||
|
||||
fn CallSmallStructParam() {
|
||||
// CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: SmallStructParam({.f = 5, .g = 6, .h = 7});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_smaller_struct.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn SmallStructParam[T:! type](x: {.f: T, .g: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn SmallStructParam[T:! type](unused x: {.f: T, .g: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
SmallStructParam({.f = 5, .g = 6, .h = 7});
|
||||
}
|
||||
@@ -129,15 +129,15 @@ fn CallSmallStructParam() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn WrongNameStructParam[T:! type](x: {.i: T, .different: i32}) {}
|
||||
fn WrongNameStructParam[T:! type](unused x: {.i: T, .different: i32}) {}
|
||||
|
||||
fn CallWrongNameStructParam() {
|
||||
// CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: WrongNameStructParam({.i = 8, .j = 9});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_struct_wrong_name.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn WrongNameStructParam[T:! type](x: {.i: T, .different: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn WrongNameStructParam[T:! type](unused x: {.i: T, .different: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
WrongNameStructParam({.i = 8, .j = 9});
|
||||
}
|
||||
@@ -146,15 +146,15 @@ fn CallWrongNameStructParam() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn WrongOrderStructParam[T:! type](x: {.first: T, .second: i32}) {}
|
||||
fn WrongOrderStructParam[T:! type](unused x: {.first: T, .second: i32}) {}
|
||||
|
||||
fn CallWrongOrderStructParam() {
|
||||
// CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: WrongOrderStructParam({.second = 11, .first = 10});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_deduce_struct_wrong_order.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn WrongOrderStructParam[T:! type](x: {.first: T, .second: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn WrongOrderStructParam[T:! type](unused x: {.first: T, .second: i32}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
WrongOrderStructParam({.second = 11, .first = 10});
|
||||
}
|
||||
@@ -902,12 +902,12 @@ fn F() {
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %T.loc4_15.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @TupleParam.%tuple.type (%tuple.type.b01) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_35.1: type = splice_block %.loc4_35.3 [symbolic = %tuple.type (constants.%tuple.type.b01)] {
|
||||
// CHECK:STDOUT: %.loc4_42.1: type = splice_block %.loc4_42.3 [symbolic = %tuple.type (constants.%tuple.type.b01)] {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_15.2 [symbolic = %T.loc4_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc4_35.2: %tuple.type.24b = tuple_literal (%T.ref, %i32) [symbolic = %tuple (constants.%tuple.c27)]
|
||||
// CHECK:STDOUT: %.loc4_35.3: type = converted %.loc4_35.2, constants.%tuple.type.b01 [symbolic = %tuple.type (constants.%tuple.type.b01)]
|
||||
// CHECK:STDOUT: %.loc4_42.2: %tuple.type.24b = tuple_literal (%T.ref, %i32) [symbolic = %tuple (constants.%tuple.c27)]
|
||||
// CHECK:STDOUT: %.loc4_42.3: type = converted %.loc4_42.2, constants.%tuple.type.b01 [symbolic = %tuple.type (constants.%tuple.type.b01)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @TupleParam.%tuple.type (%tuple.type.b01) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1039,27 +1039,27 @@ fn F() {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %T.loc4_16.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @StructParam.%struct_type.a.b.loc4_44.1 (%struct_type.a.b.702) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.a.b.loc4_44.2 [symbolic = %struct_type.a.b.loc4_44.1 (constants.%struct_type.a.b.702)] {
|
||||
// CHECK:STDOUT: %x.param: @StructParam.%struct_type.a.b.loc4_51.1 (%struct_type.a.b.702) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.a.b.loc4_51.2 [symbolic = %struct_type.a.b.loc4_51.1 (constants.%struct_type.a.b.702)] {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_16.2 [symbolic = %T.loc4_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc4_44.2: type = struct_type {.a: @StructParam.%T.loc4_16.1 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_44.1 (constants.%struct_type.a.b.702)]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc4_51.2: type = struct_type {.a: @StructParam.%T.loc4_16.1 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_51.1 (constants.%struct_type.a.b.702)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @StructParam.%struct_type.a.b.loc4_44.1 (%struct_type.a.b.702) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: @StructParam.%struct_type.a.b.loc4_51.1 (%struct_type.a.b.702) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %CallStructParam.decl: %CallStructParam.type = fn_decl @CallStructParam [concrete = constants.%CallStructParam] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @StructParam(%T.loc4_16.2: type) {
|
||||
// CHECK:STDOUT: %T.loc4_16.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_16.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc4_44.1: type = struct_type {.a: @StructParam.%T.loc4_16.1 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_44.1 (constants.%struct_type.a.b.702)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.b.loc4_44.1 [symbolic = %pattern_type (constants.%pattern_type.8a5)]
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc4_51.1: type = struct_type {.a: @StructParam.%T.loc4_16.1 (%T), .b: %i32} [symbolic = %struct_type.a.b.loc4_51.1 (constants.%struct_type.a.b.702)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.b.loc4_51.1 [symbolic = %pattern_type (constants.%pattern_type.8a5)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.a.b.loc4_44.1 [symbolic = %require_complete (constants.%require_complete.19d)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.a.b.loc4_51.1 [symbolic = %require_complete (constants.%require_complete.19d)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @StructParam.%struct_type.a.b.loc4_44.1 (%struct_type.a.b.702)) {
|
||||
// CHECK:STDOUT: fn(%x.param: @StructParam.%struct_type.a.b.loc4_51.1 (%struct_type.a.b.702)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1087,13 +1087,13 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @StructParam(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => constants.%T
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc4_44.1 => constants.%struct_type.a.b.702
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc4_51.1 => constants.%struct_type.a.b.702
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.8a5
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @StructParam(Core.IntLiteral) {
|
||||
// CHECK:STDOUT: %T.loc4_16.1 => Core.IntLiteral
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc4_44.1 => constants.%struct_type.a.b.a13
|
||||
// CHECK:STDOUT: %struct_type.a.b.loc4_51.1 => constants.%struct_type.a.b.a13
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.cfa
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
@@ -1147,29 +1147,29 @@ fn F() {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %T.loc4_19.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_19.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @BigStructParam.%struct_type.c.d.e.loc4_56.1 (%struct_type.c.d.e) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.c.d.e.loc4_56.2 [symbolic = %struct_type.c.d.e.loc4_56.1 (constants.%struct_type.c.d.e)] {
|
||||
// CHECK:STDOUT: %x.param: @BigStructParam.%struct_type.c.d.e.loc4_63.1 (%struct_type.c.d.e) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.c.d.e.loc4_63.2 [symbolic = %struct_type.c.d.e.loc4_63.1 (constants.%struct_type.c.d.e)] {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_19.2 [symbolic = %T.loc4_19.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %int_32.loc4_44: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc4_44: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc4_53: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc4_53: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.c.d.e.loc4_56.2: type = struct_type {.c: @BigStructParam.%T.loc4_19.1 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.1 (constants.%struct_type.c.d.e)]
|
||||
// CHECK:STDOUT: %int_32.loc4_51: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc4_51: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc4_60: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc4_60: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.c.d.e.loc4_63.2: type = struct_type {.c: @BigStructParam.%T.loc4_19.1 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_63.1 (constants.%struct_type.c.d.e)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @BigStructParam.%struct_type.c.d.e.loc4_56.1 (%struct_type.c.d.e) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: @BigStructParam.%struct_type.c.d.e.loc4_63.1 (%struct_type.c.d.e) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %CallBigStructParam.decl: %CallBigStructParam.type = fn_decl @CallBigStructParam [concrete = constants.%CallBigStructParam] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @BigStructParam(%T.loc4_19.2: type) {
|
||||
// CHECK:STDOUT: %T.loc4_19.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_19.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %struct_type.c.d.e.loc4_56.1: type = struct_type {.c: @BigStructParam.%T.loc4_19.1 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_56.1 (constants.%struct_type.c.d.e)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.c.d.e.loc4_56.1 [symbolic = %pattern_type (constants.%pattern_type.1d5)]
|
||||
// CHECK:STDOUT: %struct_type.c.d.e.loc4_63.1: type = struct_type {.c: @BigStructParam.%T.loc4_19.1 (%T), .d: %i32, .e: %i32} [symbolic = %struct_type.c.d.e.loc4_63.1 (constants.%struct_type.c.d.e)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.c.d.e.loc4_63.1 [symbolic = %pattern_type (constants.%pattern_type.1d5)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.c.d.e.loc4_56.1 [symbolic = %require_complete (constants.%require_complete.32d)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.c.d.e.loc4_63.1 [symbolic = %require_complete (constants.%require_complete.32d)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @BigStructParam.%struct_type.c.d.e.loc4_56.1 (%struct_type.c.d.e)) {
|
||||
// CHECK:STDOUT: fn(%x.param: @BigStructParam.%struct_type.c.d.e.loc4_63.1 (%struct_type.c.d.e)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1186,7 +1186,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @BigStructParam(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc4_19.1 => constants.%T
|
||||
// CHECK:STDOUT: %struct_type.c.d.e.loc4_56.1 => constants.%struct_type.c.d.e
|
||||
// CHECK:STDOUT: %struct_type.c.d.e.loc4_63.1 => constants.%struct_type.c.d.e
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.1d5
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1238,27 +1238,27 @@ fn F() {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %T.loc4_21.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_21.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @SmallStructParam.%struct_type.f.g.loc4_49.1 (%struct_type.f.g) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.f.g.loc4_49.2 [symbolic = %struct_type.f.g.loc4_49.1 (constants.%struct_type.f.g)] {
|
||||
// CHECK:STDOUT: %x.param: @SmallStructParam.%struct_type.f.g.loc4_56.1 (%struct_type.f.g) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.f.g.loc4_56.2 [symbolic = %struct_type.f.g.loc4_56.1 (constants.%struct_type.f.g)] {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_21.2 [symbolic = %T.loc4_21.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.f.g.loc4_49.2: type = struct_type {.f: @SmallStructParam.%T.loc4_21.1 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_49.1 (constants.%struct_type.f.g)]
|
||||
// CHECK:STDOUT: %struct_type.f.g.loc4_56.2: type = struct_type {.f: @SmallStructParam.%T.loc4_21.1 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_56.1 (constants.%struct_type.f.g)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @SmallStructParam.%struct_type.f.g.loc4_49.1 (%struct_type.f.g) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: @SmallStructParam.%struct_type.f.g.loc4_56.1 (%struct_type.f.g) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %CallSmallStructParam.decl: %CallSmallStructParam.type = fn_decl @CallSmallStructParam [concrete = constants.%CallSmallStructParam] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @SmallStructParam(%T.loc4_21.2: type) {
|
||||
// CHECK:STDOUT: %T.loc4_21.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_21.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %struct_type.f.g.loc4_49.1: type = struct_type {.f: @SmallStructParam.%T.loc4_21.1 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_49.1 (constants.%struct_type.f.g)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.f.g.loc4_49.1 [symbolic = %pattern_type (constants.%pattern_type.958)]
|
||||
// CHECK:STDOUT: %struct_type.f.g.loc4_56.1: type = struct_type {.f: @SmallStructParam.%T.loc4_21.1 (%T), .g: %i32} [symbolic = %struct_type.f.g.loc4_56.1 (constants.%struct_type.f.g)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.f.g.loc4_56.1 [symbolic = %pattern_type (constants.%pattern_type.958)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.f.g.loc4_49.1 [symbolic = %require_complete (constants.%require_complete.ed5)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.f.g.loc4_56.1 [symbolic = %require_complete (constants.%require_complete.ed5)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @SmallStructParam.%struct_type.f.g.loc4_49.1 (%struct_type.f.g)) {
|
||||
// CHECK:STDOUT: fn(%x.param: @SmallStructParam.%struct_type.f.g.loc4_56.1 (%struct_type.f.g)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1276,7 +1276,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @SmallStructParam(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc4_21.1 => constants.%T
|
||||
// CHECK:STDOUT: %struct_type.f.g.loc4_49.1 => constants.%struct_type.f.g
|
||||
// CHECK:STDOUT: %struct_type.f.g.loc4_56.1 => constants.%struct_type.f.g
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.958
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1327,27 +1327,27 @@ fn F() {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %T.loc4_25.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_25.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @WrongNameStructParam.%struct_type.i.different.loc4_61.1 (%struct_type.i.different) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.i.different.loc4_61.2 [symbolic = %struct_type.i.different.loc4_61.1 (constants.%struct_type.i.different)] {
|
||||
// CHECK:STDOUT: %x.param: @WrongNameStructParam.%struct_type.i.different.loc4_68.1 (%struct_type.i.different) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.i.different.loc4_68.2 [symbolic = %struct_type.i.different.loc4_68.1 (constants.%struct_type.i.different)] {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_25.2 [symbolic = %T.loc4_25.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.i.different.loc4_61.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.1 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_61.1 (constants.%struct_type.i.different)]
|
||||
// CHECK:STDOUT: %struct_type.i.different.loc4_68.2: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.1 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_68.1 (constants.%struct_type.i.different)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @WrongNameStructParam.%struct_type.i.different.loc4_61.1 (%struct_type.i.different) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: @WrongNameStructParam.%struct_type.i.different.loc4_68.1 (%struct_type.i.different) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %CallWrongNameStructParam.decl: %CallWrongNameStructParam.type = fn_decl @CallWrongNameStructParam [concrete = constants.%CallWrongNameStructParam] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @WrongNameStructParam(%T.loc4_25.2: type) {
|
||||
// CHECK:STDOUT: %T.loc4_25.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_25.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %struct_type.i.different.loc4_61.1: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.1 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_61.1 (constants.%struct_type.i.different)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.i.different.loc4_61.1 [symbolic = %pattern_type (constants.%pattern_type.ce4)]
|
||||
// CHECK:STDOUT: %struct_type.i.different.loc4_68.1: type = struct_type {.i: @WrongNameStructParam.%T.loc4_25.1 (%T), .different: %i32} [symbolic = %struct_type.i.different.loc4_68.1 (constants.%struct_type.i.different)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.i.different.loc4_68.1 [symbolic = %pattern_type (constants.%pattern_type.ce4)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.i.different.loc4_61.1 [symbolic = %require_complete (constants.%require_complete.c84)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.i.different.loc4_68.1 [symbolic = %require_complete (constants.%require_complete.c84)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @WrongNameStructParam.%struct_type.i.different.loc4_61.1 (%struct_type.i.different)) {
|
||||
// CHECK:STDOUT: fn(%x.param: @WrongNameStructParam.%struct_type.i.different.loc4_68.1 (%struct_type.i.different)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1364,7 +1364,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @WrongNameStructParam(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc4_25.1 => constants.%T
|
||||
// CHECK:STDOUT: %struct_type.i.different.loc4_61.1 => constants.%struct_type.i.different
|
||||
// CHECK:STDOUT: %struct_type.i.different.loc4_68.1 => constants.%struct_type.i.different
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.ce4
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1415,27 +1415,27 @@ fn F() {
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %T.loc4_26.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_63.1 (%struct_type.first.second) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.first.second.loc4_63.2 [symbolic = %struct_type.first.second.loc4_63.1 (constants.%struct_type.first.second)] {
|
||||
// CHECK:STDOUT: %x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_70.1 (%struct_type.first.second) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4: type = splice_block %struct_type.first.second.loc4_70.2 [symbolic = %struct_type.first.second.loc4_70.1 (constants.%struct_type.first.second)] {
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc4_26.2 [symbolic = %T.loc4_26.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %struct_type.first.second.loc4_63.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.1 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_63.1 (constants.%struct_type.first.second)]
|
||||
// CHECK:STDOUT: %struct_type.first.second.loc4_70.2: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.1 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_70.1 (constants.%struct_type.first.second)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @WrongOrderStructParam.%struct_type.first.second.loc4_63.1 (%struct_type.first.second) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: @WrongOrderStructParam.%struct_type.first.second.loc4_70.1 (%struct_type.first.second) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %CallWrongOrderStructParam.decl: %CallWrongOrderStructParam.type = fn_decl @CallWrongOrderStructParam [concrete = constants.%CallWrongOrderStructParam] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @WrongOrderStructParam(%T.loc4_26.2: type) {
|
||||
// CHECK:STDOUT: %T.loc4_26.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_26.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %struct_type.first.second.loc4_63.1: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.1 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_63.1 (constants.%struct_type.first.second)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.first.second.loc4_63.1 [symbolic = %pattern_type (constants.%pattern_type.ab3)]
|
||||
// CHECK:STDOUT: %struct_type.first.second.loc4_70.1: type = struct_type {.first: @WrongOrderStructParam.%T.loc4_26.1 (%T), .second: %i32} [symbolic = %struct_type.first.second.loc4_70.1 (constants.%struct_type.first.second)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.first.second.loc4_70.1 [symbolic = %pattern_type (constants.%pattern_type.ab3)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.first.second.loc4_63.1 [symbolic = %require_complete (constants.%require_complete.311)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.first.second.loc4_70.1 [symbolic = %require_complete (constants.%require_complete.311)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_63.1 (%struct_type.first.second)) {
|
||||
// CHECK:STDOUT: fn(%x.param: @WrongOrderStructParam.%struct_type.first.second.loc4_70.1 (%struct_type.first.second)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -1452,7 +1452,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @WrongOrderStructParam(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc4_26.1 => constants.%T
|
||||
// CHECK:STDOUT: %struct_type.first.second.loc4_63.1 => constants.%struct_type.first.second
|
||||
// CHECK:STDOUT: %struct_type.first.second.loc4_70.1 => constants.%struct_type.first.second
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.ab3
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+26
-26
@@ -16,21 +16,21 @@
|
||||
package Lib;
|
||||
|
||||
interface Z {}
|
||||
fn A[T:! Z](x: {.a: T}) {}
|
||||
fn A[T:! Z](unused x: {.a: T}) {}
|
||||
|
||||
// --- fail_deduce_imported_function.carbon
|
||||
|
||||
import Lib;
|
||||
|
||||
fn A[T:! Lib.Z](x: {.a: T}) {}
|
||||
fn A[T:! Lib.Z](unused x: {.a: T}) {}
|
||||
|
||||
fn B() {
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE+7]]:3: error: cannot deduce value for generic parameter `T` [DeductionIncomplete]
|
||||
// CHECK:STDERR: A({.b = {}});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn A[T:! Lib.Z](x: {.a: T}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn A[T:! Lib.Z](unused x: {.a: T}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
A({.b = {}});
|
||||
|
||||
@@ -39,8 +39,8 @@ fn B() {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_deduce_imported_function.carbon:[[@LINE-17]]:1: in import [InImport]
|
||||
// CHECK:STDERR: lib.carbon:4:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn A[T:! Z](x: {.a: T}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn A[T:! Z](unused x: {.a: T}) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Lib.A({.b = {}});
|
||||
}
|
||||
@@ -78,14 +78,14 @@ fn B() {
|
||||
// CHECK:STDOUT: %Z.ref: type = name_ref Z, file.%Z.decl [concrete = constants.%Z.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc4_6.2: %Z.type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @A.%struct_type.a.loc4_22.1 (%struct_type.a) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_22: type = splice_block %struct_type.a.loc4_22.2 [symbolic = %struct_type.a.loc4_22.1 (constants.%struct_type.a)] {
|
||||
// CHECK:STDOUT: %x.param: @A.%struct_type.a.loc4_29.1 (%struct_type.a) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_29: type = splice_block %struct_type.a.loc4_29.2 [symbolic = %struct_type.a.loc4_29.1 (constants.%struct_type.a)] {
|
||||
// CHECK:STDOUT: %T.ref: %Z.type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
|
||||
// CHECK:STDOUT: %.loc4_21: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_22.2: type = struct_type {.a: @A.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_22.1 (constants.%struct_type.a)]
|
||||
// CHECK:STDOUT: %.loc4_28: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_29.2: type = struct_type {.a: @A.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_29.1 (constants.%struct_type.a)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @A.%struct_type.a.loc4_22.1 (%struct_type.a) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: @A.%struct_type.a.loc4_29.1 (%struct_type.a) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -103,13 +103,13 @@ fn B() {
|
||||
// CHECK:STDOUT: generic fn @A(%T.loc4_6.2: %Z.type) {
|
||||
// CHECK:STDOUT: %T.loc4_6.1: %Z.type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc4_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_22.1: type = struct_type {.a: @A.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_22.1 (constants.%struct_type.a)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.loc4_22.1 [symbolic = %pattern_type (constants.%pattern_type.3fc)]
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_29.1: type = struct_type {.a: @A.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_29.1 (constants.%struct_type.a)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.loc4_29.1 [symbolic = %pattern_type (constants.%pattern_type.3fc)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.a.loc4_22.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.a.loc4_29.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @A.%struct_type.a.loc4_22.1 (%struct_type.a)) {
|
||||
// CHECK:STDOUT: fn(%x.param: @A.%struct_type.a.loc4_29.1 (%struct_type.a)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -122,7 +122,7 @@ fn B() {
|
||||
// CHECK:STDOUT: specific @A(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc4_6.1 => constants.%T
|
||||
// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_22.1 => constants.%struct_type.a
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_29.1 => constants.%struct_type.a
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.3fc
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -181,14 +181,14 @@ fn B() {
|
||||
// CHECK:STDOUT: %Z.ref: type = name_ref Z, imports.%Lib.Z [concrete = constants.%Z.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %T.loc4_6.2: %Z.type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %x.param: @A.loc4.%struct_type.a.loc4_26.1 (%struct_type.a) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_26: type = splice_block %struct_type.a.loc4_26.2 [symbolic = %struct_type.a.loc4_26.1 (constants.%struct_type.a)] {
|
||||
// CHECK:STDOUT: %x.param: @A.loc4.%struct_type.a.loc4_33.1 (%struct_type.a) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc4_33: type = splice_block %struct_type.a.loc4_33.2 [symbolic = %struct_type.a.loc4_33.1 (constants.%struct_type.a)] {
|
||||
// CHECK:STDOUT: %T.ref: %Z.type = name_ref T, %T.loc4_6.2 [symbolic = %T.loc4_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.as_type: type = facet_access_type %T.ref [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
|
||||
// CHECK:STDOUT: %.loc4_25: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_26.2: type = struct_type {.a: @A.loc4.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_26.1 (constants.%struct_type.a)]
|
||||
// CHECK:STDOUT: %.loc4_32: type = converted %T.ref, %T.as_type [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_33.2: type = struct_type {.a: @A.loc4.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_33.1 (constants.%struct_type.a)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: @A.loc4.%struct_type.a.loc4_26.1 (%struct_type.a) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: %x: @A.loc4.%struct_type.a.loc4_33.1 (%struct_type.a) = value_binding x, %x.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %B.decl: %B.type = fn_decl @B [concrete = constants.%B] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
@@ -204,13 +204,13 @@ fn B() {
|
||||
// CHECK:STDOUT: generic fn @A.loc4(%T.loc4_6.2: %Z.type) {
|
||||
// CHECK:STDOUT: %T.loc4_6.1: %Z.type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.binding.as_type: type = symbolic_binding_type T, 0, %T.loc4_6.1 [symbolic = %T.binding.as_type (constants.%T.binding.as_type)]
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_26.1: type = struct_type {.a: @A.loc4.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_26.1 (constants.%struct_type.a)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.loc4_26.1 [symbolic = %pattern_type (constants.%pattern_type.857)]
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_33.1: type = struct_type {.a: @A.loc4.%T.binding.as_type (%T.binding.as_type)} [symbolic = %struct_type.a.loc4_33.1 (constants.%struct_type.a)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %struct_type.a.loc4_33.1 [symbolic = %pattern_type (constants.%pattern_type.857)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.a.loc4_26.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %struct_type.a.loc4_33.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%x.param: @A.loc4.%struct_type.a.loc4_26.1 (%struct_type.a)) {
|
||||
// CHECK:STDOUT: fn(%x.param: @A.loc4.%struct_type.a.loc4_33.1 (%struct_type.a)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -247,7 +247,7 @@ fn B() {
|
||||
// CHECK:STDOUT: specific @A.loc4(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc4_6.1 => constants.%T
|
||||
// CHECK:STDOUT: %T.binding.as_type => constants.%T.binding.as_type
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_26.1 => constants.%struct_type.a
|
||||
// CHECK:STDOUT: %struct_type.a.loc4_33.1 => constants.%struct_type.a
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.857
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
|
||||
fn F(T:! type, U:! type) {
|
||||
var p: T*;
|
||||
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+7]]:14: error: cannot implicitly convert expression of type `T` to `U` [ConversionFailure]
|
||||
// CHECK:STDERR: let n: U = *p;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+4]]:14: note: type `T` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: let n: U = *p;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+7]]:21: error: cannot implicitly convert expression of type `T` to `U` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused n: U = *p;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_type_param_mismatch.carbon:[[@LINE+4]]:21: note: type `T` does not implement interface `Core.ImplicitAs(U)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: let unused n: U = *p;
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR:
|
||||
let n: U = *p;
|
||||
let unused n: U = *p;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F(T:! type) {
|
||||
fn F(unused T:! type) {
|
||||
}
|
||||
|
||||
fn G(T:! type) {
|
||||
@@ -43,14 +43,15 @@ fn H() {
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %type: type = facet_type <type> [concrete]
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self]
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.67db0b.1: type = symbolic_binding T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type type [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %T.67db0b.2: type = symbolic_binding T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%T) [symbolic]
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function %F, @F(%T.67db0b.2) [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -62,18 +63,18 @@ fn H() {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %T.loc4_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.loc4_13.2: type = symbolic_binding T, 0 [symbolic = %T.loc4_13.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %T.loc7_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc7_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.loc7_6.2: type = symbolic_binding T, 0 [symbolic = %T.loc7_6.1 (constants.%T.67db0b.2)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc4_6.2: type) {
|
||||
// CHECK:STDOUT: %T.loc4_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc4_13.2: type) {
|
||||
// CHECK:STDOUT: %T.loc4_13.1: type = symbolic_binding T, 0 [symbolic = %T.loc4_13.1 (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
@@ -84,7 +85,7 @@ fn H() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @G(%T.loc7_6.2: type) {
|
||||
// CHECK:STDOUT: %T.loc7_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc7_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.loc7_6.1: type = symbolic_binding T, 0 [symbolic = %T.loc7_6.1 (constants.%T.67db0b.2)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %F.specific_fn.loc8_3.2: <specific function> = specific_function constants.%F, @F(%T.loc7_6.1) [symbolic = %F.specific_fn.loc8_3.2 (constants.%F.specific_fn)]
|
||||
@@ -92,21 +93,25 @@ fn H() {
|
||||
// CHECK:STDOUT: fn() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type = name_ref F, file.%F.decl [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_6.2 [symbolic = %T.loc7_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %F.specific_fn.loc8_3.1: <specific function> = specific_function %F.ref, @F(constants.%T) [symbolic = %F.specific_fn.loc8_3.2 (constants.%F.specific_fn)]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, %T.loc7_6.2 [symbolic = %T.loc7_6.1 (constants.%T.67db0b.2)]
|
||||
// CHECK:STDOUT: %F.specific_fn.loc8_3.1: <specific function> = specific_function %F.ref, @F(constants.%T.67db0b.2) [symbolic = %F.specific_fn.loc8_3.2 (constants.%F.specific_fn)]
|
||||
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %F.specific_fn.loc8_3.1()
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc4_6.1 => constants.%T
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: specific @F(constants.%T.67db0b.1) {
|
||||
// CHECK:STDOUT: %T.loc4_13.1 => constants.%T.67db0b.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @G(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc7_6.1 => constants.%T
|
||||
// CHECK:STDOUT: specific @G(constants.%T.67db0b.2) {
|
||||
// CHECK:STDOUT: %T.loc7_6.1 => constants.%T.67db0b.2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T.67db0b.2) {
|
||||
// CHECK:STDOUT: %T.loc4_13.1 => constants.%T.67db0b.2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- user.carbon
|
||||
@@ -120,19 +125,20 @@ fn H() {
|
||||
// CHECK:STDOUT: %H: %H.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %F.type: type = fn_type @F [concrete]
|
||||
// CHECK:STDOUT: %F: %F.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %T.67db0b.1: type = symbolic_binding T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %F.specific_fn.540: <specific function> = specific_function %F, @F(%C) [concrete]
|
||||
// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
||||
// CHECK:STDOUT: %G: %G.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %F.specific_fn.643: <specific function> = specific_function %F, @F(%T) [symbolic]
|
||||
// CHECK:STDOUT: %T.67db0b.2: type = symbolic_binding T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %F.specific_fn.643: <specific function> = specific_function %F, @F(%T.67db0b.2) [symbolic]
|
||||
// CHECK:STDOUT: %G.specific_fn: <specific function> = specific_function %G, @G(%C) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Main.F: %F.type = import_ref Main//library, F, loaded [concrete = constants.%F]
|
||||
// CHECK:STDOUT: %Main.G: %G.type = import_ref Main//library, G, loaded [concrete = constants.%G]
|
||||
// CHECK:STDOUT: %Main.import_ref.b3bc94.1: type = import_ref Main//library, loc4_6, loaded [symbolic = @F.%T (constants.%T)]
|
||||
// CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//library, loc7_6, loaded [symbolic = @G.%T (constants.%T)]
|
||||
// CHECK:STDOUT: %Main.import_ref.b3bc94.1: type = import_ref Main//library, loc4_13, loaded [symbolic = @F.%T (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT: %Main.import_ref.b3bc94.2: type = import_ref Main//library, loc7_6, loaded [symbolic = @G.%T (constants.%T.67db0b.2)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
@@ -169,7 +175,7 @@ fn H() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(imports.%Main.import_ref.b3bc94.1: type) [from "library.carbon"] {
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T.67db0b.1)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
@@ -177,7 +183,7 @@ fn H() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @G(imports.%Main.import_ref.b3bc94.2: type) [from "library.carbon"] {
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T)]
|
||||
// CHECK:STDOUT: %T: type = symbolic_binding T, 0 [symbolic = %T (constants.%T.67db0b.2)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %F.specific_fn: <specific function> = specific_function constants.%F, @F(%T) [symbolic = %F.specific_fn (constants.%F.specific_fn.643)]
|
||||
@@ -185,10 +191,8 @@ fn H() {
|
||||
// CHECK:STDOUT: fn;
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T) {
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: specific @F(constants.%T.67db0b.1) {
|
||||
// CHECK:STDOUT: %T => constants.%T.67db0b.1
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%C) {
|
||||
@@ -197,8 +201,14 @@ fn H() {
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @G(constants.%T) {
|
||||
// CHECK:STDOUT: %T => constants.%T
|
||||
// CHECK:STDOUT: specific @F(constants.%T.67db0b.2) {
|
||||
// CHECK:STDOUT: %T => constants.%T.67db0b.2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @G(constants.%T.67db0b.2) {
|
||||
// CHECK:STDOUT: %T => constants.%T.67db0b.2
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @G(constants.%C) {
|
||||
|
||||
+24
-24
@@ -52,14 +52,14 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
fn F(T:! type, U:! type) -> T*;
|
||||
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:6: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fn F(U:! type, T:! type) -> T* {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:13: error: redeclaration differs at parameter 1 [RedeclParamDiffers]
|
||||
// CHECK:STDERR: fn F(unused U:! type, T:! type) -> T* {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE-5]]:6: note: previous declaration's corresponding parameter here [RedeclParamPrevious]
|
||||
// CHECK:STDERR: fn F(T:! type, U:! type) -> T*;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
fn F(U:! type, T:! type) -> T* {
|
||||
fn F(unused U:! type, T:! type) -> T* {
|
||||
// CHECK:STDERR: fail_reorder.carbon:[[@LINE+7]]:10: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: return F(T);
|
||||
// CHECK:STDERR: ^~~~
|
||||
@@ -352,15 +352,15 @@ fn F(U:! type, T:! type) -> U* {
|
||||
// CHECK:STDOUT: %return.patt: @F.loc13.%pattern_type (%pattern_type.423) = return_slot_pattern [concrete]
|
||||
// CHECK:STDOUT: %return.param_patt: @F.loc13.%pattern_type (%pattern_type.423) = out_param_pattern %return.patt, call_param0 [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc13_16.2 [symbolic = %T.loc13_16.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %ptr.loc13_30.2: type = ptr_type %T.ref.loc13 [symbolic = %ptr.loc13_30.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc13_30.2: Core.Form = init_form %ptr.loc13_30.2, call_param0 [symbolic = %.loc13_30.1 (constants.%.a9f)]
|
||||
// CHECK:STDOUT: %T.ref.loc13: type = name_ref T, %T.loc13_23.2 [symbolic = %T.loc13_23.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %ptr.loc13_37.2: type = ptr_type %T.ref.loc13 [symbolic = %ptr.loc13_37.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc13_37.2: Core.Form = init_form %ptr.loc13_37.2, call_param0 [symbolic = %.loc13_37.1 (constants.%.a9f)]
|
||||
// CHECK:STDOUT: %.Self.1: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %U.loc13_6.2: type = symbolic_binding U, 0 [symbolic = %U.loc13_6.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %U.loc13_13.2: type = symbolic_binding U, 0 [symbolic = %U.loc13_13.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %.Self.2: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %T.loc13_16.2: type = symbolic_binding T, 1 [symbolic = %T.loc13_16.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %return.param: ref @F.loc13.%ptr.loc13_30.1 (%ptr.18e) = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref @F.loc13.%ptr.loc13_30.1 (%ptr.18e) = return_slot %return.param
|
||||
// CHECK:STDOUT: %T.loc13_23.2: type = symbolic_binding T, 1 [symbolic = %T.loc13_23.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %return.param: ref @F.loc13.%ptr.loc13_37.1 (%ptr.18e) = out_param call_param0
|
||||
// CHECK:STDOUT: %return: ref @F.loc13.%ptr.loc13_37.1 (%ptr.18e) = return_slot %return.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -374,20 +374,20 @@ fn F(U:! type, T:! type) -> U* {
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc4.%ptr.loc4_30.1 (%ptr.e8f);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F.loc13(%U.loc13_6.2: type, %T.loc13_16.2: type) {
|
||||
// CHECK:STDOUT: %U.loc13_6.1: type = symbolic_binding U, 0 [symbolic = %U.loc13_6.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %T.loc13_16.1: type = symbolic_binding T, 1 [symbolic = %T.loc13_16.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %ptr.loc13_30.1: type = ptr_type %T.loc13_16.1 [symbolic = %ptr.loc13_30.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc13_30.1: Core.Form = init_form %ptr.loc13_30.1, call_param0 [symbolic = %.loc13_30.1 (constants.%.a9f)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc13_30.1 [symbolic = %pattern_type (constants.%pattern_type.423)]
|
||||
// CHECK:STDOUT: generic fn @F.loc13(%U.loc13_13.2: type, %T.loc13_23.2: type) {
|
||||
// CHECK:STDOUT: %U.loc13_13.1: type = symbolic_binding U, 0 [symbolic = %U.loc13_13.1 (constants.%U.67d)]
|
||||
// CHECK:STDOUT: %T.loc13_23.1: type = symbolic_binding T, 1 [symbolic = %T.loc13_23.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %ptr.loc13_37.1: type = ptr_type %T.loc13_23.1 [symbolic = %ptr.loc13_37.1 (constants.%ptr.18e)]
|
||||
// CHECK:STDOUT: %.loc13_37.1: Core.Form = init_form %ptr.loc13_37.1, call_param0 [symbolic = %.loc13_37.1 (constants.%.a9f)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr.loc13_37.1 [symbolic = %pattern_type (constants.%pattern_type.423)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc13_30.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %ptr.loc13_37.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc13.%ptr.loc13_30.1 (%ptr.18e) {
|
||||
// CHECK:STDOUT: fn() -> out %return.param: @F.loc13.%ptr.loc13_37.1 (%ptr.18e) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %F.ref: %F.type.117dbc.1 = name_ref F, file.%F.decl.loc4 [concrete = constants.%F.d98bd5.1]
|
||||
// CHECK:STDOUT: %T.ref.loc21: type = name_ref T, %T.loc13_16.2 [symbolic = %T.loc13_16.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: %T.ref.loc21: type = name_ref T, %T.loc13_23.2 [symbolic = %T.loc13_23.1 (constants.%T.091)]
|
||||
// CHECK:STDOUT: return <error>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -401,10 +401,10 @@ fn F(U:! type, T:! type) -> U* {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.loc13(constants.%U.67d, constants.%T.091) {
|
||||
// CHECK:STDOUT: %U.loc13_6.1 => constants.%U.67d
|
||||
// CHECK:STDOUT: %T.loc13_16.1 => constants.%T.091
|
||||
// CHECK:STDOUT: %ptr.loc13_30.1 => constants.%ptr.18e
|
||||
// CHECK:STDOUT: %.loc13_30.1 => constants.%.a9f
|
||||
// CHECK:STDOUT: %U.loc13_13.1 => constants.%U.67d
|
||||
// CHECK:STDOUT: %T.loc13_23.1 => constants.%T.091
|
||||
// CHECK:STDOUT: %ptr.loc13_37.1 => constants.%ptr.18e
|
||||
// CHECK:STDOUT: %.loc13_37.1 => constants.%.a9f
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.423
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+14
-14
@@ -24,10 +24,10 @@ fn ErrorIfNIsZero(N:! Core.IntLiteral()) {
|
||||
// CHECK:STDERR: min_prelude/parts/int.carbon:11:9: error: integer type width of 0 is not positive [IntWidthNotPositive]
|
||||
// CHECK:STDERR: adapt MakeInt(N);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+3]]:10: note: in `i0` used here [ResolvingSpecificHere]
|
||||
// CHECK:STDERR: var v: Core.Int(N);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
var v: Core.Int(N);
|
||||
// CHECK:STDERR: fail_todo_call_monomorphization_error.carbon:[[@LINE+3]]:17: note: in `i0` used here [ResolvingSpecificHere]
|
||||
// CHECK:STDERR: var unused v: Core.Int(N);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
var unused v: Core.Int(N);
|
||||
}
|
||||
|
||||
fn CallNegative() {
|
||||
@@ -117,11 +117,11 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: %N.loc4_19.1: Core.IntLiteral = symbolic_binding N, 0 [symbolic = %N.loc4_19.1 (constants.%N)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Int.loc15_20.2: type = class_type @Int, @Int(%N.loc4_19.1) [symbolic = %Int.loc15_20.2 (constants.%Int)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Int.loc15_20.2 [symbolic = %require_complete (constants.%require_complete.901)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %Int.loc15_20.2 [symbolic = %pattern_type (constants.%pattern_type.764)]
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %Int.loc15_20.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)]
|
||||
// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Int.loc15_20.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.1c0)]
|
||||
// CHECK:STDOUT: %Int.loc15_27.2: type = class_type @Int, @Int(%N.loc4_19.1) [symbolic = %Int.loc15_27.2 (constants.%Int)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Int.loc15_27.2 [symbolic = %require_complete (constants.%require_complete.901)]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %Int.loc15_27.2 [symbolic = %pattern_type (constants.%pattern_type.764)]
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness: <witness> = lookup_impl_witness %Int.loc15_27.2, @Destroy [symbolic = %Destroy.lookup_impl_witness (constants.%Destroy.lookup_impl_witness)]
|
||||
// CHECK:STDOUT: %Destroy.facet: %Destroy.type = facet_value %Int.loc15_27.2, (%Destroy.lookup_impl_witness) [symbolic = %Destroy.facet (constants.%Destroy.facet.1c0)]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type: type = fn_type @Destroy.WithSelf.Op, @Destroy(%Destroy.facet) [symbolic = %Destroy.WithSelf.Op.type (constants.%Destroy.WithSelf.Op.type.297)]
|
||||
// CHECK:STDOUT: %.loc15_3: type = fn_type_with_self_type %Destroy.WithSelf.Op.type, %Destroy.facet [symbolic = %.loc15_3 (constants.%.e63)]
|
||||
// CHECK:STDOUT: %impl.elem0.loc15_3.2: @ErrorIfNIsZero.%.loc15_3 (%.e63) = impl_witness_access %Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_3.2 (constants.%impl.elem0)]
|
||||
@@ -133,14 +133,14 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: %v.patt: @ErrorIfNIsZero.%pattern_type (%pattern_type.764) = ref_binding_pattern v [concrete]
|
||||
// CHECK:STDOUT: %v.var_patt: @ErrorIfNIsZero.%pattern_type (%pattern_type.764) = var_pattern %v.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = var %v.var_patt
|
||||
// CHECK:STDOUT: %.loc15_20: type = splice_block %Int.loc15_20.1 [symbolic = %Int.loc15_20.2 (constants.%Int)] {
|
||||
// CHECK:STDOUT: %v.var: ref @ErrorIfNIsZero.%Int.loc15_27.2 (%Int) = var %v.var_patt
|
||||
// CHECK:STDOUT: %.loc15_27: type = splice_block %Int.loc15_27.1 [symbolic = %Int.loc15_27.2 (constants.%Int)] {
|
||||
// CHECK:STDOUT: %Core.ref.loc15: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %Int.ref: %Int.type = name_ref Int, imports.%Core.Int [concrete = constants.%Int.generic]
|
||||
// CHECK:STDOUT: %N.ref: Core.IntLiteral = name_ref N, %N.loc4_19.2 [symbolic = %N.loc4_19.1 (constants.%N)]
|
||||
// CHECK:STDOUT: %Int.loc15_20.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc15_20.2 (constants.%Int)]
|
||||
// CHECK:STDOUT: %Int.loc15_27.1: type = class_type @Int, @Int(constants.%N) [symbolic = %Int.loc15_27.2 (constants.%Int)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int.loc15_20.2 (%Int) = ref_binding v, %v.var
|
||||
// CHECK:STDOUT: %v: ref @ErrorIfNIsZero.%Int.loc15_27.2 (%Int) = ref_binding v, %v.var
|
||||
// CHECK:STDOUT: %impl.elem0.loc15_3.1: @ErrorIfNIsZero.%.loc15_3 (%.e63) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc15_3.2 (constants.%impl.elem0)]
|
||||
// CHECK:STDOUT: %bound_method.loc15_3.1: <bound method> = bound_method %v.var, %impl.elem0.loc15_3.1
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc15_3.1: <specific function> = specific_impl_function %impl.elem0.loc15_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet.1c0) [symbolic = %specific_impl_fn.loc15_3.2 (constants.%specific_impl_fn)]
|
||||
@@ -169,7 +169,7 @@ fn CallNegative() {
|
||||
// CHECK:STDOUT: %N.loc4_19.1 => constants.%int_0
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %Int.loc15_20.2 => constants.%i0
|
||||
// CHECK:STDOUT: %Int.loc15_27.2 => constants.%i0
|
||||
// CHECK:STDOUT: %require_complete => constants.%complete_type.d94
|
||||
// CHECK:STDOUT: %pattern_type => constants.%pattern_type.47b
|
||||
// CHECK:STDOUT: %Destroy.lookup_impl_witness => constants.%custom_witness.809
|
||||
|
||||
+21
-21
@@ -19,9 +19,9 @@ class Wrap(T:! type) {
|
||||
class C { var arr: array(i32, 100); }
|
||||
|
||||
fn G() {
|
||||
var a: i32 = Wrap(i32).Make();
|
||||
var b: () = Wrap(()).Make();
|
||||
var c: C = Wrap(C).Make();
|
||||
var unused a: i32 = Wrap(i32).Make();
|
||||
var unused b: () = Wrap(()).Make();
|
||||
var unused c: C = Wrap(C).Make();
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- return_slot.carbon
|
||||
@@ -186,17 +186,17 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a.var: ref %i32 = var %a.var_patt
|
||||
// CHECK:STDOUT: %Wrap.ref.loc22: %Wrap.type = name_ref Wrap, file.%Wrap.decl [concrete = constants.%Wrap.generic]
|
||||
// CHECK:STDOUT: %int_32.loc22_21: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc22_21: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_32.loc22_28: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc22_28: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %Wrap.loc22: type = class_type @Wrap, @Wrap(constants.%i32) [concrete = constants.%Wrap.e80]
|
||||
// CHECK:STDOUT: %.loc22_25: %Wrap.Make.type.939 = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%i32) [concrete = constants.%Wrap.Make.6cb]
|
||||
// CHECK:STDOUT: %Make.ref.loc22: %Wrap.Make.type.939 = name_ref Make, %.loc22_25 [concrete = constants.%Wrap.Make.6cb]
|
||||
// CHECK:STDOUT: %.loc22_32: %Wrap.Make.type.939 = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%i32) [concrete = constants.%Wrap.Make.6cb]
|
||||
// CHECK:STDOUT: %Make.ref.loc22: %Wrap.Make.type.939 = name_ref Make, %.loc22_32 [concrete = constants.%Wrap.Make.6cb]
|
||||
// CHECK:STDOUT: %Wrap.Make.specific_fn.loc22: <specific function> = specific_function %Make.ref.loc22, @Wrap.Make(constants.%i32) [concrete = constants.%Wrap.Make.specific_fn.35c]
|
||||
// CHECK:STDOUT: %Wrap.Make.call.loc22: init %i32 = call %Wrap.Make.specific_fn.loc22()
|
||||
// CHECK:STDOUT: assign %a.var, %Wrap.Make.call.loc22
|
||||
// CHECK:STDOUT: %.loc22_10: type = splice_block %i32.loc22_10 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc22_10: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc22_10: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %.loc22_17: type = splice_block %i32.loc22_17 [concrete = constants.%i32] {
|
||||
// CHECK:STDOUT: %int_32.loc22_17: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %i32.loc22_17: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %a: ref %i32 = ref_binding a, %a.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -205,17 +205,17 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b.var: ref %empty_tuple.type = var %b.var_patt
|
||||
// CHECK:STDOUT: %Wrap.ref.loc23: %Wrap.type = name_ref Wrap, file.%Wrap.decl [concrete = constants.%Wrap.generic]
|
||||
// CHECK:STDOUT: %.loc23_21: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc23_22: type = converted %.loc23_21, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc23_28: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc23_29: type = converted %.loc23_28, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %Wrap.loc23: type = class_type @Wrap, @Wrap(constants.%empty_tuple.type) [concrete = constants.%Wrap.0f1]
|
||||
// CHECK:STDOUT: %.loc23_23: %Wrap.Make.type.fb0 = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%empty_tuple.type) [concrete = constants.%Wrap.Make.b5c]
|
||||
// CHECK:STDOUT: %Make.ref.loc23: %Wrap.Make.type.fb0 = name_ref Make, %.loc23_23 [concrete = constants.%Wrap.Make.b5c]
|
||||
// CHECK:STDOUT: %.loc23_30: %Wrap.Make.type.fb0 = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%empty_tuple.type) [concrete = constants.%Wrap.Make.b5c]
|
||||
// CHECK:STDOUT: %Make.ref.loc23: %Wrap.Make.type.fb0 = name_ref Make, %.loc23_30 [concrete = constants.%Wrap.Make.b5c]
|
||||
// CHECK:STDOUT: %Wrap.Make.specific_fn.loc23: <specific function> = specific_function %Make.ref.loc23, @Wrap.Make(constants.%empty_tuple.type) [concrete = constants.%Wrap.Make.specific_fn.c03]
|
||||
// CHECK:STDOUT: %Wrap.Make.call.loc23: init %empty_tuple.type = call %Wrap.Make.specific_fn.loc23()
|
||||
// CHECK:STDOUT: assign %b.var, %Wrap.Make.call.loc23
|
||||
// CHECK:STDOUT: %.loc23_11.1: type = splice_block %.loc23_11.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc23_11.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc23_11.3: type = converted %.loc23_11.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: %.loc23_18.1: type = splice_block %.loc23_18.3 [concrete = constants.%empty_tuple.type] {
|
||||
// CHECK:STDOUT: %.loc23_18.2: %empty_tuple.type = tuple_literal () [concrete = constants.%empty_tuple]
|
||||
// CHECK:STDOUT: %.loc23_18.3: type = converted %.loc23_18.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %b: ref %empty_tuple.type = ref_binding b, %b.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
@@ -224,15 +224,15 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %C = var %c.var_patt
|
||||
// CHECK:STDOUT: %Wrap.ref.loc24: %Wrap.type = name_ref Wrap, file.%Wrap.decl [concrete = constants.%Wrap.generic]
|
||||
// CHECK:STDOUT: %C.ref.loc24_19: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %C.ref.loc24_26: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %Wrap.loc24: type = class_type @Wrap, @Wrap(constants.%C) [concrete = constants.%Wrap.3b1]
|
||||
// CHECK:STDOUT: %.loc24_21: %Wrap.Make.type.a8f = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%C) [concrete = constants.%Wrap.Make.62a]
|
||||
// CHECK:STDOUT: %Make.ref.loc24: %Wrap.Make.type.a8f = name_ref Make, %.loc24_21 [concrete = constants.%Wrap.Make.62a]
|
||||
// CHECK:STDOUT: %.loc24_28: %Wrap.Make.type.a8f = specific_constant @Wrap.%Wrap.Make.decl, @Wrap(constants.%C) [concrete = constants.%Wrap.Make.62a]
|
||||
// CHECK:STDOUT: %Make.ref.loc24: %Wrap.Make.type.a8f = name_ref Make, %.loc24_28 [concrete = constants.%Wrap.Make.62a]
|
||||
// CHECK:STDOUT: %Wrap.Make.specific_fn.loc24: <specific function> = specific_function %Make.ref.loc24, @Wrap.Make(constants.%C) [concrete = constants.%Wrap.Make.specific_fn.cb9]
|
||||
// CHECK:STDOUT: %.loc24_3: ref %C = splice_block %c.var {}
|
||||
// CHECK:STDOUT: %Wrap.Make.call.loc24: init %C to %.loc24_3 = call %Wrap.Make.specific_fn.loc24()
|
||||
// CHECK:STDOUT: assign %c.var, %Wrap.Make.call.loc24
|
||||
// CHECK:STDOUT: %C.ref.loc24_10: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %C.ref.loc24_17: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %c: ref %C = ref_binding c, %c.var
|
||||
// CHECK:STDOUT: %DestroyOp.bound.loc24: <bound method> = bound_method %c.var, constants.%DestroyOp.b0ebf8.1
|
||||
// CHECK:STDOUT: %DestroyOp.call.loc24: init %empty_tuple.type = call %DestroyOp.bound.loc24(%c.var)
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn F(template T:! type) {
|
||||
fn F(unused template T:! type) {
|
||||
}
|
||||
|
||||
fn G() {
|
||||
@@ -49,13 +49,13 @@ fn G() {
|
||||
// CHECK:STDOUT: %T.patt: %pattern_type = symbolic_binding_pattern T, 0, template [concrete]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %.Self: %type = symbolic_binding .Self [symbolic_self = constants.%.Self]
|
||||
// CHECK:STDOUT: %T.loc4_15.2: type = symbolic_binding T, 0, template [template = %T.loc4_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.loc4_22.2: type = symbolic_binding T, 0, template [template = %T.loc4_22.1 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %G.decl: %G.type = fn_decl @G [concrete = constants.%G] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc4_15.2: type) {
|
||||
// CHECK:STDOUT: %T.loc4_15.1: type = symbolic_binding T, 0, template [template = %T.loc4_15.1 (constants.%T)]
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc4_22.2: type) {
|
||||
// CHECK:STDOUT: %T.loc4_22.1: type = symbolic_binding T, 0, template [template = %T.loc4_22.1 (constants.%T)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT:
|
||||
@@ -76,11 +76,11 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc4_15.1 => constants.%T
|
||||
// CHECK:STDOUT: %T.loc4_22.1 => constants.%T
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%empty_struct_type) {
|
||||
// CHECK:STDOUT: %T.loc4_15.1 => constants.%empty_struct_type
|
||||
// CHECK:STDOUT: %T.loc4_22.1 => constants.%empty_struct_type
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
fn F(T:! type) {
|
||||
var p: T*;
|
||||
let n: T = *p;
|
||||
let unused n: T = *p;
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- type_param.carbon
|
||||
@@ -96,11 +96,11 @@ fn F(T:! type) {
|
||||
// CHECK:STDOUT: %n.patt: @F.%pattern_type.loc17 (%pattern_type.51d) = value_binding_pattern n [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %p.ref: ref @F.%ptr.loc16_11.2 (%ptr) = name_ref p, %p
|
||||
// CHECK:STDOUT: %.loc17_15: @F.%ptr.loc16_11.2 (%ptr) = acquire_value %p.ref
|
||||
// CHECK:STDOUT: %.loc17_14.1: ref @F.%T.loc15_6.1 (%T) = deref %.loc17_15
|
||||
// CHECK:STDOUT: %.loc17_22: @F.%ptr.loc16_11.2 (%ptr) = acquire_value %p.ref
|
||||
// CHECK:STDOUT: %.loc17_21.1: ref @F.%T.loc15_6.1 (%T) = deref %.loc17_22
|
||||
// CHECK:STDOUT: %T.ref.loc17: type = name_ref T, %T.loc15_6.2 [symbolic = %T.loc15_6.1 (constants.%T)]
|
||||
// CHECK:STDOUT: %.loc17_14.2: @F.%T.loc15_6.1 (%T) = acquire_value %.loc17_14.1
|
||||
// CHECK:STDOUT: %n: @F.%T.loc15_6.1 (%T) = value_binding n, %.loc17_14.2
|
||||
// CHECK:STDOUT: %.loc17_21.2: @F.%T.loc15_6.1 (%T) = acquire_value %.loc17_21.1
|
||||
// CHECK:STDOUT: %n: @F.%T.loc15_6.1 (%T) = value_binding n, %.loc17_21.2
|
||||
// CHECK:STDOUT: %impl.elem0.loc16_3.1: @F.%.loc16_3 (%.c3f) = impl_witness_access constants.%Destroy.lookup_impl_witness, element0 [symbolic = %impl.elem0.loc16_3.2 (constants.%impl.elem0)]
|
||||
// CHECK:STDOUT: %bound_method.loc16_3.1: <bound method> = bound_method %p.var, %impl.elem0.loc16_3.1
|
||||
// CHECK:STDOUT: %specific_impl_fn.loc16_3.1: <specific function> = specific_impl_function %impl.elem0.loc16_3.1, @Destroy.WithSelf.Op(constants.%Destroy.facet) [symbolic = %specific_impl_fn.loc16_3.2 (constants.%specific_impl_fn)]
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
fn Defined[T:! type](x: T) {}
|
||||
fn Defined[T:! type](unused x: T) {}
|
||||
|
||||
fn CallDefined() {
|
||||
Defined(0 as i32);
|
||||
@@ -30,7 +30,7 @@ fn CallDefined() {
|
||||
Defined(0 as i32);
|
||||
}
|
||||
|
||||
fn Defined[T:! type](x: T) {}
|
||||
fn Defined[T:! type](unused x: T) {}
|
||||
|
||||
// --- fail_call_undefined.carbon
|
||||
|
||||
|
||||
Reference in New Issue
Block a user