mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Prepare tests for adding a prelude dependency to destruction (#5346)
Adds an empty `min_prelude/destroy.carbon` in anticipation of turning it into an interface. Update `no_prelude` tests to be `min_prelude` and import it where needed; in some cases, modify the file to remove the dependency (i.e., rewrite code to have nothing to destruct).
This commit is contained in:
+36
-19
@@ -2,11 +2,14 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/min_prelude/destroy.carbon
|
||||
// EXTRA-ARGS: --custom-core
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/min_prelude/as_type_of_type.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/as_type_of_type.carbon
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/min_prelude/as_type_of_type.carbon
|
||||
|
||||
interface Empty {}
|
||||
|
||||
@@ -27,17 +30,25 @@ fn F(T:! Empty) {
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type [symbolic]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .Empty = %Empty.decl
|
||||
// CHECK:STDOUT: .F = %F.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %Empty.decl: type = interface_decl @Empty [concrete = constants.%Empty.type] {} {}
|
||||
// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {
|
||||
// CHECK:STDOUT: %T.patt.loc13_6.1: %Empty.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_6.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: %T.patt.loc16_6.1: %Empty.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc16_6.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %Empty.ref: type = name_ref Empty, file.%Empty.decl [concrete = constants.%Empty.type]
|
||||
// CHECK:STDOUT: %T.loc13_6.1: %Empty.type = bind_symbolic_name T, 0 [symbolic = %T.loc13_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.loc16_6.1: %Empty.type = bind_symbolic_name T, 0 [symbolic = %T.loc16_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -49,33 +60,39 @@ fn F(T:! Empty) {
|
||||
// CHECK:STDOUT: witness = ()
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc13_6.1: %Empty.type) {
|
||||
// CHECK:STDOUT: %T.loc13_6.2: %Empty.type = bind_symbolic_name T, 0 [symbolic = %T.loc13_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt.loc13_6.2: %Empty.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc13_6.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT: generic fn @F(%T.loc16_6.1: %Empty.type) {
|
||||
// CHECK:STDOUT: %T.loc16_6.2: %Empty.type = bind_symbolic_name T, 0 [symbolic = %T.loc16_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.patt.loc16_6.2: %Empty.type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc16_6.2 (constants.%T.patt)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %T.as_type.loc14_10.2: type = facet_access_type %T.loc13_6.2 [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc14_10.2 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %T.as_type.loc17_10.2: type = facet_access_type %T.loc16_6.2 [symbolic = %T.as_type.loc17_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %T.as_type.loc17_10.2 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %x.patt: @F.%T.as_type.loc14_10.2 (%T.as_type) = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc14_3: @F.%T.as_type.loc14_10.2 (%T.as_type) = var_pattern %x.patt
|
||||
// CHECK:STDOUT: %x.patt: @F.%T.as_type.loc17_10.2 (%T.as_type) = binding_pattern x
|
||||
// CHECK:STDOUT: %.loc17_3: @F.%T.as_type.loc17_10.2 (%T.as_type) = var_pattern %x.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x.var: ref @F.%T.as_type.loc14_10.2 (%T.as_type) = var x
|
||||
// CHECK:STDOUT: %.loc14_10.1: type = splice_block %.loc14_10.2 [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)] {
|
||||
// CHECK:STDOUT: %T.ref: %Empty.type = name_ref T, %T.loc13_6.1 [symbolic = %T.loc13_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.as_type.loc14_10.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc14_10.2: type = converted %T.ref, %T.as_type.loc14_10.1 [symbolic = %T.as_type.loc14_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %x.var: ref @F.%T.as_type.loc17_10.2 (%T.as_type) = var x
|
||||
// CHECK:STDOUT: %.loc17_10.1: type = splice_block %.loc17_10.2 [symbolic = %T.as_type.loc17_10.2 (constants.%T.as_type)] {
|
||||
// CHECK:STDOUT: %T.ref: %Empty.type = name_ref T, %T.loc16_6.1 [symbolic = %T.loc16_6.2 (constants.%T)]
|
||||
// CHECK:STDOUT: %T.as_type.loc17_10.1: type = facet_access_type %T.ref [symbolic = %T.as_type.loc17_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: %.loc17_10.2: type = converted %T.ref, %T.as_type.loc17_10.1 [symbolic = %T.as_type.loc17_10.2 (constants.%T.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %x: ref @F.%T.as_type.loc14_10.2 (%T.as_type) = bind_name x, %x.var
|
||||
// CHECK:STDOUT: %x: ref @F.%T.as_type.loc17_10.2 (%T.as_type) = bind_name x, %x.var
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F(constants.%T) {
|
||||
// CHECK:STDOUT: %T.loc13_6.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc13_6.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: %T.loc16_6.2 => constants.%T
|
||||
// CHECK:STDOUT: %T.patt.loc16_6.2 => constants.%T.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- include_files/destroy.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
+38
-21
@@ -2,11 +2,14 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/min_prelude/destroy.carbon
|
||||
// EXTRA-ARGS: --custom-core
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/default_fn.carbon
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/min_prelude/default_fn.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/default_fn.carbon
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/min_prelude/default_fn.carbon
|
||||
|
||||
class C {
|
||||
interface I {
|
||||
@@ -46,26 +49,34 @@ class C {
|
||||
// CHECK:STDOUT: %.e5b: type = fn_type_with_self_type %F.type.0b5, %I.facet [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @I {
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
|
||||
// CHECK:STDOUT: %F.decl: %F.type.0b5 = fn_decl @F.1 [concrete = constants.%F.20c] {
|
||||
// CHECK:STDOUT: %self.patt: @F.1.%Self.as_type.loc14_16.1 (%Self.as_type) = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: @F.1.%Self.as_type.loc14_16.1 (%Self.as_type) = value_param_pattern %self.patt, call_param0
|
||||
// CHECK:STDOUT: %self.patt: @F.1.%Self.as_type.loc17_16.1 (%Self.as_type) = binding_pattern self
|
||||
// CHECK:STDOUT: %self.param_patt: @F.1.%Self.as_type.loc17_16.1 (%Self.as_type) = value_param_pattern %self.patt, call_param0
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc14_16.1 (%Self.as_type) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc14_16.1: type = splice_block %.loc14_16.2 [symbolic = %Self.as_type.loc14_16.1 (constants.%Self.as_type)] {
|
||||
// CHECK:STDOUT: %self.param: @F.1.%Self.as_type.loc17_16.1 (%Self.as_type) = value_param call_param0
|
||||
// CHECK:STDOUT: %.loc17_16.1: type = splice_block %.loc17_16.2 [symbolic = %Self.as_type.loc17_16.1 (constants.%Self.as_type)] {
|
||||
// CHECK:STDOUT: %Self.ref: %I.type = name_ref Self, @I.%Self [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc14_16.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc14_16.1 (constants.%Self.as_type)]
|
||||
// CHECK:STDOUT: %.loc14_16.2: type = converted %Self.ref, %Self.as_type.loc14_16.2 [symbolic = %Self.as_type.loc14_16.1 (constants.%Self.as_type)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_16.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc17_16.1 (constants.%Self.as_type)]
|
||||
// CHECK:STDOUT: %.loc17_16.2: type = converted %Self.ref, %Self.as_type.loc17_16.2 [symbolic = %Self.as_type.loc17_16.1 (constants.%Self.as_type)]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %self: @F.1.%Self.as_type.loc14_16.1 (%Self.as_type) = bind_name self, %self.param
|
||||
// CHECK:STDOUT: %self: @F.1.%Self.as_type.loc17_16.1 (%Self.as_type) = bind_name self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0]
|
||||
// CHECK:STDOUT:
|
||||
@@ -112,22 +123,22 @@ class C {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generic fn @F.1(@I.%Self: %I.type) {
|
||||
// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = %Self (constants.%Self)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc14_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc14_16.1 (constants.%Self.as_type)]
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_16.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc17_16.1 (constants.%Self.as_type)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !definition:
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type.loc14_16.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT: %require_complete: <witness> = require_complete_type %Self.as_type.loc17_16.1 [symbolic = %require_complete (constants.%require_complete)]
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn(%self.param: @F.1.%Self.as_type.loc14_16.1 (%Self.as_type)) {
|
||||
// CHECK:STDOUT: fn(%self.param: @F.1.%Self.as_type.loc17_16.1 (%Self.as_type)) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %C = binding_pattern c
|
||||
// CHECK:STDOUT: %.loc16_7.1: %C = var_pattern %c.patt
|
||||
// CHECK:STDOUT: %.loc19_7.1: %C = var_pattern %c.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.var: ref %C = var c
|
||||
// CHECK:STDOUT: %.loc16_19.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc16_19.2: init %C = class_init (), %c.var [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: %.loc16_7.2: init %C = converted %.loc16_19.1, %.loc16_19.2 [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: assign %c.var, %.loc16_7.2
|
||||
// CHECK:STDOUT: %.loc19_19.1: %empty_struct_type = struct_literal ()
|
||||
// CHECK:STDOUT: %.loc19_19.2: init %C = class_init (), %c.var [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: %.loc19_7.2: init %C = converted %.loc19_19.1, %.loc19_19.2 [concrete = constants.%C.val]
|
||||
// CHECK:STDOUT: assign %c.var, %.loc19_7.2
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %c: ref %C = bind_name c, %c.var
|
||||
// CHECK:STDOUT: %c.ref: ref %C = name_ref c, %c
|
||||
@@ -135,8 +146,8 @@ class C {
|
||||
// CHECK:STDOUT: %F.ref: %I.assoc_type = name_ref F, @I.%assoc0 [concrete = constants.%assoc0]
|
||||
// CHECK:STDOUT: %impl.elem0: %.e5b = impl_witness_access constants.%I.impl_witness, element0 [concrete = constants.%F.eb2]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %c.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %.loc17: %C = bind_value %c.ref
|
||||
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %bound_method(%.loc17)
|
||||
// CHECK:STDOUT: %.loc20: %C = bind_value %c.ref
|
||||
// CHECK:STDOUT: %F.call: init %empty_tuple.type = call %bound_method(%.loc20)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
@@ -148,11 +159,17 @@ class C {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.1(constants.%Self) {
|
||||
// CHECK:STDOUT: %Self => constants.%Self
|
||||
// CHECK:STDOUT: %Self.as_type.loc14_16.1 => constants.%Self.as_type
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_16.1 => constants.%Self.as_type
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: specific @F.1(constants.%I.facet) {
|
||||
// CHECK:STDOUT: %Self => constants.%I.facet
|
||||
// CHECK:STDOUT: %Self.as_type.loc14_16.1 => constants.%C
|
||||
// CHECK:STDOUT: %Self.as_type.loc17_16.1 => constants.%C
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- include_files/destroy.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
+12
-2
@@ -2,11 +2,14 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/min_prelude/destroy.carbon
|
||||
// EXTRA-ARGS: --custom-core
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/min_prelude/fail_member_lookup.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_member_lookup.carbon
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/min_prelude/fail_member_lookup.carbon
|
||||
|
||||
// --- core.carbon
|
||||
package Core;
|
||||
@@ -184,6 +187,7 @@ fn G(U:! Different) -> U.(Interface.T);
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: import Core//default
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//default, loc3_22, loaded [symbolic = @ImplicitAs.%Dest (constants.%Dest)]
|
||||
@@ -345,3 +349,9 @@ fn G(U:! Different) -> U.(Interface.T);
|
||||
// CHECK:STDOUT: %U.patt.loc34_6.2 => constants.%U.patt
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- include_files/destroy.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
+27
-2
@@ -2,11 +2,14 @@
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// INCLUDE-FILE: toolchain/testing/min_prelude/destroy.carbon
|
||||
// EXTRA-ARGS: --custom-core
|
||||
//
|
||||
// AUTOUPDATE
|
||||
// TIP: To test this file alone, run:
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/generic_method.carbon
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/min_prelude/generic_method.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/generic_method.carbon
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/min_prelude/generic_method.carbon
|
||||
|
||||
// --- generic_method_fewer_params.carbon
|
||||
|
||||
@@ -146,8 +149,15 @@ fn CallIndirect() {
|
||||
// CHECK:STDOUT: %tuple.type.9c8: type = tuple_type (%empty_struct_type, %empty_struct_type, %Z) [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .A = %A.decl
|
||||
// CHECK:STDOUT: .X = %X.decl
|
||||
// CHECK:STDOUT: .Y = %Y.decl
|
||||
@@ -156,6 +166,7 @@ fn CallIndirect() {
|
||||
// CHECK:STDOUT: .CallGeneric = %CallGeneric.decl
|
||||
// CHECK:STDOUT: .CallIndirect = %CallIndirect.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %A.decl: %A.type.495 = interface_decl @A [concrete = constants.%A.generic] {
|
||||
// CHECK:STDOUT: %T.patt.loc5_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.e01)]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -604,8 +615,15 @@ fn CallIndirect() {
|
||||
// CHECK:STDOUT: %complete_type.4d1: <witness> = complete_type_witness %tuple.type.a46 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [concrete] {
|
||||
// CHECK:STDOUT: import Core//prelude
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
||||
// CHECK:STDOUT: .Core = imports.%Core
|
||||
// CHECK:STDOUT: .A = %A.decl
|
||||
// CHECK:STDOUT: .X = %X.decl
|
||||
// CHECK:STDOUT: .Y1 = %Y1.decl
|
||||
@@ -615,6 +633,7 @@ fn CallIndirect() {
|
||||
// CHECK:STDOUT: .CallGeneric = %CallGeneric.decl
|
||||
// CHECK:STDOUT: .CallIndirect = %CallIndirect.decl
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.import = import Core
|
||||
// CHECK:STDOUT: %A.decl: %A.type.495 = interface_decl @A [concrete = constants.%A.generic] {
|
||||
// CHECK:STDOUT: %T.patt.loc5_13.1: type = symbolic_binding_pattern T, 0 [symbolic = %T.patt.loc5_13.2 (constants.%T.patt.e01)]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -1122,3 +1141,9 @@ fn CallIndirect() {
|
||||
// CHECK:STDOUT: %tuple.type.loc6_38.2 => constants.%tuple.type.415
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- include_files/destroy.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: file {
|
||||
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
Reference in New Issue
Block a user