diff --git a/toolchain/check/testdata/alias/no_prelude/basics.carbon b/toolchain/check/testdata/alias/basics.carbon similarity index 97% rename from toolchain/check/testdata/alias/no_prelude/basics.carbon rename to toolchain/check/testdata/alias/basics.carbon index 85f7fac57984..8ebdfa4169bc 100644 --- a/toolchain/check/testdata/alias/no_prelude/basics.carbon +++ b/toolchain/check/testdata/alias/basics.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/no_prelude/basics.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/basics.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/no_prelude/basics.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/basics.carbon // --- alias.carbon diff --git a/toolchain/check/testdata/alias/no_prelude/export_name.carbon b/toolchain/check/testdata/alias/export_name.carbon similarity index 98% rename from toolchain/check/testdata/alias/no_prelude/export_name.carbon rename to toolchain/check/testdata/alias/export_name.carbon index d2e3b58bfe04..f3d132d7abdc 100644 --- a/toolchain/check/testdata/alias/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/alias/export_name.carbon @@ -2,13 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/no_prelude/export_name.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/export_name.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/no_prelude/export_name.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/export_name.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/alias/no_prelude/import.carbon b/toolchain/check/testdata/alias/import.carbon similarity index 98% rename from toolchain/check/testdata/alias/no_prelude/import.carbon rename to toolchain/check/testdata/alias/import.carbon index 82508f7d5c87..925c90899272 100644 --- a/toolchain/check/testdata/alias/no_prelude/import.carbon +++ b/toolchain/check/testdata/alias/import.carbon @@ -2,13 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/no_prelude/import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/no_prelude/import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/import.carbon // --- class1.carbon diff --git a/toolchain/check/testdata/alias/no_prelude/import_access.carbon b/toolchain/check/testdata/alias/import_access.carbon similarity index 97% rename from toolchain/check/testdata/alias/no_prelude/import_access.carbon rename to toolchain/check/testdata/alias/import_access.carbon index b68c33846388..8bb9b826a57c 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/alias/import_access.carbon @@ -2,13 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/no_prelude/import_access.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/import_access.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/no_prelude/import_access.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/import_access.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/alias/no_prelude/import_order.carbon b/toolchain/check/testdata/alias/import_order.carbon similarity index 98% rename from toolchain/check/testdata/alias/no_prelude/import_order.carbon rename to toolchain/check/testdata/alias/import_order.carbon index ffb5e1c0a34d..7c85511cb798 100644 --- a/toolchain/check/testdata/alias/no_prelude/import_order.carbon +++ b/toolchain/check/testdata/alias/import_order.carbon @@ -2,13 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/no_prelude/import_order.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/import_order.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/no_prelude/import_order.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/import_order.carbon // --- a.carbon diff --git a/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon b/toolchain/check/testdata/alias/in_namespace.carbon similarity index 92% rename from toolchain/check/testdata/alias/no_prelude/in_namespace.carbon rename to toolchain/check/testdata/alias/in_namespace.carbon index 4b06b8436a12..5549d844ebfb 100644 --- a/toolchain/check/testdata/alias/no_prelude/in_namespace.carbon +++ b/toolchain/check/testdata/alias/in_namespace.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/no_prelude/in_namespace.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/in_namespace.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/no_prelude/in_namespace.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/in_namespace.carbon // --- in_namespace.carbon diff --git a/toolchain/check/testdata/alias/no_prelude/preserve_in_type_printing.carbon b/toolchain/check/testdata/alias/preserve_in_type_printing.carbon similarity index 92% rename from toolchain/check/testdata/alias/no_prelude/preserve_in_type_printing.carbon rename to toolchain/check/testdata/alias/preserve_in_type_printing.carbon index 88fbd1688ce7..803bd2e668ba 100644 --- a/toolchain/check/testdata/alias/no_prelude/preserve_in_type_printing.carbon +++ b/toolchain/check/testdata/alias/preserve_in_type_printing.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/no_prelude/preserve_in_type_printing.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/alias/preserve_in_type_printing.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/no_prelude/preserve_in_type_printing.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/alias/preserve_in_type_printing.carbon // --- fail_alias_nested_in_type.carbon diff --git a/toolchain/check/testdata/array/no_prelude/basics.carbon b/toolchain/check/testdata/array/basics.carbon similarity index 99% rename from toolchain/check/testdata/array/no_prelude/basics.carbon rename to toolchain/check/testdata/array/basics.carbon index fd5cae291412..3e532c10ce4c 100644 --- a/toolchain/check/testdata/array/no_prelude/basics.carbon +++ b/toolchain/check/testdata/array/basics.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/array/no_prelude/basics.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/array/basics.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/no_prelude/basics.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/basics.carbon // --- assign_var.carbon diff --git a/toolchain/check/testdata/array/no_prelude/element_mismatches.carbon b/toolchain/check/testdata/array/element_mismatches.carbon similarity index 92% rename from toolchain/check/testdata/array/no_prelude/element_mismatches.carbon rename to toolchain/check/testdata/array/element_mismatches.carbon index 1e4f98f794c0..d167c7bd304e 100644 --- a/toolchain/check/testdata/array/no_prelude/element_mismatches.carbon +++ b/toolchain/check/testdata/array/element_mismatches.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/array/no_prelude/element_mismatches.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/array/element_mismatches.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/no_prelude/element_mismatches.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/array/element_mismatches.carbon // --- fail_arg_wrong_type.carbon diff --git a/toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges.carbon b/toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon similarity index 98% rename from toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges.carbon rename to toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon index 7c546e08e8f3..f77f52edf6f8 100644 --- a/toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges.carbon +++ b/toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon @@ -9,9 +9,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/dump_sem_ir_ranges.carbon // --- function.carbon diff --git a/toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges_ignore.carbon b/toolchain/check/testdata/basics/dump_sem_ir_ranges_ignore.carbon similarity index 88% rename from toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges_ignore.carbon rename to toolchain/check/testdata/basics/dump_sem_ir_ranges_ignore.carbon index 3148d88e040e..8a126a530e3e 100644 --- a/toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges_ignore.carbon +++ b/toolchain/check/testdata/basics/dump_sem_ir_ranges_ignore.carbon @@ -2,13 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// EXTRA-ARGS: --dump-sem-ir-ranges=ignore +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=ignore // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges_ignore.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/dump_sem_ir_ranges_ignore.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges_ignore.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/dump_sem_ir_ranges_ignore.carbon // --- with-range.carbon diff --git a/toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges_only.carbon b/toolchain/check/testdata/basics/dump_sem_ir_ranges_only.carbon similarity index 85% rename from toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges_only.carbon rename to toolchain/check/testdata/basics/dump_sem_ir_ranges_only.carbon index 42502f80919a..c10de97afa1c 100644 --- a/toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges_only.carbon +++ b/toolchain/check/testdata/basics/dump_sem_ir_ranges_only.carbon @@ -5,11 +5,13 @@ // This tests `--dump-sem-ir-range=only` behavior, which is set implicitly by // file_test. // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges_only.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/dump_sem_ir_ranges_only.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/dump_sem_ir_ranges_only.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/dump_sem_ir_ranges_only.carbon // --- with-range.carbon diff --git a/toolchain/check/testdata/basics/no_prelude/duplicate_name_same_line.carbon b/toolchain/check/testdata/basics/duplicate_name_same_line.carbon similarity index 58% rename from toolchain/check/testdata/basics/no_prelude/duplicate_name_same_line.carbon rename to toolchain/check/testdata/basics/duplicate_name_same_line.carbon index 90e51653cc75..b3efe7ec3f69 100644 --- a/toolchain/check/testdata/basics/no_prelude/duplicate_name_same_line.carbon +++ b/toolchain/check/testdata/basics/duplicate_name_same_line.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/duplicate_name_same_line.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/duplicate_name_same_line.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/duplicate_name_same_line.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/duplicate_name_same_line.carbon fn A() { if (true) { @@ -31,28 +33,28 @@ fn A() { // CHECK:STDOUT: // CHECK:STDOUT: !if.then: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %n.patt.loc16_9: %pattern_type = binding_pattern n [concrete] -// CHECK:STDOUT: %n.var_patt.loc16_5: %pattern_type = var_pattern %n.patt.loc16_9 [concrete] +// CHECK:STDOUT: %n.patt.loc18_9: %pattern_type = binding_pattern n [concrete] +// CHECK:STDOUT: %n.var_patt.loc18_5: %pattern_type = var_pattern %n.patt.loc18_9 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %n.var.loc16_5: ref %empty_tuple.type = var %n.var_patt.loc16_5 -// CHECK:STDOUT: %.loc16_13.1: type = splice_block %.loc16_13.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc16_13.2: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc16_13.3: type = converted %.loc16_13.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %n.var.loc18_5: ref %empty_tuple.type = var %n.var_patt.loc18_5 +// CHECK:STDOUT: %.loc18_13.1: type = splice_block %.loc18_13.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc18_13.2: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc18_13.3: type = converted %.loc18_13.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %n.loc16_9: ref %empty_tuple.type = bind_name n, %n.var.loc16_5 +// CHECK:STDOUT: %n.loc18_9: ref %empty_tuple.type = bind_name n, %n.var.loc18_5 // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !if.else: // CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %n.patt.loc16_29: %pattern_type = binding_pattern n [concrete] -// CHECK:STDOUT: %n.var_patt.loc16_25: %pattern_type = var_pattern %n.patt.loc16_29 [concrete] +// CHECK:STDOUT: %n.patt.loc18_29: %pattern_type = binding_pattern n [concrete] +// CHECK:STDOUT: %n.var_patt.loc18_25: %pattern_type = var_pattern %n.patt.loc18_29 [concrete] // CHECK:STDOUT: } -// CHECK:STDOUT: %n.var.loc16_25: ref %empty_tuple.type = var %n.var_patt.loc16_25 -// CHECK:STDOUT: %.loc16_33.1: type = splice_block %.loc16_33.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc16_33.2: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc16_33.3: type = converted %.loc16_33.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %n.var.loc18_25: ref %empty_tuple.type = var %n.var_patt.loc18_25 +// CHECK:STDOUT: %.loc18_33.1: type = splice_block %.loc18_33.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc18_33.2: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc18_33.3: type = converted %.loc18_33.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: } -// CHECK:STDOUT: %n.loc16_29: ref %empty_tuple.type = bind_name n, %n.var.loc16_25 +// CHECK:STDOUT: %n.loc18_29: ref %empty_tuple.type = bind_name n, %n.var.loc18_25 // CHECK:STDOUT: // CHECK:STDOUT: // CHECK:STDOUT: !if.done: diff --git a/toolchain/check/testdata/basics/no_prelude/empty.carbon b/toolchain/check/testdata/basics/empty.carbon similarity index 81% rename from toolchain/check/testdata/basics/no_prelude/empty.carbon rename to toolchain/check/testdata/basics/empty.carbon index 438437437260..553ba6521aa5 100644 --- a/toolchain/check/testdata/basics/no_prelude/empty.carbon +++ b/toolchain/check/testdata/basics/empty.carbon @@ -2,13 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/empty.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/empty.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/empty.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/empty.carbon // --- empty.carbon diff --git a/toolchain/check/testdata/basics/no_prelude/multi_error.carbon b/toolchain/check/testdata/basics/multi_error.carbon similarity index 91% rename from toolchain/check/testdata/basics/no_prelude/multi_error.carbon rename to toolchain/check/testdata/basics/multi_error.carbon index e1c95c7c09fc..65547d6c7a12 100644 --- a/toolchain/check/testdata/basics/no_prelude/multi_error.carbon +++ b/toolchain/check/testdata/basics/multi_error.carbon @@ -2,13 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/multi_error.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/multi_error.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/multi_error.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/multi_error.carbon // --- fail_multi_error.carbon diff --git a/toolchain/check/testdata/basics/no_prelude/name_lookup.carbon b/toolchain/check/testdata/basics/name_lookup.carbon similarity index 91% rename from toolchain/check/testdata/basics/no_prelude/name_lookup.carbon rename to toolchain/check/testdata/basics/name_lookup.carbon index 733109796023..caf65865a104 100644 --- a/toolchain/check/testdata/basics/no_prelude/name_lookup.carbon +++ b/toolchain/check/testdata/basics/name_lookup.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/name_lookup.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/name_lookup.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/name_lookup.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/name_lookup.carbon // --- fail_not_found.carbon diff --git a/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon b/toolchain/check/testdata/basics/raw_identifier.carbon similarity index 96% rename from toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon rename to toolchain/check/testdata/basics/raw_identifier.carbon index b5e595374e13..92dc9665e92c 100644 --- a/toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon +++ b/toolchain/check/testdata/basics/raw_identifier.carbon @@ -2,13 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/raw_identifier.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/raw_identifier.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/raw_identifier.carbon fn A(n: ()) -> () { return r#n; diff --git a/toolchain/check/testdata/basics/no_prelude/verbose.carbon b/toolchain/check/testdata/basics/verbose.carbon similarity index 88% rename from toolchain/check/testdata/basics/no_prelude/verbose.carbon rename to toolchain/check/testdata/basics/verbose.carbon index 3d61158db1b4..a98fddeb9c06 100644 --- a/toolchain/check/testdata/basics/no_prelude/verbose.carbon +++ b/toolchain/check/testdata/basics/verbose.carbon @@ -6,9 +6,9 @@ // // Only checks a couple statements in order to minimize manual update churn. // To test this file alone, run: -// bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/no_prelude/verbose.carbon +// bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/basics/verbose.carbon // To dump output, run: -// bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/verbose.carbon +// bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/verbose.carbon // NOAUTOUPDATE // SET-CHECK-SUBSET // CHECK:STDERR: Node Push 0: FunctionIntroducer -> diff --git a/toolchain/check/testdata/builtins/no_prelude/no_op.carbon b/toolchain/check/testdata/builtins/no_op.carbon similarity index 97% rename from toolchain/check/testdata/builtins/no_prelude/no_op.carbon rename to toolchain/check/testdata/builtins/no_op.carbon index 30e0aa0b42e9..1c28c0422dff 100644 --- a/toolchain/check/testdata/builtins/no_prelude/no_op.carbon +++ b/toolchain/check/testdata/builtins/no_op.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/no_prelude/no_op.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/builtins/no_op.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/no_prelude/no_op.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/builtins/no_op.carbon // --- no_op.carbon diff --git a/toolchain/check/testdata/class/no_prelude/comp_time_field.carbon b/toolchain/check/testdata/class/comp_time_field.carbon similarity index 95% rename from toolchain/check/testdata/class/no_prelude/comp_time_field.carbon rename to toolchain/check/testdata/class/comp_time_field.carbon index 2222eb318a00..3aa67e388527 100644 --- a/toolchain/check/testdata/class/no_prelude/comp_time_field.carbon +++ b/toolchain/check/testdata/class/comp_time_field.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/comp_time_field.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/comp_time_field.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/comp_time_field.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/comp_time_field.carbon // --- fail_let.carbon diff --git a/toolchain/check/testdata/class/no_prelude/export_name.carbon b/toolchain/check/testdata/class/export_name.carbon similarity index 96% rename from toolchain/check/testdata/class/no_prelude/export_name.carbon rename to toolchain/check/testdata/class/export_name.carbon index bc9eb09e8626..25f1ac6fbad0 100644 --- a/toolchain/check/testdata/class/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/class/export_name.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/export_name.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/export_name.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/export_name.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/export_name.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/class/no_prelude/extern.carbon b/toolchain/check/testdata/class/extern.carbon similarity index 99% rename from toolchain/check/testdata/class/no_prelude/extern.carbon rename to toolchain/check/testdata/class/extern.carbon index 29a5cacb3174..0e9d8fc2a932 100644 --- a/toolchain/check/testdata/class/no_prelude/extern.carbon +++ b/toolchain/check/testdata/class/extern.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/extern.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/extern.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/extern.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/extern.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/class/no_prelude/extern_library.carbon b/toolchain/check/testdata/class/extern_library.carbon similarity index 85% rename from toolchain/check/testdata/class/no_prelude/extern_library.carbon rename to toolchain/check/testdata/class/extern_library.carbon index a6601e09b872..c7b74a7259c8 100644 --- a/toolchain/check/testdata/class/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/class/extern_library.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/extern_library.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/extern_library.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/extern_library.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/extern_library.carbon // --- fail_todo.carbon diff --git a/toolchain/check/testdata/class/no_prelude/fail_abstract_in_struct.carbon b/toolchain/check/testdata/class/fail_abstract_in_struct.carbon similarity index 99% rename from toolchain/check/testdata/class/no_prelude/fail_abstract_in_struct.carbon rename to toolchain/check/testdata/class/fail_abstract_in_struct.carbon index b3970e7bb581..458646a1ffa3 100644 --- a/toolchain/check/testdata/class/no_prelude/fail_abstract_in_struct.carbon +++ b/toolchain/check/testdata/class/fail_abstract_in_struct.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/fail_abstract_in_struct.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_abstract_in_struct.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/fail_abstract_in_struct.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_abstract_in_struct.carbon // --- fail_abstract_field.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/class/no_prelude/fail_error_recovery.carbon b/toolchain/check/testdata/class/fail_error_recovery.carbon similarity index 95% rename from toolchain/check/testdata/class/no_prelude/fail_error_recovery.carbon rename to toolchain/check/testdata/class/fail_error_recovery.carbon index db2a4f913478..f3b0ef82ab98 100644 --- a/toolchain/check/testdata/class/no_prelude/fail_error_recovery.carbon +++ b/toolchain/check/testdata/class/fail_error_recovery.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/fail_error_recovery.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/fail_error_recovery.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/fail_error_recovery.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/fail_error_recovery.carbon // --- fail_virtual_fn_in_invalid_context.carbon diff --git a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/class/generic_vs_params.carbon similarity index 99% rename from toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon rename to toolchain/check/testdata/class/generic_vs_params.carbon index 501453b357b1..5a2077a63f09 100644 --- a/toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/class/generic_vs_params.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/generic_vs_params.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/generic_vs_params.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/generic_vs_params.carbon // --- params.carbon diff --git a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon b/toolchain/check/testdata/class/implicit_import.carbon similarity index 98% rename from toolchain/check/testdata/class/no_prelude/implicit_import.carbon rename to toolchain/check/testdata/class/implicit_import.carbon index b05c373dc182..56bed0164c25 100644 --- a/toolchain/check/testdata/class/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/class/implicit_import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/implicit_import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/implicit_import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/implicit_import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/implicit_import.carbon // --- basic.carbon diff --git a/toolchain/check/testdata/class/no_prelude/import_access.carbon b/toolchain/check/testdata/class/import_access.carbon similarity index 99% rename from toolchain/check/testdata/class/no_prelude/import_access.carbon rename to toolchain/check/testdata/class/import_access.carbon index ba56c30ae13d..293179637827 100644 --- a/toolchain/check/testdata/class/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/class/import_access.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/import_access.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/import_access.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/import_access.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/import_access.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon b/toolchain/check/testdata/class/indirect_import_member.carbon similarity index 99% rename from toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon rename to toolchain/check/testdata/class/indirect_import_member.carbon index 723a023df6e9..252972044470 100644 --- a/toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon +++ b/toolchain/check/testdata/class/indirect_import_member.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/indirect_import_member.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/indirect_import_member.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/indirect_import_member.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/class/no_prelude/method_access.carbon b/toolchain/check/testdata/class/method_access.carbon similarity index 95% rename from toolchain/check/testdata/class/no_prelude/method_access.carbon rename to toolchain/check/testdata/class/method_access.carbon index fffada872320..e2f71570c65a 100644 --- a/toolchain/check/testdata/class/no_prelude/method_access.carbon +++ b/toolchain/check/testdata/class/method_access.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/method_access.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/method_access.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/method_access.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/method_access.carbon // --- fail_multiple_bindings.carbon diff --git a/toolchain/check/testdata/class/no_prelude/name_poisoning.carbon b/toolchain/check/testdata/class/name_poisoning.carbon similarity index 97% rename from toolchain/check/testdata/class/no_prelude/name_poisoning.carbon rename to toolchain/check/testdata/class/name_poisoning.carbon index 2d1bbad317eb..d5df6730ad66 100644 --- a/toolchain/check/testdata/class/no_prelude/name_poisoning.carbon +++ b/toolchain/check/testdata/class/name_poisoning.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/name_poisoning.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/name_poisoning.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/name_poisoning.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/name_poisoning.carbon // --- no_poison.carbon diff --git a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/class/no_definition_in_impl_file.carbon similarity index 96% rename from toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon rename to toolchain/check/testdata/class/no_definition_in_impl_file.carbon index 0c7ed3493bce..9e27a94269c3 100644 --- a/toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/class/no_definition_in_impl_file.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_definition_in_impl_file.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/no_definition_in_impl_file.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_definition_in_impl_file.carbon // --- decl_in_api_definition_in_impl.carbon diff --git a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/class/syntactic_merge.carbon similarity index 99% rename from toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon rename to toolchain/check/testdata/class/syntactic_merge.carbon index 1f96003a9516..71a26ca4690a 100644 --- a/toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/class/syntactic_merge.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/class/syntactic_merge.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/no_prelude/syntactic_merge.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/class/syntactic_merge.carbon // --- basic.carbon diff --git a/toolchain/check/testdata/const/no_prelude/import.carbon b/toolchain/check/testdata/const/import.carbon similarity index 96% rename from toolchain/check/testdata/const/no_prelude/import.carbon rename to toolchain/check/testdata/const/import.carbon index f83f41025413..66db2d779ef8 100644 --- a/toolchain/check/testdata/const/no_prelude/import.carbon +++ b/toolchain/check/testdata/const/import.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/const/no_prelude/import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/const/import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/const/no_prelude/import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/const/import.carbon // --- implicit.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon b/toolchain/check/testdata/function/builtin/adapted_type.carbon similarity index 98% rename from toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon rename to toolchain/check/testdata/function/builtin/adapted_type.carbon index 686c1d860115..69cfc6bd8f65 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon +++ b/toolchain/check/testdata/function/builtin/adapted_type.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/builtin/adapted_type.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/no_prelude/adapted_type.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/adapted_type.carbon // --- adapt.carbon diff --git a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon b/toolchain/check/testdata/function/builtin/call_from_operator.carbon similarity index 99% rename from toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon rename to toolchain/check/testdata/function/builtin/call_from_operator.carbon index 6983b4e54fef..4e2b46fe43df 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +++ b/toolchain/check/testdata/function/builtin/call_from_operator.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/builtin/call_from_operator.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/no_prelude/call_from_operator.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/call_from_operator.carbon // --- core.carbon diff --git a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon b/toolchain/check/testdata/function/builtin/import.carbon similarity index 99% rename from toolchain/check/testdata/function/builtin/no_prelude/import.carbon rename to toolchain/check/testdata/function/builtin/import.carbon index 7e672356609e..c2afad7f5315 100644 --- a/toolchain/check/testdata/function/builtin/no_prelude/import.carbon +++ b/toolchain/check/testdata/function/builtin/import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/builtin/no_prelude/import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/builtin/import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/no_prelude/import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/builtin/import.carbon // --- core.carbon diff --git a/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon b/toolchain/check/testdata/function/call/empty_struct.carbon similarity index 94% rename from toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon rename to toolchain/check/testdata/function/call/empty_struct.carbon index a81032ffd6e9..f42ebb2a5711 100644 --- a/toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon +++ b/toolchain/check/testdata/function/call/empty_struct.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/call/empty_struct.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/no_prelude/empty_struct.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/empty_struct.carbon fn Echo(a: {}) -> {} { return a; diff --git a/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon b/toolchain/check/testdata/function/call/empty_tuple.carbon similarity index 94% rename from toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon rename to toolchain/check/testdata/function/call/empty_tuple.carbon index 13fa3a030eaf..a6d5d340e692 100644 --- a/toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon +++ b/toolchain/check/testdata/function/call/empty_tuple.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/call/empty_tuple.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/no_prelude/empty_tuple.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/empty_tuple.carbon fn Echo(a: ()) -> () { return a; diff --git a/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon b/toolchain/check/testdata/function/call/fail_explicit_self_param.carbon similarity index 92% rename from toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon rename to toolchain/check/testdata/function/call/fail_explicit_self_param.carbon index e088a0bf7280..4e50e36de944 100644 --- a/toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon +++ b/toolchain/check/testdata/function/call/fail_explicit_self_param.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/call/fail_explicit_self_param.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/no_prelude/fail_explicit_self_param.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_explicit_self_param.carbon // CHECK:STDERR: fail_explicit_self_param.carbon:[[@LINE+4]]:6: error: `self` can only be declared in an implicit parameter list [SelfOutsideImplicitParamList] // CHECK:STDERR: fn F(self: ()); diff --git a/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon b/toolchain/check/testdata/function/call/fail_runtime_implicit_param.carbon similarity index 88% rename from toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon rename to toolchain/check/testdata/function/call/fail_runtime_implicit_param.carbon index ce2dec2c46cc..556ef1fc42b3 100644 --- a/toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon +++ b/toolchain/check/testdata/function/call/fail_runtime_implicit_param.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/call/fail_runtime_implicit_param.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/no_prelude/fail_runtime_implicit_param.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/fail_runtime_implicit_param.carbon // CHECK:STDERR: fail_runtime_implicit_param.carbon:[[@LINE+4]]:6: error: implicit parameters of functions must be constant or `self` [ImplictParamMustBeConstant] // CHECK:STDERR: fn F[s: ()](); diff --git a/toolchain/check/testdata/function/call/no_prelude/params_zero.carbon b/toolchain/check/testdata/function/call/params_zero.carbon similarity index 89% rename from toolchain/check/testdata/function/call/no_prelude/params_zero.carbon rename to toolchain/check/testdata/function/call/params_zero.carbon index 9fd27d504eb8..b015d82e7624 100644 --- a/toolchain/check/testdata/function/call/no_prelude/params_zero.carbon +++ b/toolchain/check/testdata/function/call/params_zero.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/call/no_prelude/params_zero.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/call/params_zero.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/no_prelude/params_zero.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/call/params_zero.carbon fn Foo() {} diff --git a/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon b/toolchain/check/testdata/function/declaration/export_name.carbon similarity index 94% rename from toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon rename to toolchain/check/testdata/function/declaration/export_name.carbon index 2d85d4e40aa6..189f34c25427 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/function/declaration/export_name.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/export_name.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/export_name.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/export_name.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon b/toolchain/check/testdata/function/declaration/extern.carbon similarity index 97% rename from toolchain/check/testdata/function/declaration/no_prelude/extern.carbon rename to toolchain/check/testdata/function/declaration/extern.carbon index 02a0a2ddd152..0a59ba2735c0 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/declaration/extern.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/extern.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/extern.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/extern.carbon // --- basic.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/declaration/extern_library.carbon similarity index 98% rename from toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon rename to toolchain/check/testdata/function/declaration/extern_library.carbon index e5b67d684ba9..3bdd562d23ce 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/declaration/extern_library.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/extern_library.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/extern_library.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/extern_library.carbon // --- extern_library.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon b/toolchain/check/testdata/function/declaration/extern_library_for_default.carbon similarity index 92% rename from toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon rename to toolchain/check/testdata/function/declaration/extern_library_for_default.carbon index 5cd555903d79..cda7a5d9c236 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon +++ b/toolchain/check/testdata/function/declaration/extern_library_for_default.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/extern_library_for_default.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/extern_library_for_default.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/extern_library_for_default.carbon // --- default.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon b/toolchain/check/testdata/function/declaration/extern_library_from_default.carbon similarity index 92% rename from toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon rename to toolchain/check/testdata/function/declaration/extern_library_from_default.carbon index dffddc825773..f3fb3a0cf980 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon +++ b/toolchain/check/testdata/function/declaration/extern_library_from_default.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/extern_library_from_default.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/extern_library_from_default.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/extern_library_from_default.carbon // --- extern_library.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/function/declaration/fail_modifiers.carbon similarity index 97% rename from toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon rename to toolchain/check/testdata/function/declaration/fail_modifiers.carbon index 65df23658a9e..dbc85282c269 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/function/declaration/fail_modifiers.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/fail_modifiers.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_modifiers.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_modifiers.carbon // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+11]]:9: error: `protected` must appear before `default` [ModifierMustAppearBefore] // CHECK:STDERR: default protected fn WrongOrder(); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon b/toolchain/check/testdata/function/declaration/fail_pattern_in_signature.carbon similarity index 91% rename from toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon rename to toolchain/check/testdata/function/declaration/fail_pattern_in_signature.carbon index 8a64ec4b085b..5a39dc46ec78 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon +++ b/toolchain/check/testdata/function/declaration/fail_pattern_in_signature.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/fail_pattern_in_signature.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_pattern_in_signature.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_pattern_in_signature.carbon // CHECK:STDERR: fail_pattern_in_signature.carbon:[[@LINE+4]]:6: error: semantics TODO: `Support patterns besides bindings in parameter list` [SemanticsTodo] // CHECK:STDERR: fn F((a: {}, b: {}), c: {}); diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon b/toolchain/check/testdata/function/declaration/fail_redecl.carbon similarity index 97% rename from toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon rename to toolchain/check/testdata/function/declaration/fail_redecl.carbon index 3c117d5847e8..eb765877fbd9 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon +++ b/toolchain/check/testdata/function/declaration/fail_redecl.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/fail_redecl.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_redecl.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_redecl.carbon fn A(); // CHECK:STDERR: fail_redecl.carbon:[[@LINE+7]]:1: error: redeclaration of `fn A` is redundant [RedeclRedundant] diff --git a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon b/toolchain/check/testdata/function/declaration/fail_todo_no_params.carbon similarity index 96% rename from toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon rename to toolchain/check/testdata/function/declaration/fail_todo_no_params.carbon index 81a0fad6503e..8c4e8cdb3a8b 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon +++ b/toolchain/check/testdata/function/declaration/fail_todo_no_params.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/fail_todo_no_params.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/fail_todo_no_params.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/fail_todo_no_params.carbon // --- fail_no_body.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/declaration/implicit_import.carbon similarity index 96% rename from toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon rename to toolchain/check/testdata/function/declaration/implicit_import.carbon index 124b686cbf39..21022cf25094 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/declaration/implicit_import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/implicit_import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/implicit_import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/implicit_import.carbon // --- basic.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon b/toolchain/check/testdata/function/declaration/name_poisoning.carbon similarity index 97% rename from toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon rename to toolchain/check/testdata/function/declaration/name_poisoning.carbon index 14e22e41f052..6abc7a7ba1df 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon +++ b/toolchain/check/testdata/function/declaration/name_poisoning.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/name_poisoning.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/name_poisoning.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/name_poisoning.carbon // --- no_poison.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/function/declaration/no_definition_in_impl_file.carbon similarity index 97% rename from toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon rename to toolchain/check/testdata/function/declaration/no_definition_in_impl_file.carbon index e6d941f65e91..8be262780c05 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/function/declaration/no_definition_in_impl_file.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_definition_in_impl_file.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/no_definition_in_impl_file.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_definition_in_impl_file.carbon // --- decl_in_api_definition_in_impl.carbon diff --git a/toolchain/check/testdata/function/declaration/no_prelude/simple.carbon b/toolchain/check/testdata/function/declaration/simple.carbon similarity index 88% rename from toolchain/check/testdata/function/declaration/no_prelude/simple.carbon rename to toolchain/check/testdata/function/declaration/simple.carbon index df6dd7b47dc7..06d3d9e34a84 100644 --- a/toolchain/check/testdata/function/declaration/no_prelude/simple.carbon +++ b/toolchain/check/testdata/function/declaration/simple.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/no_prelude/simple.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/declaration/simple.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/no_prelude/simple.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/declaration/simple.carbon fn F(); diff --git a/toolchain/check/testdata/function/definition/no_prelude/basics.carbon b/toolchain/check/testdata/function/definition/basics.carbon similarity index 91% rename from toolchain/check/testdata/function/definition/no_prelude/basics.carbon rename to toolchain/check/testdata/function/definition/basics.carbon index c285bced04ce..dde1e82a8247 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/basics.carbon +++ b/toolchain/check/testdata/function/definition/basics.carbon @@ -4,13 +4,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/no_prelude/basics.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/basics.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/basics.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/basics.carbon // --- fail_incomplete_type.carbon diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon b/toolchain/check/testdata/function/definition/extern.carbon similarity index 97% rename from toolchain/check/testdata/function/definition/no_prelude/extern.carbon rename to toolchain/check/testdata/function/definition/extern.carbon index 130e8137c60f..0fbc53409bda 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern.carbon +++ b/toolchain/check/testdata/function/definition/extern.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/no_prelude/extern.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/extern.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/extern.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/extern.carbon // --- extern_def.carbon diff --git a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon b/toolchain/check/testdata/function/definition/extern_library.carbon similarity index 98% rename from toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon rename to toolchain/check/testdata/function/definition/extern_library.carbon index 003f66e511c1..6b96a175538d 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon +++ b/toolchain/check/testdata/function/definition/extern_library.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/extern_library.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/extern_library.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/extern_library.carbon // --- one_file_extern.carbon diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon b/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon similarity index 98% rename from toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon rename to toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon index 25f283fef80a..5aa52c17259a 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon +++ b/toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/fail_decl_param_mismatch.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/fail_decl_param_mismatch.carbon fn F(); // CHECK:STDERR: fail_decl_param_mismatch.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter count of 1 [RedeclParamCountDiffers] diff --git a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon b/toolchain/check/testdata/function/definition/fail_redef.carbon similarity index 89% rename from toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon rename to toolchain/check/testdata/function/definition/fail_redef.carbon index 7d8d31662419..900832ec08f8 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon +++ b/toolchain/check/testdata/function/definition/fail_redef.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/fail_redef.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/fail_redef.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/fail_redef.carbon fn F() {} // CHECK:STDERR: fail_redef.carbon:[[@LINE+7]]:1: error: redefinition of `fn F` [RedeclRedef] diff --git a/toolchain/check/testdata/function/definition/no_prelude/forward_decl.carbon b/toolchain/check/testdata/function/definition/forward_decl.carbon similarity index 84% rename from toolchain/check/testdata/function/definition/no_prelude/forward_decl.carbon rename to toolchain/check/testdata/function/definition/forward_decl.carbon index b2c6b682cd87..3ac680f6be3c 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/forward_decl.carbon +++ b/toolchain/check/testdata/function/definition/forward_decl.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/no_prelude/forward_decl.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/forward_decl.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/forward_decl.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/forward_decl.carbon fn Foo(); diff --git a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon b/toolchain/check/testdata/function/definition/implicit_import.carbon similarity index 98% rename from toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon rename to toolchain/check/testdata/function/definition/implicit_import.carbon index b6d82550729d..66d083b2a74b 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon +++ b/toolchain/check/testdata/function/definition/implicit_import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/implicit_import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/implicit_import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/implicit_import.carbon // --- basic.carbon diff --git a/toolchain/check/testdata/function/definition/no_prelude/order.carbon b/toolchain/check/testdata/function/definition/order.carbon similarity index 89% rename from toolchain/check/testdata/function/definition/no_prelude/order.carbon rename to toolchain/check/testdata/function/definition/order.carbon index 6315bea8f73c..4d249f324954 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/order.carbon +++ b/toolchain/check/testdata/function/definition/order.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/no_prelude/order.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/order.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/order.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/order.carbon fn Foo() {} fn Bar() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/params_zero.carbon b/toolchain/check/testdata/function/definition/params_zero.carbon similarity index 83% rename from toolchain/check/testdata/function/definition/no_prelude/params_zero.carbon rename to toolchain/check/testdata/function/definition/params_zero.carbon index 11427d8b5584..fd10d2bf759d 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/params_zero.carbon +++ b/toolchain/check/testdata/function/definition/params_zero.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/no_prelude/params_zero.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/params_zero.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/params_zero.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/params_zero.carbon fn Foo() {} diff --git a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/function/definition/syntactic_merge.carbon similarity index 99% rename from toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon rename to toolchain/check/testdata/function/definition/syntactic_merge.carbon index 05b9385628a9..162972150260 100644 --- a/toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/function/definition/syntactic_merge.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/definition/syntactic_merge.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/no_prelude/syntactic_merge.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/definition/syntactic_merge.carbon // --- basic.carbon diff --git a/toolchain/check/testdata/function/generic/no_prelude/fail_deduce_imported_function.carbon b/toolchain/check/testdata/function/generic/fail_deduce_imported_function.carbon similarity index 98% rename from toolchain/check/testdata/function/generic/no_prelude/fail_deduce_imported_function.carbon rename to toolchain/check/testdata/function/generic/fail_deduce_imported_function.carbon index 9206fc60fc10..f5272119e332 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/fail_deduce_imported_function.carbon +++ b/toolchain/check/testdata/function/generic/fail_deduce_imported_function.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/no_prelude/fail_deduce_imported_function.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/fail_deduce_imported_function.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/no_prelude/fail_deduce_imported_function.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/fail_deduce_imported_function.carbon // --- lib.carbon package Lib; diff --git a/toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon b/toolchain/check/testdata/function/generic/forward_decl.carbon similarity index 88% rename from toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon rename to toolchain/check/testdata/function/generic/forward_decl.carbon index a006e4899219..a3a359d7a047 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon +++ b/toolchain/check/testdata/function/generic/forward_decl.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/forward_decl.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/no_prelude/forward_decl.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/forward_decl.carbon fn F(T:! type); diff --git a/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon b/toolchain/check/testdata/function/generic/import_specific.carbon similarity index 97% rename from toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon rename to toolchain/check/testdata/function/generic/import_specific.carbon index c4a794a50736..7744073a3dc0 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon +++ b/toolchain/check/testdata/function/generic/import_specific.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/import_specific.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/no_prelude/import_specific.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/import_specific.carbon // --- library.carbon diff --git a/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon b/toolchain/check/testdata/function/generic/indirect_generic_type.carbon similarity index 95% rename from toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon rename to toolchain/check/testdata/function/generic/indirect_generic_type.carbon index 8e72fddbc8e0..c1710ef707dd 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon +++ b/toolchain/check/testdata/function/generic/indirect_generic_type.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/indirect_generic_type.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/no_prelude/indirect_generic_type.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/indirect_generic_type.carbon fn F(T:! type, p: T**) -> T* { return *p; diff --git a/toolchain/check/testdata/function/generic/no_prelude/template_param.carbon b/toolchain/check/testdata/function/generic/template_param.carbon similarity index 93% rename from toolchain/check/testdata/function/generic/no_prelude/template_param.carbon rename to toolchain/check/testdata/function/generic/template_param.carbon index 5b69029d358d..aa9af16c9188 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/template_param.carbon +++ b/toolchain/check/testdata/function/generic/template_param.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/no_prelude/template_param.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/template_param.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/no_prelude/template_param.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/template_param.carbon // --- fn.carbon diff --git a/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon b/toolchain/check/testdata/function/generic/type_param_scope.carbon similarity index 94% rename from toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon rename to toolchain/check/testdata/function/generic/type_param_scope.carbon index f0e69141aba4..b737ebf50e47 100644 --- a/toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon +++ b/toolchain/check/testdata/function/generic/type_param_scope.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/function/generic/type_param_scope.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/no_prelude/type_param_scope.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/function/generic/type_param_scope.carbon fn F(T:! type, n: T) -> T { let m: T = n; diff --git a/toolchain/check/testdata/global/no_prelude/basics.carbon b/toolchain/check/testdata/global/basics.carbon similarity index 98% rename from toolchain/check/testdata/global/no_prelude/basics.carbon rename to toolchain/check/testdata/global/basics.carbon index dfcd5e0378b8..333fa3c74f32 100644 --- a/toolchain/check/testdata/global/no_prelude/basics.carbon +++ b/toolchain/check/testdata/global/basics.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/global/no_prelude/basics.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/global/basics.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/global/no_prelude/basics.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/global/basics.carbon // --- decl.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/impl/no_prelude/basic.carbon b/toolchain/check/testdata/impl/basic.carbon similarity index 95% rename from toolchain/check/testdata/impl/no_prelude/basic.carbon rename to toolchain/check/testdata/impl/basic.carbon index a37f7adae21e..c297205e6714 100644 --- a/toolchain/check/testdata/impl/no_prelude/basic.carbon +++ b/toolchain/check/testdata/impl/basic.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/basic.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/basic.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/basic.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/basic.carbon interface Simple { fn F(); diff --git a/toolchain/check/testdata/impl/no_prelude/compound.carbon b/toolchain/check/testdata/impl/compound.carbon similarity index 99% rename from toolchain/check/testdata/impl/no_prelude/compound.carbon rename to toolchain/check/testdata/impl/compound.carbon index 2de884b6e354..b36d07f859a3 100644 --- a/toolchain/check/testdata/impl/no_prelude/compound.carbon +++ b/toolchain/check/testdata/impl/compound.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/compound.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/compound.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/compound.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/compound.carbon // --- core.carbon package Core; diff --git a/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon b/toolchain/check/testdata/impl/error_recovery.carbon similarity index 93% rename from toolchain/check/testdata/impl/no_prelude/error_recovery.carbon rename to toolchain/check/testdata/impl/error_recovery.carbon index a2a46f8746fc..69bb68829381 100644 --- a/toolchain/check/testdata/impl/no_prelude/error_recovery.carbon +++ b/toolchain/check/testdata/impl/error_recovery.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/error_recovery.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/error_recovery.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/error_recovery.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/error_recovery.carbon // --- fail_fuzz_crash.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon b/toolchain/check/testdata/impl/fail_alias.carbon similarity index 95% rename from toolchain/check/testdata/impl/no_prelude/fail_alias.carbon rename to toolchain/check/testdata/impl/fail_alias.carbon index eea63f0c55d1..de9057d858d4 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_alias.carbon +++ b/toolchain/check/testdata/impl/fail_alias.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/fail_alias.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/fail_alias.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/fail_alias.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_alias.carbon interface I {} class C {} diff --git a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_assoc_const.carbon b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon similarity index 93% rename from toolchain/check/testdata/impl/no_prelude/fail_impl_bad_assoc_const.carbon rename to toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon index eaaa0a2c92f1..847fd6d9cfe4 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_assoc_const.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/fail_impl_bad_assoc_const.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/fail_impl_bad_assoc_const.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_impl_bad_assoc_const.carbon interface I { let T:! type; } diff --git a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon b/toolchain/check/testdata/impl/fail_impl_bad_type.carbon similarity index 90% rename from toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon rename to toolchain/check/testdata/impl/fail_impl_bad_type.carbon index 0e046b0057b1..b60f85c2cd79 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon +++ b/toolchain/check/testdata/impl/fail_impl_bad_type.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/fail_impl_bad_type.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/fail_impl_bad_type.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_impl_bad_type.carbon interface I {} diff --git a/toolchain/check/testdata/impl/no_prelude/fail_undefined_interface.carbon b/toolchain/check/testdata/impl/fail_undefined_interface.carbon similarity index 98% rename from toolchain/check/testdata/impl/no_prelude/fail_undefined_interface.carbon rename to toolchain/check/testdata/impl/fail_undefined_interface.carbon index 79e1de2852b6..c5bf0a3cf6a8 100644 --- a/toolchain/check/testdata/impl/no_prelude/fail_undefined_interface.carbon +++ b/toolchain/check/testdata/impl/fail_undefined_interface.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/fail_undefined_interface.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/fail_undefined_interface.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/fail_undefined_interface.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_undefined_interface.carbon // --- fail_empty_struct.carbon diff --git a/toolchain/check/testdata/impl/impl_assoc_const.carbon b/toolchain/check/testdata/impl/impl_assoc_const.carbon index 7a5c4f313bea..a057c4aea8e9 100644 --- a/toolchain/check/testdata/impl/impl_assoc_const.carbon +++ b/toolchain/check/testdata/impl/impl_assoc_const.carbon @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: @@ -11,394 +11,1069 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/impl_assoc_const.carbon -// --- same_non_type.carbon +// --- success.carbon library "[[@TEST_NAME]]"; -interface I { - let X:! {.a: bool, .b: (i32, i32)}; -} -impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = not false, .b = (3 - 2, 4 / 2)} {} +interface I { let T:! type; } -// --- fail_two_different_non_type.carbon +impl () as I where .T = {} {} + +// --- redecl.carbon library "[[@TEST_NAME]]"; -interface I { - let X:! {.a: bool, .b: (i32, i32)}; -} -// CHECK:STDERR: fail_two_different_non_type.carbon:[[@LINE+4]]:12: error: associated constant X given two different values `{.a = true, .b = (1, 2)}` and `{.a = false, .b = (3, 4)}` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, 4)} {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +interface I2 { let T2:! type; } + +impl () as I2 where .T2 = {}; +impl () as I2 where .T2 = {} {} + +// --- fail_redecl_adds_rewrites.carbon +library "[[@TEST_NAME]]"; + +interface I3 { let T3:! type; } + +// CHECK:STDERR: fail_redecl_adds_rewrites.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition] +// CHECK:STDERR: impl () as I3; +// CHECK:STDERR: ^~~~~~~~~~~~~~ // CHECK:STDERR: -impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, 4)} {} +impl () as I3; +impl () as I3 where .T3 = {} {} -// CHECK:STDOUT: --- same_non_type.carbon +// --- fail_mismatch.carbon +library "[[@TEST_NAME]]"; + +interface J { let U:! type; } + +// CHECK:STDERR: fail_mismatch.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition] +// CHECK:STDERR: impl () as J where .U = {}; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +impl () as J where .U = {}; +impl () as J where .U = () {} + +// --- fail_mismatch_bad_value.carbon +library "[[@TEST_NAME]]"; + +interface I4 { + let T4:! type; + let T5:! type; + let T6:! type; +} + +// CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+8]]:27: error: name `BAD1` not found [NameNotFound] +// CHECK:STDERR: impl () as I4 where .T4 = BAD1 and .T5 = {.a: {}} and .T6 = BAD2; +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+4]]:61: error: name `BAD2` not found [NameNotFound] +// CHECK:STDERR: impl () as I4 where .T4 = BAD1 and .T5 = {.a: {}} and .T6 = BAD2; +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +impl () as I4 where .T4 = BAD1 and .T5 = {.a: {}} and .T6 = BAD2; + +// CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+8]]:46: error: name `BAD3` not found [NameNotFound] +// CHECK:STDERR: impl () as I4 where .T4 = {.b: {}} and .T5 = BAD3 and .T6 = BAD4 {} +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+4]]:61: error: name `BAD4` not found [NameNotFound] +// CHECK:STDERR: impl () as I4 where .T4 = {.b: {}} and .T5 = BAD3 and .T6 = BAD4 {} +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +impl () as I4 where .T4 = {.b: {}} and .T5 = BAD3 and .T6 = BAD4 {} + +// --- fail_missing_on_definition.carbon +library "[[@TEST_NAME]]"; + +interface K { let V:! type; } + +impl () as K where .V = {}; +// CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE+11]]:1: error: associated constant V not given a value in impl of interface K [ImplAssociatedConstantNeedsValue] +// CHECK:STDERR: impl () as K {} +// CHECK:STDERR: ^~~~~~~~~~~~~~ +// CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE-6]]:19: note: associated constant declared here [AssociatedConstantHere] +// CHECK:STDERR: interface K { let V:! type; } +// CHECK:STDERR: ^~~~~~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE-8]]:1: error: impl declared but not defined [ImplMissingDefinition] +// CHECK:STDERR: impl () as K where .V = {}; +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +impl () as K {} + +// --- fail_two_different.carbon +library "[[@TEST_NAME]]"; + +interface L { let W:! type; } + +// CHECK:STDERR: fail_two_different.carbon:[[@LINE+4]]:12: error: associated constant W given two different values `()` and `{}` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: impl () as L where .W = {} and .W = () {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +impl () as L where .W = {} and .W = () {} + +// --- fail_two_different_first_bad.carbon +library "[[@TEST_NAME]]"; + +interface L2 { let W2:! type; } + +// CHECK:STDERR: fail_two_different_first_bad.carbon:[[@LINE+4]]:27: error: name `BAD5` not found [NameNotFound] +// CHECK:STDERR: impl () as L2 where .W2 = BAD5 and .W2 = () {} +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +impl () as L2 where .W2 = BAD5 and .W2 = () {} + +// --- fail_two_different_second_bad.carbon +library "[[@TEST_NAME]]"; + +interface L3 { let W3:! type; } + +// CHECK:STDERR: fail_two_different_second_bad.carbon:[[@LINE+4]]:40: error: name `BAD6` not found [NameNotFound] +// CHECK:STDERR: impl () as L3 where .W3 = {} and .W3 = BAD6 {} +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +impl () as L3 where .W3 = {} and .W3 = BAD6 {} + +// --- fail_two_different_both_bad.carbon +library "[[@TEST_NAME]]"; + +interface L4 { let W4:! type; } + +// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+8]]:27: error: name `BAD7` not found [NameNotFound] +// CHECK:STDERR: impl () as L4 where .W4 = BAD7 and .W4 = BAD8 {} +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+4]]:42: error: name `BAD8` not found [NameNotFound] +// CHECK:STDERR: impl () as L4 where .W4 = BAD7 and .W4 = BAD8 {} +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +impl () as L4 where .W4 = BAD7 and .W4 = BAD8 {} + +// --- repeated.carbon +library "[[@TEST_NAME]]"; + +interface M { let X:! type; } + +impl () as M where .X = {} and .X = {} {} + +// --- non-type.carbon +library "[[@TEST_NAME]]"; + +interface N { + let Y:! {.a: {}}; +} + +impl () as N where .Y = {.a = {}} { } + +// --- fail_where_rewrite_function.carbon +library "[[@TEST_NAME]]"; + +interface IF { fn F(); } + +class CD { } + +// CHECK:STDERR: fail_where_rewrite_function.carbon:[[@LINE+4]]:12: error: rewrite specified for associated function F [RewriteForAssociatedFunction] +// CHECK:STDERR: impl CD as IF where .F = 0 { +// CHECK:STDERR: ^~~~~~~~~~~~~~~ +// CHECK:STDERR: +impl CD as IF where .F = 0 { + fn F() {} +} + +// CHECK:STDOUT: --- success.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] -// CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] -// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] -// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] -// CHECK:STDOUT: %struct_type.a.b.fe2: type = struct_type {.a: bool, .b: %tuple.type.d07} [concrete] +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] // CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] -// CHECK:STDOUT: %assoc0.e7f: %I.assoc_type = assoc_entity element0, @I.%X [concrete] +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] // CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] // CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: %struct_type.a.b.fe2 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %true: bool = bool_literal true [concrete] -// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] -// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] -// CHECK:STDOUT: %struct_type.a.b.aa4: type = struct_type {.a: bool, .b: %tuple.type.f94} [concrete] -// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] -// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete] -// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic] -// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic] -// CHECK:STDOUT: %Div.type: type = facet_type <@Div> [concrete] -// CHECK:STDOUT: %Sub.type: type = facet_type <@Sub> [concrete] -// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete] -// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete] -// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete] -// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] -// CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] -// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] -// CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] -// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete] -// CHECK:STDOUT: %struct: %struct_type.a.b.fe2 = struct_value (%true, %tuple) [concrete] -// CHECK:STDOUT: %false: bool = bool_literal false [concrete] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete] -// CHECK:STDOUT: %Op.type.111: type = fn_type @Op.23 [concrete] -// CHECK:STDOUT: %Sub.impl_witness.37d: = impl_witness imports.%Sub.impl_witness_table.d7b [concrete] -// CHECK:STDOUT: %Sub.facet: %Sub.type = facet_value Core.IntLiteral, (%Sub.impl_witness.37d) [concrete] -// CHECK:STDOUT: %.07b: type = fn_type_with_self_type %Op.type.111, %Sub.facet [concrete] -// CHECK:STDOUT: %Op.type.2b9: type = fn_type @Op.24 [concrete] -// CHECK:STDOUT: %Op.667: %Op.type.2b9 = struct_value () [concrete] -// CHECK:STDOUT: %Op.bound.645: = bound_method %int_3, %Op.667 [concrete] -// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete] -// CHECK:STDOUT: %Op.type.784: type = fn_type @Op.25 [concrete] -// CHECK:STDOUT: %Div.impl_witness.ec4: = impl_witness imports.%Div.impl_witness_table.381 [concrete] -// CHECK:STDOUT: %Div.facet: %Div.type = facet_value Core.IntLiteral, (%Div.impl_witness.ec4) [concrete] -// CHECK:STDOUT: %.d13: type = fn_type_with_self_type %Op.type.784, %Div.facet [concrete] -// CHECK:STDOUT: %Op.type.c38: type = fn_type @Op.26 [concrete] -// CHECK:STDOUT: %Op.553: %Op.type.c38 = struct_value () [concrete] -// CHECK:STDOUT: %Op.bound.2e7: = bound_method %int_4, %Op.553 [concrete] -// CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %struct> [concrete] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete] // CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Bool = %Core.Bool -// CHECK:STDOUT: .Int = %Core.Int -// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: .Sub = %Core.Sub -// CHECK:STDOUT: .Div = %Core.Div -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] -// CHECK:STDOUT: %Core.Sub: type = import_ref Core//prelude/operators/arithmetic, Sub, loaded [concrete = constants.%Sub.type] -// CHECK:STDOUT: %Core.import_ref.6c4: %Op.type.2b9 = import_ref Core//prelude/operators/arithmetic, loc98_42, loaded [concrete = constants.%Op.667] -// CHECK:STDOUT: %Sub.impl_witness_table.d7b = impl_witness_table (%Core.import_ref.6c4), @impl.bf8 [concrete] -// CHECK:STDOUT: %Core.Div: type = import_ref Core//prelude/operators/arithmetic, Div, loaded [concrete = constants.%Div.type] -// CHECK:STDOUT: %Core.import_ref.dfd: %Op.type.c38 = import_ref Core//prelude/operators/arithmetic, loc82_42, loaded [concrete = constants.%Op.553] -// CHECK:STDOUT: %Div.impl_witness_table.381 = impl_witness_table (%Core.import_ref.dfd), @impl.f0e [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core // CHECK:STDOUT: .I = %I.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {} -// CHECK:STDOUT: impl_decl @impl.9be [concrete] {} { +// CHECK:STDOUT: impl_decl @impl [concrete] {} { +// CHECK:STDOUT: %.loc5_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc5_7.2: type = converted %.loc5_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] +// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc5_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc5_26.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc5_26.2: type = converted %.loc5_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc5_14: type = where_expr %.Self [concrete = constants.%I_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc5_26.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] { +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .T = @T.%assoc0 +// CHECK:STDOUT: witness = (%T) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) { +// CHECK:STDOUT: assoc_const T:! type; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl: %.loc5_7.2 as %.loc5_14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T(constants.%I.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- redecl.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %I2.type: type = facet_type <@I2> [concrete] +// CHECK:STDOUT: %Self: %I2.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %I2.assoc_type: type = assoc_entity_type @I2 [concrete] +// CHECK:STDOUT: %assoc0: %I2.assoc_type = assoc_entity element0, @I2.%T2 [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.Self: %I2.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %I2.lookup_impl_witness: = lookup_impl_witness %.Self, @I2 [symbolic_self] +// CHECK:STDOUT: %I2.facet: %I2.type = facet_value %.Self.as_type, (%I2.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I2.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %I2_where.type: type = facet_type <@I2 where %impl.elem0 = %empty_struct_type> [concrete] +// CHECK:STDOUT: %I2.impl_witness: = impl_witness file.%I2.impl_witness_table [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .I2 = %I2.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %I2.decl: type = interface_decl @I2 [concrete = constants.%I2.type] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] {} { +// CHECK:STDOUT: %.loc5_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc5_7.2: type = converted %.loc5_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %I2.ref.loc5: type = name_ref I2, file.%I2.decl [concrete = constants.%I2.type] +// CHECK:STDOUT: %.Self.1: %I2.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc5: %I2.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %T2.ref.loc5: %I2.assoc_type = name_ref T2, @T2.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc5: type = facet_access_type %.Self.ref.loc5 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc5_21: type = converted %.Self.ref.loc5, %.Self.as_type.loc5 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc5: type = impl_witness_access constants.%I2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc5_28.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc5_28.2: type = converted %.loc5_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc5_15: type = where_expr %.Self.1 [concrete = constants.%I2_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc5, %.loc5_28.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %I2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete] +// CHECK:STDOUT: %I2.impl_witness: = impl_witness %I2.impl_witness_table [concrete = constants.%I2.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: impl_decl @impl [concrete] {} { // CHECK:STDOUT: %.loc6_7.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] -// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc6_20: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %X.ref.loc6_20: %I.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.e7f] -// CHECK:STDOUT: %.Self.as_type.loc6_20: type = facet_access_type %.Self.ref.loc6_20 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc6_20: type = converted %.Self.ref.loc6_20, %.Self.as_type.loc6_20 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc6_20: %struct_type.a.b.fe2 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_2.loc6_46: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc6_47.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2.loc6_46) -// CHECK:STDOUT: %.loc6_48.1: %struct_type.a.b.aa4 = struct_literal (%true, %.loc6_47.1) -// CHECK:STDOUT: %impl.elem0.loc6_47.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6_47.1: = bound_method %int_1, %impl.elem0.loc6_47.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc6_47.1: = specific_function %impl.elem0.loc6_47.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_47.2: = bound_method %int_1, %specific_fn.loc6_47.1 [concrete = constants.%bound_method.9a1] -// CHECK:STDOUT: %int.convert_checked.loc6_47.1: init %i32 = call %bound_method.loc6_47.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc6_47.2: %i32 = value_of_initializer %int.convert_checked.loc6_47.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc6_47.3: %i32 = converted %int_1, %.loc6_47.2 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc6_47.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6_47.3: = bound_method %int_2.loc6_46, %impl.elem0.loc6_47.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc6_47.2: = specific_function %impl.elem0.loc6_47.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_47.4: = bound_method %int_2.loc6_46, %specific_fn.loc6_47.2 [concrete = constants.%bound_method.b92] -// CHECK:STDOUT: %int.convert_checked.loc6_47.2: init %i32 = call %bound_method.loc6_47.4(%int_2.loc6_46) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc6_47.4: %i32 = value_of_initializer %int.convert_checked.loc6_47.2 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc6_47.5: %i32 = converted %int_2.loc6_46, %.loc6_47.4 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %tuple.loc6_47: %tuple.type.d07 = tuple_value (%.loc6_47.3, %.loc6_47.5) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc6_48.2: %tuple.type.d07 = converted %.loc6_47.1, %tuple.loc6_47 [concrete = constants.%tuple] -// CHECK:STDOUT: %struct.loc6_48: %struct_type.a.b.fe2 = struct_value (%true, %.loc6_48.2) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc6_48.3: %struct_type.a.b.fe2 = converted %.loc6_48.1, %struct.loc6_48 [concrete = constants.%struct] -// CHECK:STDOUT: %.Self.ref.loc6_54: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %X.ref.loc6_54: %I.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.e7f] -// CHECK:STDOUT: %.Self.as_type.loc6_54: type = facet_access_type %.Self.ref.loc6_54 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc6_54: type = converted %.Self.ref.loc6_54, %.Self.as_type.loc6_54 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc6_54: %struct_type.a.b.fe2 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: %.loc6_65: bool = not %false [concrete = constants.%true] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3] -// CHECK:STDOUT: %int_2.loc6_86: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc6_84: %.07b = impl_witness_access constants.%Sub.impl_witness.37d, element0 [concrete = constants.%Op.667] -// CHECK:STDOUT: %bound_method.loc6_84: = bound_method %int_3, %impl.elem0.loc6_84 [concrete = constants.%Op.bound.645] -// CHECK:STDOUT: %int.ssub: init Core.IntLiteral = call %bound_method.loc6_84(%int_3, %int_2.loc6_86) [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4] -// CHECK:STDOUT: %int_2.loc6_93: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %impl.elem0.loc6_91: %.d13 = impl_witness_access constants.%Div.impl_witness.ec4, element0 [concrete = constants.%Op.553] -// CHECK:STDOUT: %bound_method.loc6_91: = bound_method %int_4, %impl.elem0.loc6_91 [concrete = constants.%Op.bound.2e7] -// CHECK:STDOUT: %int.sdiv: init Core.IntLiteral = call %bound_method.loc6_91(%int_4, %int_2.loc6_93) [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc6_94.1: %tuple.type.f94 = tuple_literal (%int.ssub, %int.sdiv) -// CHECK:STDOUT: %.loc6_95.1: %struct_type.a.b.aa4 = struct_literal (%.loc6_65, %.loc6_94.1) -// CHECK:STDOUT: %impl.elem0.loc6_94.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6_94.1: = bound_method %int.ssub, %impl.elem0.loc6_94.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc6_94.1: = specific_function %impl.elem0.loc6_94.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_94.2: = bound_method %int.ssub, %specific_fn.loc6_94.1 [concrete = constants.%bound_method.9a1] -// CHECK:STDOUT: %.loc6_84.1: Core.IntLiteral = value_of_initializer %int.ssub [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %.loc6_84.2: Core.IntLiteral = converted %int.ssub, %.loc6_84.1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int.convert_checked.loc6_94.1: init %i32 = call %bound_method.loc6_94.2(%.loc6_84.2) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc6_94.2: %i32 = value_of_initializer %int.convert_checked.loc6_94.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc6_94.3: %i32 = converted %int.ssub, %.loc6_94.2 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc6_94.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc6_94.3: = bound_method %int.sdiv, %impl.elem0.loc6_94.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc6_94.2: = specific_function %impl.elem0.loc6_94.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc6_94.4: = bound_method %int.sdiv, %specific_fn.loc6_94.2 [concrete = constants.%bound_method.b92] -// CHECK:STDOUT: %.loc6_91.1: Core.IntLiteral = value_of_initializer %int.sdiv [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc6_91.2: Core.IntLiteral = converted %int.sdiv, %.loc6_91.1 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %int.convert_checked.loc6_94.2: init %i32 = call %bound_method.loc6_94.4(%.loc6_91.2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc6_94.4: %i32 = value_of_initializer %int.convert_checked.loc6_94.2 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc6_94.5: %i32 = converted %int.sdiv, %.loc6_94.4 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %tuple.loc6_94: %tuple.type.d07 = tuple_value (%.loc6_94.3, %.loc6_94.5) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc6_95.2: %tuple.type.d07 = converted %.loc6_94.1, %tuple.loc6_94 [concrete = constants.%tuple] -// CHECK:STDOUT: %struct.loc6_95: %struct_type.a.b.fe2 = struct_value (%.loc6_65, %.loc6_95.2) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc6_95.3: %struct_type.a.b.fe2 = converted %.loc6_95.1, %struct.loc6_95 [concrete = constants.%struct] -// CHECK:STDOUT: %.loc6_14: type = where_expr %.Self [concrete = constants.%I_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6_20, %.loc6_48.3 -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6_54, %.loc6_95.3 +// CHECK:STDOUT: %I2.ref.loc6: type = name_ref I2, file.%I2.decl [concrete = constants.%I2.type] +// CHECK:STDOUT: %.Self.2: %I2.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc6: %I2.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %T2.ref.loc6: %I2.assoc_type = name_ref T2, @T2.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc6: type = facet_access_type %.Self.ref.loc6 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc6_21: type = converted %.Self.ref.loc6, %.Self.as_type.loc6 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc6: type = impl_witness_access constants.%I2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc6_28.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc6_28.2: type = converted %.loc6_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc6_15: type = where_expr %.Self.2 [concrete = constants.%I2_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6, %.loc6_28.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl.9be [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.a.b.fe2 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: interface @I { -// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826] -// CHECK:STDOUT: %X: %struct_type.a.b.fe2 = assoc_const_decl @X [concrete] { -// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%X [concrete = constants.%assoc0.e7f] +// CHECK:STDOUT: interface @I2 { +// CHECK:STDOUT: %Self: %I2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %T2: type = assoc_const_decl @T2 [concrete] { +// CHECK:STDOUT: %assoc0: %I2.assoc_type = assoc_entity element0, @I2.%T2 [concrete = constants.%assoc0] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: // CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .X = @X.%assoc0 -// CHECK:STDOUT: witness = (%X) +// CHECK:STDOUT: .T2 = @T2.%assoc0 +// CHECK:STDOUT: witness = (%T2) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @X(@I.%Self: %I.type) { -// CHECK:STDOUT: assoc_const X:! %struct_type.a.b.fe2; +// CHECK:STDOUT: generic assoc_const @T2(@I2.%Self: %I2.type) { +// CHECK:STDOUT: assoc_const T2:! type; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.9be: %.loc6_7.2 as %.loc6_14 { +// CHECK:STDOUT: impl @impl: %.loc5_7.2 as %.loc5_15 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = file.%I2.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(constants.%Self.826) {} +// CHECK:STDOUT: specific @T2(constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(constants.%I.facet) {} +// CHECK:STDOUT: specific @T2(constants.%I2.facet) {} // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_two_different_non_type.carbon +// CHECK:STDOUT: --- fail_redecl_adds_rewrites.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] -// CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] +// CHECK:STDOUT: %I3.type: type = facet_type <@I3> [concrete] +// CHECK:STDOUT: %Self: %I3.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %I3.assoc_type: type = assoc_entity_type @I3 [concrete] +// CHECK:STDOUT: %assoc0: %I3.assoc_type = assoc_entity element0, @I3.%T3 [concrete] // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] -// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] -// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] -// CHECK:STDOUT: %struct_type.a.b.fe2: type = struct_type {.a: bool, .b: %tuple.type.d07} [concrete] -// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] -// CHECK:STDOUT: %assoc0.e7f: %I.assoc_type = assoc_entity element0, @I.%X [concrete] -// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %I3.impl_witness.c9d: = impl_witness file.%I3.impl_witness_table.loc9 [concrete] +// CHECK:STDOUT: %.Self: %I3.type = bind_symbolic_name .Self [symbolic_self] // CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: %struct_type.a.b.fe2 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %true: bool = bool_literal true [concrete] -// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] -// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] -// CHECK:STDOUT: %struct_type.a.b.aa4: type = struct_type {.a: bool, .b: %tuple.type.f94} [concrete] -// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] -// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete] -// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic] -// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic] -// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete] -// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete] -// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete] -// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] -// CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] -// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] -// CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] -// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] -// CHECK:STDOUT: %tuple.21c: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete] -// CHECK:STDOUT: %struct.682: %struct_type.a.b.fe2 = struct_value (%true, %tuple.21c) [concrete] -// CHECK:STDOUT: %false: bool = bool_literal false [concrete] -// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] -// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] -// CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] -// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] -// CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] -// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] -// CHECK:STDOUT: %tuple.ffd: %tuple.type.d07 = tuple_value (%int_3.822, %int_4.940) [concrete] -// CHECK:STDOUT: %struct.68c: %struct_type.a.b.fe2 = struct_value (%false, %tuple.ffd) [concrete] -// CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %struct.682 and %impl.elem0 = %struct.68c> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Bool = %Core.Bool -// CHECK:STDOUT: .Int = %Core.Int -// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] +// CHECK:STDOUT: %I3.lookup_impl_witness: = lookup_impl_witness %.Self, @I3 [symbolic_self] +// CHECK:STDOUT: %I3.facet: %I3.type = facet_value %.Self.as_type, (%I3.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I3.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %I3_where.type: type = facet_type <@I3 where %impl.elem0 = %empty_struct_type> [concrete] +// CHECK:STDOUT: %I3.impl_witness.ea7: = impl_witness file.%I3.impl_witness_table.loc10 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: .I3 = %I3.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {} -// CHECK:STDOUT: impl_decl @impl.dd8 [concrete] {} { +// CHECK:STDOUT: %I3.decl: type = interface_decl @I3 [concrete = constants.%I3.type] {} {} +// CHECK:STDOUT: impl_decl @impl.b46 [concrete] {} { +// CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %I3.ref: type = name_ref I3, file.%I3.decl [concrete = constants.%I3.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %I3.impl_witness_table.loc9 = impl_witness_table (), @impl.b46 [concrete] +// CHECK:STDOUT: %I3.impl_witness.loc9: = impl_witness %I3.impl_witness_table.loc9 [concrete = constants.%I3.impl_witness.c9d] +// CHECK:STDOUT: impl_decl @impl.4b6 [concrete] {} { // CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal () // CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] -// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc10_20: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %X.ref.loc10_20: %I.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.e7f] -// CHECK:STDOUT: %.Self.as_type.loc10_20: type = facet_access_type %.Self.ref.loc10_20 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc10_20: type = converted %.Self.ref.loc10_20, %.Self.as_type.loc10_20 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc10_20: %struct_type.a.b.fe2 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] -// CHECK:STDOUT: %.loc10_47.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2) -// CHECK:STDOUT: %.loc10_48.1: %struct_type.a.b.aa4 = struct_literal (%true, %.loc10_47.1) -// CHECK:STDOUT: %impl.elem0.loc10_47.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc10_47.1: = bound_method %int_1, %impl.elem0.loc10_47.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc10_47.1: = specific_function %impl.elem0.loc10_47.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_47.2: = bound_method %int_1, %specific_fn.loc10_47.1 [concrete = constants.%bound_method.9a1] -// CHECK:STDOUT: %int.convert_checked.loc10_47.1: init %i32 = call %bound_method.loc10_47.2(%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc10_47.2: %i32 = value_of_initializer %int.convert_checked.loc10_47.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc10_47.3: %i32 = converted %int_1, %.loc10_47.2 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc10_47.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc10_47.3: = bound_method %int_2, %impl.elem0.loc10_47.2 [concrete = constants.%Convert.bound.ef9] -// CHECK:STDOUT: %specific_fn.loc10_47.2: = specific_function %impl.elem0.loc10_47.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_47.4: = bound_method %int_2, %specific_fn.loc10_47.2 [concrete = constants.%bound_method.b92] -// CHECK:STDOUT: %int.convert_checked.loc10_47.2: init %i32 = call %bound_method.loc10_47.4(%int_2) [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc10_47.4: %i32 = value_of_initializer %int.convert_checked.loc10_47.2 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %.loc10_47.5: %i32 = converted %int_2, %.loc10_47.4 [concrete = constants.%int_2.ef8] -// CHECK:STDOUT: %tuple.loc10_47: %tuple.type.d07 = tuple_value (%.loc10_47.3, %.loc10_47.5) [concrete = constants.%tuple.21c] -// CHECK:STDOUT: %.loc10_48.2: %tuple.type.d07 = converted %.loc10_47.1, %tuple.loc10_47 [concrete = constants.%tuple.21c] -// CHECK:STDOUT: %struct.loc10_48: %struct_type.a.b.fe2 = struct_value (%true, %.loc10_48.2) [concrete = constants.%struct.682] -// CHECK:STDOUT: %.loc10_48.3: %struct_type.a.b.fe2 = converted %.loc10_48.1, %struct.loc10_48 [concrete = constants.%struct.682] -// CHECK:STDOUT: %.Self.ref.loc10_54: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %X.ref.loc10_54: %I.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.e7f] -// CHECK:STDOUT: %.Self.as_type.loc10_54: type = facet_access_type %.Self.ref.loc10_54 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc10_54: type = converted %.Self.ref.loc10_54, %.Self.as_type.loc10_54 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc10_54: %struct_type.a.b.fe2 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] -// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] -// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] -// CHECK:STDOUT: %.loc10_82.1: %tuple.type.f94 = tuple_literal (%int_3, %int_4) -// CHECK:STDOUT: %.loc10_83.1: %struct_type.a.b.aa4 = struct_literal (%false, %.loc10_82.1) -// CHECK:STDOUT: %impl.elem0.loc10_82.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc10_82.1: = bound_method %int_3, %impl.elem0.loc10_82.1 [concrete = constants.%Convert.bound.b30] -// CHECK:STDOUT: %specific_fn.loc10_82.1: = specific_function %impl.elem0.loc10_82.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_82.2: = bound_method %int_3, %specific_fn.loc10_82.1 [concrete = constants.%bound_method.047] -// CHECK:STDOUT: %int.convert_checked.loc10_82.1: init %i32 = call %bound_method.loc10_82.2(%int_3) [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc10_82.2: %i32 = value_of_initializer %int.convert_checked.loc10_82.1 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %.loc10_82.3: %i32 = converted %int_3, %.loc10_82.2 [concrete = constants.%int_3.822] -// CHECK:STDOUT: %impl.elem0.loc10_82.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc10_82.3: = bound_method %int_4, %impl.elem0.loc10_82.2 [concrete = constants.%Convert.bound.ac3] -// CHECK:STDOUT: %specific_fn.loc10_82.2: = specific_function %impl.elem0.loc10_82.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_82.4: = bound_method %int_4, %specific_fn.loc10_82.2 [concrete = constants.%bound_method.1da] -// CHECK:STDOUT: %int.convert_checked.loc10_82.2: init %i32 = call %bound_method.loc10_82.4(%int_4) [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc10_82.4: %i32 = value_of_initializer %int.convert_checked.loc10_82.2 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %.loc10_82.5: %i32 = converted %int_4, %.loc10_82.4 [concrete = constants.%int_4.940] -// CHECK:STDOUT: %tuple.loc10_82: %tuple.type.d07 = tuple_value (%.loc10_82.3, %.loc10_82.5) [concrete = constants.%tuple.ffd] -// CHECK:STDOUT: %.loc10_83.2: %tuple.type.d07 = converted %.loc10_82.1, %tuple.loc10_82 [concrete = constants.%tuple.ffd] -// CHECK:STDOUT: %struct.loc10_83: %struct_type.a.b.fe2 = struct_value (%false, %.loc10_83.2) [concrete = constants.%struct.68c] -// CHECK:STDOUT: %.loc10_83.3: %struct_type.a.b.fe2 = converted %.loc10_83.1, %struct.loc10_83 [concrete = constants.%struct.68c] -// CHECK:STDOUT: %.loc10_14: type = where_expr %.Self [concrete = constants.%I_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_20, %.loc10_48.3 -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_54, %.loc10_83.3 +// CHECK:STDOUT: %I3.ref: type = name_ref I3, file.%I3.decl [concrete = constants.%I3.type] +// CHECK:STDOUT: %.Self: %I3.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %I3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %T3.ref: %I3.assoc_type = name_ref T3, @T3.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc10_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I3.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc10_28.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc10_28.2: type = converted %.loc10_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc10_15: type = where_expr %.Self [concrete = constants.%I3_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_28.2 // CHECK:STDOUT: } // CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @impl.dd8 [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.a.b.fe2 = impl_witness_assoc_constant constants.%struct.682 [concrete = constants.%struct.682] +// CHECK:STDOUT: %I3.impl_witness_table.loc10 = impl_witness_table (%impl_witness_assoc_constant), @impl.4b6 [concrete] +// CHECK:STDOUT: %I3.impl_witness.loc10: = impl_witness %I3.impl_witness_table.loc10 [concrete = constants.%I3.impl_witness.ea7] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: interface @I { -// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826] -// CHECK:STDOUT: %X: %struct_type.a.b.fe2 = assoc_const_decl @X [concrete] { -// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%X [concrete = constants.%assoc0.e7f] +// CHECK:STDOUT: interface @I3 { +// CHECK:STDOUT: %Self: %I3.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %T3: type = assoc_const_decl @T3 [concrete] { +// CHECK:STDOUT: %assoc0: %I3.assoc_type = assoc_entity element0, @I3.%T3 [concrete = constants.%assoc0] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .T3 = @T3.%assoc0 +// CHECK:STDOUT: witness = (%T3) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @T3(@I3.%Self: %I3.type) { +// CHECK:STDOUT: assoc_const T3:! type; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.b46: %.loc9_7.2 as %I3.ref; +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4b6: %.loc10_7.2 as %.loc10_15 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%I3.impl_witness.loc10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T3(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T3(constants.%I3.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_mismatch.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete] +// CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete] +// CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %J.lookup_impl_witness: = lookup_impl_witness %.Self, @J [symbolic_self] +// CHECK:STDOUT: %J.facet: %J.type = facet_value %.Self.as_type, (%J.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %J_where.type.49a: type = facet_type <@J where %impl.elem0 = %empty_struct_type> [concrete] +// CHECK:STDOUT: %J.impl_witness.2a1: = impl_witness file.%J.impl_witness_table.loc9 [concrete] +// CHECK:STDOUT: %J_where.type.344: type = facet_type <@J where %impl.elem0 = %empty_tuple.type> [concrete] +// CHECK:STDOUT: %J.impl_witness.006: = impl_witness file.%J.impl_witness_table.loc10 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .J = %J.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {} +// CHECK:STDOUT: impl_decl @impl.3df [concrete] {} { +// CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] +// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc9_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc9_26.2: type = converted %.loc9_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc9_14: type = where_expr %.Self [concrete = constants.%J_where.type.49a] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_26.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table.loc9 = impl_witness_table (%impl_witness_assoc_constant.loc9), @impl.3df [concrete] +// CHECK:STDOUT: %J.impl_witness.loc9: = impl_witness %J.impl_witness_table.loc9 [concrete = constants.%J.impl_witness.2a1] +// CHECK:STDOUT: %impl_witness_assoc_constant.loc9: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: impl_decl @impl.153 [concrete] {} { +// CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] +// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc10_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc10_26.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc10_26.2: type = converted %.loc10_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc10_14: type = where_expr %.Self [concrete = constants.%J_where.type.344] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_26.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %J.impl_witness_table.loc10 = impl_witness_table (%impl_witness_assoc_constant.loc10), @impl.153 [concrete] +// CHECK:STDOUT: %J.impl_witness.loc10: = impl_witness %J.impl_witness_table.loc10 [concrete = constants.%J.impl_witness.006] +// CHECK:STDOUT: %impl_witness_assoc_constant.loc10: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @J { +// CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] { +// CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .U = @U.%assoc0 +// CHECK:STDOUT: witness = (%U) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) { +// CHECK:STDOUT: assoc_const U:! type; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.3df: %.loc9_7.2 as %.loc9_14; +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.153: %.loc10_7.2 as %.loc10_14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%J.impl_witness.loc10 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @U(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @U(constants.%J.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_mismatch_bad_value.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %I4.type: type = facet_type <@I4> [concrete] +// CHECK:STDOUT: %Self: %I4.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %I4.assoc_type: type = assoc_entity_type @I4 [concrete] +// CHECK:STDOUT: %assoc0: %I4.assoc_type = assoc_entity element0, @I4.%T4 [concrete] +// CHECK:STDOUT: %assoc1: %I4.assoc_type = assoc_entity element1, @I4.%T5 [concrete] +// CHECK:STDOUT: %assoc2: %I4.assoc_type = assoc_entity element2, @I4.%T6 [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.Self: %I4.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %I4.lookup_impl_witness: = lookup_impl_witness %.Self, @I4 [symbolic_self] +// CHECK:STDOUT: %I4.facet: %I4.type = facet_value %.Self.as_type, (%I4.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I4.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %impl.elem1: type = impl_witness_access %I4.lookup_impl_witness, element1 [symbolic_self] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_struct_type} [concrete] +// CHECK:STDOUT: %impl.elem2: type = impl_witness_access %I4.lookup_impl_witness, element2 [symbolic_self] +// CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %empty_struct_type} [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .I4 = %I4.decl +// CHECK:STDOUT: .BAD1 = +// CHECK:STDOUT: .BAD2 = +// CHECK:STDOUT: .BAD3 = +// CHECK:STDOUT: .BAD4 = +// CHECK:STDOUT: } +// CHECK:STDOUT: %I4.decl: type = interface_decl @I4 [concrete = constants.%I4.type] {} {} +// CHECK:STDOUT: impl_decl @impl.de506c.1 [concrete] {} { +// CHECK:STDOUT: %.loc17_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc17_7.2: type = converted %.loc17_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %I4.ref: type = name_ref I4, file.%I4.decl [concrete = constants.%I4.type] +// CHECK:STDOUT: %.Self: %I4.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc17_21: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %T4.ref: %I4.assoc_type = name_ref T4, @T4.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc17_21: type = facet_access_type %.Self.ref.loc17_21 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc17_21: type = converted %.Self.ref.loc17_21, %.Self.as_type.loc17_21 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I4.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %BAD1.ref: = name_ref BAD1, [concrete = ] +// CHECK:STDOUT: %.Self.ref.loc17_36: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %T5.ref: %I4.assoc_type = name_ref T5, @T5.%assoc1 [concrete = constants.%assoc1] +// CHECK:STDOUT: %.Self.as_type.loc17_36: type = facet_access_type %.Self.ref.loc17_36 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc17_36: type = converted %.Self.ref.loc17_36, %.Self.as_type.loc17_36 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem1: type = impl_witness_access constants.%I4.lookup_impl_witness, element1 [symbolic_self = constants.%impl.elem1] +// CHECK:STDOUT: %.loc17_48.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc17_48.2: type = converted %.loc17_48.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_struct_type} [concrete = constants.%struct_type.a] +// CHECK:STDOUT: %.Self.ref.loc17_55: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %T6.ref: %I4.assoc_type = name_ref T6, @T6.%assoc2 [concrete = constants.%assoc2] +// CHECK:STDOUT: %.Self.as_type.loc17_55: type = facet_access_type %.Self.ref.loc17_55 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc17_55: type = converted %.Self.ref.loc17_55, %.Self.as_type.loc17_55 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem2: type = impl_witness_access constants.%I4.lookup_impl_witness, element2 [symbolic_self = constants.%impl.elem2] +// CHECK:STDOUT: %BAD2.ref: = name_ref BAD2, [concrete = ] +// CHECK:STDOUT: %.loc17_15: type = where_expr %.Self [concrete = ] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, +// CHECK:STDOUT: requirement_rewrite %impl.elem1, %struct_type.a +// CHECK:STDOUT: requirement_rewrite %impl.elem2, +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: impl_decl @impl.de506c.2 [concrete] {} { +// CHECK:STDOUT: %.loc27_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc27_7.2: type = converted %.loc27_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %I4.ref: type = name_ref I4, file.%I4.decl [concrete = constants.%I4.type] +// CHECK:STDOUT: %.Self: %I4.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc27_21: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %T4.ref: %I4.assoc_type = name_ref T4, @T4.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc27_21: type = facet_access_type %.Self.ref.loc27_21 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc27_21: type = converted %.Self.ref.loc27_21, %.Self.as_type.loc27_21 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I4.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc27_33.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc27_33.2: type = converted %.loc27_33.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %empty_struct_type} [concrete = constants.%struct_type.b] +// CHECK:STDOUT: %.Self.ref.loc27_40: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %T5.ref: %I4.assoc_type = name_ref T5, @T5.%assoc1 [concrete = constants.%assoc1] +// CHECK:STDOUT: %.Self.as_type.loc27_40: type = facet_access_type %.Self.ref.loc27_40 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc27_40: type = converted %.Self.ref.loc27_40, %.Self.as_type.loc27_40 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem1: type = impl_witness_access constants.%I4.lookup_impl_witness, element1 [symbolic_self = constants.%impl.elem1] +// CHECK:STDOUT: %BAD3.ref: = name_ref BAD3, [concrete = ] +// CHECK:STDOUT: %.Self.ref.loc27_55: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %T6.ref: %I4.assoc_type = name_ref T6, @T6.%assoc2 [concrete = constants.%assoc2] +// CHECK:STDOUT: %.Self.as_type.loc27_55: type = facet_access_type %.Self.ref.loc27_55 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc27_55: type = converted %.Self.ref.loc27_55, %.Self.as_type.loc27_55 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem2: type = impl_witness_access constants.%I4.lookup_impl_witness, element2 [symbolic_self = constants.%impl.elem2] +// CHECK:STDOUT: %BAD4.ref: = name_ref BAD4, [concrete = ] +// CHECK:STDOUT: %.loc27_15: type = where_expr %.Self [concrete = ] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %struct_type.b +// CHECK:STDOUT: requirement_rewrite %impl.elem1, +// CHECK:STDOUT: requirement_rewrite %impl.elem2, +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I4 { +// CHECK:STDOUT: %Self: %I4.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %T4: type = assoc_const_decl @T4 [concrete] { +// CHECK:STDOUT: %assoc0: %I4.assoc_type = assoc_entity element0, @I4.%T4 [concrete = constants.%assoc0] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T5: type = assoc_const_decl @T5 [concrete] { +// CHECK:STDOUT: %assoc1: %I4.assoc_type = assoc_entity element1, @I4.%T5 [concrete = constants.%assoc1] +// CHECK:STDOUT: } +// CHECK:STDOUT: %T6: type = assoc_const_decl @T6 [concrete] { +// CHECK:STDOUT: %assoc2: %I4.assoc_type = assoc_entity element2, @I4.%T6 [concrete = constants.%assoc2] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .T4 = @T4.%assoc0 +// CHECK:STDOUT: .T5 = @T5.%assoc1 +// CHECK:STDOUT: .T6 = @T6.%assoc2 +// CHECK:STDOUT: witness = (%T4, %T5, %T6) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @T4(@I4.%Self: %I4.type) { +// CHECK:STDOUT: assoc_const T4:! type; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @T5(@I4.%Self: %I4.type) { +// CHECK:STDOUT: assoc_const T5:! type; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @T6(@I4.%Self: %I4.type) { +// CHECK:STDOUT: assoc_const T6:! type; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.de506c.1: %.loc17_7.2 as %.loc17_15; +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.de506c.2: %.loc27_7.2 as %.loc27_15 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T4(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T5(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T6(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T4(constants.%I4.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T5(constants.%I4.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @T6(constants.%I4.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_missing_on_definition.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %K.type: type = facet_type <@K> [concrete] +// CHECK:STDOUT: %Self: %K.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type @K [concrete] +// CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @K.%V [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %K.lookup_impl_witness: = lookup_impl_witness %.Self, @K [symbolic_self] +// CHECK:STDOUT: %K.facet: %K.type = facet_value %.Self.as_type, (%K.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %K.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %K_where.type: type = facet_type <@K where %impl.elem0 = %empty_struct_type> [concrete] +// CHECK:STDOUT: %K.impl_witness.3ea: = impl_witness file.%K.impl_witness_table.loc5 [concrete] +// CHECK:STDOUT: %K.impl_witness.3f0: = impl_witness file.%K.impl_witness_table.loc17 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .K = %K.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %K.decl: type = interface_decl @K [concrete = constants.%K.type] {} {} +// CHECK:STDOUT: impl_decl @impl.16d [concrete] {} { +// CHECK:STDOUT: %.loc5_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc5_7.2: type = converted %.loc5_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [concrete = constants.%K.type] +// CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %K.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %V.ref: %K.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc5_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%K.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc5_26.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc5_26.2: type = converted %.loc5_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc5_14: type = where_expr %.Self [concrete = constants.%K_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc5_26.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %K.impl_witness_table.loc5 = impl_witness_table (%impl_witness_assoc_constant), @impl.16d [concrete] +// CHECK:STDOUT: %K.impl_witness.loc5: = impl_witness %K.impl_witness_table.loc5 [concrete = constants.%K.impl_witness.3ea] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: impl_decl @impl.4b0 [concrete] {} { +// CHECK:STDOUT: %.loc17_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc17_7.2: type = converted %.loc17_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [concrete = constants.%K.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %K.impl_witness_table.loc17 = impl_witness_table (), @impl.4b0 [concrete] +// CHECK:STDOUT: %K.impl_witness.loc17: = impl_witness %K.impl_witness_table.loc17 [concrete = constants.%K.impl_witness.3f0] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @K { +// CHECK:STDOUT: %Self: %K.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %V: type = assoc_const_decl @V [concrete] { +// CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @K.%V [concrete = constants.%assoc0] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .V = @V.%assoc0 +// CHECK:STDOUT: witness = (%V) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @V(@K.%Self: %K.type) { +// CHECK:STDOUT: assoc_const V:! type; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.16d: %.loc5_7.2 as %.loc5_14; +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.4b0: %.loc17_7.2 as %K.ref { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%K.impl_witness.loc17 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @V(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @V(constants.%K.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_two_different.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %L.type: type = facet_type <@L> [concrete] +// CHECK:STDOUT: %Self: %L.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %L.assoc_type: type = assoc_entity_type @L [concrete] +// CHECK:STDOUT: %assoc0: %L.assoc_type = assoc_entity element0, @L.%W [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.Self: %L.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %L.lookup_impl_witness: = lookup_impl_witness %.Self, @L [symbolic_self] +// CHECK:STDOUT: %L.facet: %L.type = facet_value %.Self.as_type, (%L.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %L.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %L_where.type: type = facet_type <@L where %impl.elem0 = %empty_tuple.type and %impl.elem0 = %empty_struct_type> [concrete] +// CHECK:STDOUT: %L.impl_witness: = impl_witness file.%L.impl_witness_table [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .L = %L.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %L.decl: type = interface_decl @L [concrete = constants.%L.type] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] {} { +// CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %L.ref: type = name_ref L, file.%L.decl [concrete = constants.%L.type] +// CHECK:STDOUT: %.Self: %L.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc9_20: %L.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %W.ref.loc9_20: %L.assoc_type = name_ref W, @W.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc9_20: type = facet_access_type %.Self.ref.loc9_20 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc9_20: type = converted %.Self.ref.loc9_20, %.Self.as_type.loc9_20 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc9_20: type = impl_witness_access constants.%L.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc9_26.2: type = converted %.loc9_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.Self.ref.loc9_32: %L.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %W.ref.loc9_32: %L.assoc_type = name_ref W, @W.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc9_32: type = facet_access_type %.Self.ref.loc9_32 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc9_32: type = converted %.Self.ref.loc9_32, %.Self.as_type.loc9_32 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc9_32: type = impl_witness_access constants.%L.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc9_38.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc9_38.2: type = converted %.loc9_38.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc9_14: type = where_expr %.Self [concrete = constants.%L_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_20, %.loc9_26.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_32, %.loc9_38.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %L.impl_witness_table = impl_witness_table (), @impl [concrete] +// CHECK:STDOUT: %L.impl_witness: = impl_witness %L.impl_witness_table [concrete = constants.%L.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @L { +// CHECK:STDOUT: %Self: %L.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %W: type = assoc_const_decl @W [concrete] { +// CHECK:STDOUT: %assoc0: %L.assoc_type = assoc_entity element0, @L.%W [concrete = constants.%assoc0] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .W = @W.%assoc0 +// CHECK:STDOUT: witness = (%W) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @W(@L.%Self: %L.type) { +// CHECK:STDOUT: assoc_const W:! type; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl: %.loc9_7.2 as %.loc9_14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%L.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @W(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @W(constants.%L.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_two_different_first_bad.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %L2.type: type = facet_type <@L2> [concrete] +// CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %L2.assoc_type: type = assoc_entity_type @L2 [concrete] +// CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, @L2.%W2 [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.Self: %L2.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %L2.lookup_impl_witness: = lookup_impl_witness %.Self, @L2 [symbolic_self] +// CHECK:STDOUT: %L2.facet: %L2.type = facet_value %.Self.as_type, (%L2.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %L2.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .L2 = %L2.decl +// CHECK:STDOUT: .BAD5 = +// CHECK:STDOUT: } +// CHECK:STDOUT: %L2.decl: type = interface_decl @L2 [concrete = constants.%L2.type] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] {} { +// CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %L2.ref: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type] +// CHECK:STDOUT: %.Self: %L2.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc9_21: %L2.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %W2.ref.loc9_21: %L2.assoc_type = name_ref W2, @W2.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc9_21: type = facet_access_type %.Self.ref.loc9_21 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc9_21: type = converted %.Self.ref.loc9_21, %.Self.as_type.loc9_21 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc9_21: type = impl_witness_access constants.%L2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %BAD5.ref: = name_ref BAD5, [concrete = ] +// CHECK:STDOUT: %.Self.ref.loc9_36: %L2.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %W2.ref.loc9_36: %L2.assoc_type = name_ref W2, @W2.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc9_36: type = facet_access_type %.Self.ref.loc9_36 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc9_36: type = converted %.Self.ref.loc9_36, %.Self.as_type.loc9_36 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc9_36: type = impl_witness_access constants.%L2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc9_43.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc9_43.2: type = converted %.loc9_43.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %.loc9_15: type = where_expr %.Self [concrete = ] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_21, +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_36, %.loc9_43.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @L2 { +// CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %W2: type = assoc_const_decl @W2 [concrete] { +// CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, @L2.%W2 [concrete = constants.%assoc0] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .W2 = @W2.%assoc0 +// CHECK:STDOUT: witness = (%W2) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @W2(@L2.%Self: %L2.type) { +// CHECK:STDOUT: assoc_const W2:! type; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl: %.loc9_7.2 as %.loc9_15 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @W2(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @W2(constants.%L2.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_two_different_second_bad.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %L3.type: type = facet_type <@L3> [concrete] +// CHECK:STDOUT: %Self: %L3.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %L3.assoc_type: type = assoc_entity_type @L3 [concrete] +// CHECK:STDOUT: %assoc0: %L3.assoc_type = assoc_entity element0, @L3.%W3 [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.Self: %L3.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %L3.lookup_impl_witness: = lookup_impl_witness %.Self, @L3 [symbolic_self] +// CHECK:STDOUT: %L3.facet: %L3.type = facet_value %.Self.as_type, (%L3.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %L3.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .L3 = %L3.decl +// CHECK:STDOUT: .BAD6 = +// CHECK:STDOUT: } +// CHECK:STDOUT: %L3.decl: type = interface_decl @L3 [concrete = constants.%L3.type] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] {} { +// CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %L3.ref: type = name_ref L3, file.%L3.decl [concrete = constants.%L3.type] +// CHECK:STDOUT: %.Self: %L3.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc9_21: %L3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %W3.ref.loc9_21: %L3.assoc_type = name_ref W3, @W3.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc9_21: type = facet_access_type %.Self.ref.loc9_21 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc9_21: type = converted %.Self.ref.loc9_21, %.Self.as_type.loc9_21 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc9_21: type = impl_witness_access constants.%L3.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc9_28.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc9_28.2: type = converted %.loc9_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.Self.ref.loc9_34: %L3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %W3.ref.loc9_34: %L3.assoc_type = name_ref W3, @W3.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc9_34: type = facet_access_type %.Self.ref.loc9_34 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc9_34: type = converted %.Self.ref.loc9_34, %.Self.as_type.loc9_34 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc9_34: type = impl_witness_access constants.%L3.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %BAD6.ref: = name_ref BAD6, [concrete = ] +// CHECK:STDOUT: %.loc9_15: type = where_expr %.Self [concrete = ] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_21, %.loc9_28.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_34, +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @L3 { +// CHECK:STDOUT: %Self: %L3.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %W3: type = assoc_const_decl @W3 [concrete] { +// CHECK:STDOUT: %assoc0: %L3.assoc_type = assoc_entity element0, @L3.%W3 [concrete = constants.%assoc0] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .W3 = @W3.%assoc0 +// CHECK:STDOUT: witness = (%W3) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @W3(@L3.%Self: %L3.type) { +// CHECK:STDOUT: assoc_const W3:! type; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl: %.loc9_7.2 as %.loc9_15 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @W3(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @W3(constants.%L3.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_two_different_both_bad.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %L4.type: type = facet_type <@L4> [concrete] +// CHECK:STDOUT: %Self: %L4.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %L4.assoc_type: type = assoc_entity_type @L4 [concrete] +// CHECK:STDOUT: %assoc0: %L4.assoc_type = assoc_entity element0, @L4.%W4 [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.Self: %L4.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %L4.lookup_impl_witness: = lookup_impl_witness %.Self, @L4 [symbolic_self] +// CHECK:STDOUT: %L4.facet: %L4.type = facet_value %.Self.as_type, (%L4.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %L4.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .L4 = %L4.decl +// CHECK:STDOUT: .BAD7 = +// CHECK:STDOUT: .BAD8 = +// CHECK:STDOUT: } +// CHECK:STDOUT: %L4.decl: type = interface_decl @L4 [concrete = constants.%L4.type] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] {} { +// CHECK:STDOUT: %.loc13_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc13_7.2: type = converted %.loc13_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %L4.ref: type = name_ref L4, file.%L4.decl [concrete = constants.%L4.type] +// CHECK:STDOUT: %.Self: %L4.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc13_21: %L4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %W4.ref.loc13_21: %L4.assoc_type = name_ref W4, @W4.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc13_21: type = facet_access_type %.Self.ref.loc13_21 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc13_21: type = converted %.Self.ref.loc13_21, %.Self.as_type.loc13_21 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc13_21: type = impl_witness_access constants.%L4.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %BAD7.ref: = name_ref BAD7, [concrete = ] +// CHECK:STDOUT: %.Self.ref.loc13_36: %L4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %W4.ref.loc13_36: %L4.assoc_type = name_ref W4, @W4.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc13_36: type = facet_access_type %.Self.ref.loc13_36 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc13_36: type = converted %.Self.ref.loc13_36, %.Self.as_type.loc13_36 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc13_36: type = impl_witness_access constants.%L4.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %BAD8.ref: = name_ref BAD8, [concrete = ] +// CHECK:STDOUT: %.loc13_15: type = where_expr %.Self [concrete = ] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc13_21, +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc13_36, +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @L4 { +// CHECK:STDOUT: %Self: %L4.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %W4: type = assoc_const_decl @W4 [concrete] { +// CHECK:STDOUT: %assoc0: %L4.assoc_type = assoc_entity element0, @L4.%W4 [concrete = constants.%assoc0] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .W4 = @W4.%assoc0 +// CHECK:STDOUT: witness = (%W4) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @W4(@L4.%Self: %L4.type) { +// CHECK:STDOUT: assoc_const W4:! type; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl: %.loc13_7.2 as %.loc13_15 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @W4(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @W4(constants.%L4.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- repeated.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %M.type: type = facet_type <@M> [concrete] +// CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %M.assoc_type: type = assoc_entity_type @M [concrete] +// CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%X [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %M.lookup_impl_witness: = lookup_impl_witness %.Self, @M [symbolic_self] +// CHECK:STDOUT: %M.facet: %M.type = facet_value %.Self.as_type, (%M.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %M_where.type: type = facet_type <@M where %impl.elem0 = %empty_struct_type> [concrete] +// CHECK:STDOUT: %M.impl_witness: = impl_witness file.%M.impl_witness_table [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .M = %M.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %M.decl: type = interface_decl @M [concrete = constants.%M.type] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] {} { +// CHECK:STDOUT: %.loc5_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc5_7.2: type = converted %.loc5_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type] +// CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc5_20: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %X.ref.loc5_20: %M.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc5_20: type = facet_access_type %.Self.ref.loc5_20 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc5_20: type = converted %.Self.ref.loc5_20, %.Self.as_type.loc5_20 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc5_20: type = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc5_26.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc5_26.2: type = converted %.loc5_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.Self.ref.loc5_32: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %X.ref.loc5_32: %M.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type.loc5_32: type = facet_access_type %.Self.ref.loc5_32 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc5_32: type = converted %.Self.ref.loc5_32, %.Self.as_type.loc5_32 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc5_32: type = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc5_38.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc5_38.2: type = converted %.loc5_38.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %.loc5_14: type = where_expr %.Self [concrete = constants.%M_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc5_20, %.loc5_26.2 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc5_32, %.loc5_38.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %M.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete] +// CHECK:STDOUT: %M.impl_witness: = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @M { +// CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %X: type = assoc_const_decl @X [concrete] { +// CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%X [concrete = constants.%assoc0] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: @@ -407,16 +1082,184 @@ impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, // CHECK:STDOUT: witness = (%X) // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @X(@I.%Self: %I.type) { -// CHECK:STDOUT: assoc_const X:! %struct_type.a.b.fe2; +// CHECK:STDOUT: generic assoc_const @X(@M.%Self: %M.type) { +// CHECK:STDOUT: assoc_const X:! type; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.dd8: %.loc10_7.2 as %.loc10_14 { +// CHECK:STDOUT: impl @impl: %.loc5_7.2 as %.loc5_14 { // CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: witness = file.%M.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(constants.%Self.826) {} +// CHECK:STDOUT: specific @X(constants.%Self) {} // CHECK:STDOUT: -// CHECK:STDOUT: specific @X(constants.%I.facet) {} +// CHECK:STDOUT: specific @X(constants.%M.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- non-type.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %N.type: type = facet_type <@N> [concrete] +// CHECK:STDOUT: %Self: %N.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %struct_type.a.225: type = struct_type {.a: %empty_struct_type} [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %N.assoc_type: type = assoc_entity_type @N [concrete] +// CHECK:STDOUT: %assoc0: %N.assoc_type = assoc_entity element0, @N.%Y [concrete] +// CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %N.lookup_impl_witness: = lookup_impl_witness %.Self, @N [symbolic_self] +// CHECK:STDOUT: %N.facet: %N.type = facet_value %.Self.as_type, (%N.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: %struct_type.a.225 = impl_witness_access %N.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] +// CHECK:STDOUT: %struct: %struct_type.a.225 = struct_value (%empty_struct) [concrete] +// CHECK:STDOUT: %N_where.type: type = facet_type <@N where %impl.elem0 = %struct> [concrete] +// CHECK:STDOUT: %N.impl_witness: = impl_witness file.%N.impl_witness_table [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .N = %N.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %N.decl: type = interface_decl @N [concrete = constants.%N.type] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] {} { +// CHECK:STDOUT: %.loc7_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc7_7.2: type = converted %.loc7_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %N.ref: type = name_ref N, file.%N.decl [concrete = constants.%N.type] +// CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %N.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %Y.ref: %N.assoc_type = name_ref Y, @Y.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc7_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0: %struct_type.a.225 = impl_witness_access constants.%N.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %.loc7_32: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc7_33.1: %struct_type.a.225 = struct_literal (%.loc7_32) +// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] +// CHECK:STDOUT: %.loc7_33.2: %empty_struct_type = converted %.loc7_32, %empty_struct [concrete = constants.%empty_struct] +// CHECK:STDOUT: %struct: %struct_type.a.225 = struct_value (%.loc7_33.2) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc7_33.3: %struct_type.a.225 = converted %.loc7_33.1, %struct [concrete = constants.%struct] +// CHECK:STDOUT: %.loc7_14: type = where_expr %.Self [concrete = constants.%N_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc7_33.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %N.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete] +// CHECK:STDOUT: %N.impl_witness: = impl_witness %N.impl_witness_table [concrete = constants.%N.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.a.225 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @N { +// CHECK:STDOUT: %Self: %N.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %Y: %struct_type.a.225 = assoc_const_decl @Y [concrete] { +// CHECK:STDOUT: %assoc0: %N.assoc_type = assoc_entity element0, @N.%Y [concrete = constants.%assoc0] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .Y = @Y.%assoc0 +// CHECK:STDOUT: witness = (%Y) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @Y(@N.%Self: %N.type) { +// CHECK:STDOUT: assoc_const Y:! %struct_type.a.225; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl: %.loc7_7.2 as %.loc7_14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%N.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Y(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @Y(constants.%N.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_where_rewrite_function.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %IF.type: type = facet_type <@IF> [concrete] +// CHECK:STDOUT: %Self: %IF.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %F.type.496: type = fn_type @F.1 [concrete] +// CHECK:STDOUT: %F.1de: %F.type.496 = struct_value () [concrete] +// CHECK:STDOUT: %IF.assoc_type: type = assoc_entity_type @IF [concrete] +// CHECK:STDOUT: %assoc0: %IF.assoc_type = assoc_entity element0, @IF.%F.decl [concrete] +// CHECK:STDOUT: %CD: type = class_type @CD [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %.Self: %IF.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %IF.lookup_impl_witness: = lookup_impl_witness %.Self, @IF [symbolic_self] +// CHECK:STDOUT: %IF.facet.01b: %IF.type = facet_value %.Self.as_type, (%IF.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %.c5b: type = fn_type_with_self_type %F.type.496, %IF.facet.01b [symbolic_self] +// CHECK:STDOUT: %impl.elem0: %.c5b = impl_witness_access %IF.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] +// CHECK:STDOUT: %IF_where.type: type = facet_type <@IF where %impl.elem0 = %int_0> [concrete] +// CHECK:STDOUT: %IF.impl_witness: = impl_witness file.%IF.impl_witness_table [concrete] +// CHECK:STDOUT: %F.type.f56: type = fn_type @F.2 [concrete] +// CHECK:STDOUT: %F.fae: %F.type.f56 = struct_value () [concrete] +// CHECK:STDOUT: %IF.facet.60c: %IF.type = facet_value %CD, (%IF.impl_witness) [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .IF = %IF.decl +// CHECK:STDOUT: .CD = %CD.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %IF.decl: type = interface_decl @IF [concrete = constants.%IF.type] {} {} +// CHECK:STDOUT: %CD.decl: type = class_decl @CD [concrete = constants.%CD] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] {} { +// CHECK:STDOUT: %CD.ref: type = name_ref CD, file.%CD.decl [concrete = constants.%CD] +// CHECK:STDOUT: %IF.ref: type = name_ref IF, file.%IF.decl [concrete = constants.%IF.type] +// CHECK:STDOUT: %.Self: %IF.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref: %IF.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %F.ref: %IF.assoc_type = name_ref F, @IF.%assoc0 [concrete = constants.%assoc0] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc11_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0: %.c5b = impl_witness_access constants.%IF.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] +// CHECK:STDOUT: %.loc11_15: type = where_expr %.Self [concrete = constants.%IF_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0, %int_0 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %IF.impl_witness_table = impl_witness_table (@impl.%F.decl), @impl [concrete] +// CHECK:STDOUT: %IF.impl_witness: = impl_witness %IF.impl_witness_table [concrete = constants.%IF.impl_witness] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @IF { +// CHECK:STDOUT: %Self: %IF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] +// CHECK:STDOUT: %F.decl: %F.type.496 = fn_decl @F.1 [concrete = constants.%F.1de] {} {} +// CHECK:STDOUT: %assoc0: %IF.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .F = %assoc0 +// CHECK:STDOUT: witness = (%F.decl) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl: %CD.ref as %.loc11_15 { +// CHECK:STDOUT: %F.decl: %F.type.f56 = fn_decl @F.2 [concrete = constants.%F.fae] {} {} +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .F = %F.decl +// CHECK:STDOUT: witness = file.%IF.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @CD { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%CD +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic fn @F.1(@IF.%Self: %IF.type) { +// CHECK:STDOUT: fn(); +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @F.2() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%Self) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @F.1(constants.%IF.facet.60c) {} // CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon b/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon new file mode 100644 index 000000000000..edc765c55035 --- /dev/null +++ b/toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon @@ -0,0 +1,422 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". +// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/impl_assoc_const_with_prelude.carbon + +// --- same_non_type.carbon +library "[[@TEST_NAME]]"; + +interface I { + let X:! {.a: bool, .b: (i32, i32)}; +} +impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = not false, .b = (3 - 2, 4 / 2)} {} + +// --- fail_two_different_non_type.carbon +library "[[@TEST_NAME]]"; + +interface I { + let X:! {.a: bool, .b: (i32, i32)}; +} +// CHECK:STDERR: fail_two_different_non_type.carbon:[[@LINE+4]]:12: error: associated constant X given two different values `{.a = true, .b = (1, 2)}` and `{.a = false, .b = (3, 4)}` [AssociatedConstantWithDifferentValues] +// CHECK:STDERR: impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, 4)} {} +// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// CHECK:STDERR: +impl () as I where .X = {.a = true, .b = (1, 2)} and .X = {.a = false, .b = (3, 4)} {} + +// CHECK:STDOUT: --- same_non_type.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] +// CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] +// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] +// CHECK:STDOUT: %struct_type.a.b.fe2: type = struct_type {.a: bool, .b: %tuple.type.d07} [concrete] +// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] +// CHECK:STDOUT: %assoc0.e7f: %I.assoc_type = assoc_entity element0, @I.%X [concrete] +// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: %struct_type.a.b.fe2 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %true: bool = bool_literal true [concrete] +// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] +// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] +// CHECK:STDOUT: %struct_type.a.b.aa4: type = struct_type {.a: bool, .b: %tuple.type.f94} [concrete] +// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] +// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] +// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete] +// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic] +// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic] +// CHECK:STDOUT: %Div.type: type = facet_type <@Div> [concrete] +// CHECK:STDOUT: %Sub.type: type = facet_type <@Sub> [concrete] +// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete] +// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete] +// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete] +// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] +// CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] +// CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] +// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete] +// CHECK:STDOUT: %struct: %struct_type.a.b.fe2 = struct_value (%true, %tuple) [concrete] +// CHECK:STDOUT: %false: bool = bool_literal false [concrete] +// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete] +// CHECK:STDOUT: %Op.type.111: type = fn_type @Op.23 [concrete] +// CHECK:STDOUT: %Sub.impl_witness.37d: = impl_witness imports.%Sub.impl_witness_table.d7b [concrete] +// CHECK:STDOUT: %Sub.facet: %Sub.type = facet_value Core.IntLiteral, (%Sub.impl_witness.37d) [concrete] +// CHECK:STDOUT: %.07b: type = fn_type_with_self_type %Op.type.111, %Sub.facet [concrete] +// CHECK:STDOUT: %Op.type.2b9: type = fn_type @Op.24 [concrete] +// CHECK:STDOUT: %Op.667: %Op.type.2b9 = struct_value () [concrete] +// CHECK:STDOUT: %Op.bound.645: = bound_method %int_3, %Op.667 [concrete] +// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete] +// CHECK:STDOUT: %Op.type.784: type = fn_type @Op.25 [concrete] +// CHECK:STDOUT: %Div.impl_witness.ec4: = impl_witness imports.%Div.impl_witness_table.381 [concrete] +// CHECK:STDOUT: %Div.facet: %Div.type = facet_value Core.IntLiteral, (%Div.impl_witness.ec4) [concrete] +// CHECK:STDOUT: %.d13: type = fn_type_with_self_type %Op.type.784, %Div.facet [concrete] +// CHECK:STDOUT: %Op.type.c38: type = fn_type @Op.26 [concrete] +// CHECK:STDOUT: %Op.553: %Op.type.c38 = struct_value () [concrete] +// CHECK:STDOUT: %Op.bound.2e7: = bound_method %int_4, %Op.553 [concrete] +// CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %struct> [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Bool = %Core.Bool +// CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: .Sub = %Core.Sub +// CHECK:STDOUT: .Div = %Core.Div +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] +// CHECK:STDOUT: %Core.Sub: type = import_ref Core//prelude/operators/arithmetic, Sub, loaded [concrete = constants.%Sub.type] +// CHECK:STDOUT: %Core.import_ref.6c4: %Op.type.2b9 = import_ref Core//prelude/operators/arithmetic, loc98_42, loaded [concrete = constants.%Op.667] +// CHECK:STDOUT: %Sub.impl_witness_table.d7b = impl_witness_table (%Core.import_ref.6c4), @impl.bf8 [concrete] +// CHECK:STDOUT: %Core.Div: type = import_ref Core//prelude/operators/arithmetic, Div, loaded [concrete = constants.%Div.type] +// CHECK:STDOUT: %Core.import_ref.dfd: %Op.type.c38 = import_ref Core//prelude/operators/arithmetic, loc82_42, loaded [concrete = constants.%Op.553] +// CHECK:STDOUT: %Div.impl_witness_table.381 = impl_witness_table (%Core.import_ref.dfd), @impl.f0e [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {} +// CHECK:STDOUT: impl_decl @impl.9be [concrete] {} { +// CHECK:STDOUT: %.loc6_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] +// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc6_20: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %X.ref.loc6_20: %I.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.e7f] +// CHECK:STDOUT: %.Self.as_type.loc6_20: type = facet_access_type %.Self.ref.loc6_20 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc6_20: type = converted %.Self.ref.loc6_20, %.Self.as_type.loc6_20 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc6_20: %struct_type.a.b.fe2 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_2.loc6_46: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] +// CHECK:STDOUT: %.loc6_47.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2.loc6_46) +// CHECK:STDOUT: %.loc6_48.1: %struct_type.a.b.aa4 = struct_literal (%true, %.loc6_47.1) +// CHECK:STDOUT: %impl.elem0.loc6_47.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6_47.1: = bound_method %int_1, %impl.elem0.loc6_47.1 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc6_47.1: = specific_function %impl.elem0.loc6_47.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_47.2: = bound_method %int_1, %specific_fn.loc6_47.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc6_47.1: init %i32 = call %bound_method.loc6_47.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc6_47.2: %i32 = value_of_initializer %int.convert_checked.loc6_47.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc6_47.3: %i32 = converted %int_1, %.loc6_47.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc6_47.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6_47.3: = bound_method %int_2.loc6_46, %impl.elem0.loc6_47.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc6_47.2: = specific_function %impl.elem0.loc6_47.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_47.4: = bound_method %int_2.loc6_46, %specific_fn.loc6_47.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc6_47.2: init %i32 = call %bound_method.loc6_47.4(%int_2.loc6_46) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc6_47.4: %i32 = value_of_initializer %int.convert_checked.loc6_47.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc6_47.5: %i32 = converted %int_2.loc6_46, %.loc6_47.4 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %tuple.loc6_47: %tuple.type.d07 = tuple_value (%.loc6_47.3, %.loc6_47.5) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc6_48.2: %tuple.type.d07 = converted %.loc6_47.1, %tuple.loc6_47 [concrete = constants.%tuple] +// CHECK:STDOUT: %struct.loc6_48: %struct_type.a.b.fe2 = struct_value (%true, %.loc6_48.2) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc6_48.3: %struct_type.a.b.fe2 = converted %.loc6_48.1, %struct.loc6_48 [concrete = constants.%struct] +// CHECK:STDOUT: %.Self.ref.loc6_54: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %X.ref.loc6_54: %I.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.e7f] +// CHECK:STDOUT: %.Self.as_type.loc6_54: type = facet_access_type %.Self.ref.loc6_54 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc6_54: type = converted %.Self.ref.loc6_54, %.Self.as_type.loc6_54 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc6_54: %struct_type.a.b.fe2 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: %.loc6_65: bool = not %false [concrete = constants.%true] +// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3] +// CHECK:STDOUT: %int_2.loc6_86: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] +// CHECK:STDOUT: %impl.elem0.loc6_84: %.07b = impl_witness_access constants.%Sub.impl_witness.37d, element0 [concrete = constants.%Op.667] +// CHECK:STDOUT: %bound_method.loc6_84: = bound_method %int_3, %impl.elem0.loc6_84 [concrete = constants.%Op.bound.645] +// CHECK:STDOUT: %int.ssub: init Core.IntLiteral = call %bound_method.loc6_84(%int_3, %int_2.loc6_86) [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4] +// CHECK:STDOUT: %int_2.loc6_93: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] +// CHECK:STDOUT: %impl.elem0.loc6_91: %.d13 = impl_witness_access constants.%Div.impl_witness.ec4, element0 [concrete = constants.%Op.553] +// CHECK:STDOUT: %bound_method.loc6_91: = bound_method %int_4, %impl.elem0.loc6_91 [concrete = constants.%Op.bound.2e7] +// CHECK:STDOUT: %int.sdiv: init Core.IntLiteral = call %bound_method.loc6_91(%int_4, %int_2.loc6_93) [concrete = constants.%int_2.ecc] +// CHECK:STDOUT: %.loc6_94.1: %tuple.type.f94 = tuple_literal (%int.ssub, %int.sdiv) +// CHECK:STDOUT: %.loc6_95.1: %struct_type.a.b.aa4 = struct_literal (%.loc6_65, %.loc6_94.1) +// CHECK:STDOUT: %impl.elem0.loc6_94.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6_94.1: = bound_method %int.ssub, %impl.elem0.loc6_94.1 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc6_94.1: = specific_function %impl.elem0.loc6_94.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_94.2: = bound_method %int.ssub, %specific_fn.loc6_94.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %.loc6_84.1: Core.IntLiteral = value_of_initializer %int.ssub [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %.loc6_84.2: Core.IntLiteral = converted %int.ssub, %.loc6_84.1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int.convert_checked.loc6_94.1: init %i32 = call %bound_method.loc6_94.2(%.loc6_84.2) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc6_94.2: %i32 = value_of_initializer %int.convert_checked.loc6_94.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc6_94.3: %i32 = converted %int.ssub, %.loc6_94.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc6_94.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc6_94.3: = bound_method %int.sdiv, %impl.elem0.loc6_94.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc6_94.2: = specific_function %impl.elem0.loc6_94.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc6_94.4: = bound_method %int.sdiv, %specific_fn.loc6_94.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %.loc6_91.1: Core.IntLiteral = value_of_initializer %int.sdiv [concrete = constants.%int_2.ecc] +// CHECK:STDOUT: %.loc6_91.2: Core.IntLiteral = converted %int.sdiv, %.loc6_91.1 [concrete = constants.%int_2.ecc] +// CHECK:STDOUT: %int.convert_checked.loc6_94.2: init %i32 = call %bound_method.loc6_94.4(%.loc6_91.2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc6_94.4: %i32 = value_of_initializer %int.convert_checked.loc6_94.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc6_94.5: %i32 = converted %int.sdiv, %.loc6_94.4 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %tuple.loc6_94: %tuple.type.d07 = tuple_value (%.loc6_94.3, %.loc6_94.5) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc6_95.2: %tuple.type.d07 = converted %.loc6_94.1, %tuple.loc6_94 [concrete = constants.%tuple] +// CHECK:STDOUT: %struct.loc6_95: %struct_type.a.b.fe2 = struct_value (%.loc6_65, %.loc6_95.2) [concrete = constants.%struct] +// CHECK:STDOUT: %.loc6_95.3: %struct_type.a.b.fe2 = converted %.loc6_95.1, %struct.loc6_95 [concrete = constants.%struct] +// CHECK:STDOUT: %.loc6_14: type = where_expr %.Self [concrete = constants.%I_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6_20, %.loc6_48.3 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6_54, %.loc6_95.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl.9be [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.a.b.fe2 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826] +// CHECK:STDOUT: %X: %struct_type.a.b.fe2 = assoc_const_decl @X [concrete] { +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%X [concrete = constants.%assoc0.e7f] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .X = @X.%assoc0 +// CHECK:STDOUT: witness = (%X) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @X(@I.%Self: %I.type) { +// CHECK:STDOUT: assoc_const X:! %struct_type.a.b.fe2; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.9be: %.loc6_7.2 as %.loc6_14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @X(constants.%Self.826) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @X(constants.%I.facet) {} +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_two_different_non_type.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] +// CHECK:STDOUT: %Self.826: %I.type = bind_symbolic_name Self, 0 [symbolic] +// CHECK:STDOUT: %Bool.type: type = fn_type @Bool [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %Bool: %Bool.type = struct_value () [concrete] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] +// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] +// CHECK:STDOUT: %struct_type.a.b.fe2: type = struct_type {.a: bool, .b: %tuple.type.d07} [concrete] +// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] +// CHECK:STDOUT: %assoc0.e7f: %I.assoc_type = assoc_entity element0, @I.%X [concrete] +// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self] +// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] +// CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] +// CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self] +// CHECK:STDOUT: %impl.elem0: %struct_type.a.b.fe2 = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] +// CHECK:STDOUT: %true: bool = bool_literal true [concrete] +// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %int_2.ecc: Core.IntLiteral = int_value 2 [concrete] +// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] +// CHECK:STDOUT: %struct_type.a.b.aa4: type = struct_type {.a: bool, .b: %tuple.type.f94} [concrete] +// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] +// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] +// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete] +// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic] +// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic] +// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete] +// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete] +// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete] +// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] +// CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] +// CHECK:STDOUT: %Convert.bound.ef9: = bound_method %int_2.ecc, %Convert.956 [concrete] +// CHECK:STDOUT: %bound_method.b92: = bound_method %int_2.ecc, %Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_2.ef8: %i32 = int_value 2 [concrete] +// CHECK:STDOUT: %tuple.21c: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_2.ef8) [concrete] +// CHECK:STDOUT: %struct.682: %struct_type.a.b.fe2 = struct_value (%true, %tuple.21c) [concrete] +// CHECK:STDOUT: %false: bool = bool_literal false [concrete] +// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete] +// CHECK:STDOUT: %int_4.0c1: Core.IntLiteral = int_value 4 [concrete] +// CHECK:STDOUT: %Convert.bound.b30: = bound_method %int_3.1ba, %Convert.956 [concrete] +// CHECK:STDOUT: %bound_method.047: = bound_method %int_3.1ba, %Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_3.822: %i32 = int_value 3 [concrete] +// CHECK:STDOUT: %Convert.bound.ac3: = bound_method %int_4.0c1, %Convert.956 [concrete] +// CHECK:STDOUT: %bound_method.1da: = bound_method %int_4.0c1, %Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_4.940: %i32 = int_value 4 [concrete] +// CHECK:STDOUT: %tuple.ffd: %tuple.type.d07 = tuple_value (%int_3.822, %int_4.940) [concrete] +// CHECK:STDOUT: %struct.68c: %struct_type.a.b.fe2 = struct_value (%false, %tuple.ffd) [concrete] +// CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %struct.682 and %impl.elem0 = %struct.68c> [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Bool = %Core.Bool +// CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Bool: %Bool.type = import_ref Core//prelude/types/bool, Bool, loaded [concrete = constants.%Bool] +// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .I = %I.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {} +// CHECK:STDOUT: impl_decl @impl.dd8 [concrete] {} { +// CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] +// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %.Self.ref.loc10_20: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %X.ref.loc10_20: %I.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.e7f] +// CHECK:STDOUT: %.Self.as_type.loc10_20: type = facet_access_type %.Self.ref.loc10_20 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc10_20: type = converted %.Self.ref.loc10_20, %.Self.as_type.loc10_20 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc10_20: %struct_type.a.b.fe2 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %true: bool = bool_literal true [concrete = constants.%true] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2.ecc] +// CHECK:STDOUT: %.loc10_47.1: %tuple.type.f94 = tuple_literal (%int_1, %int_2) +// CHECK:STDOUT: %.loc10_48.1: %struct_type.a.b.aa4 = struct_literal (%true, %.loc10_47.1) +// CHECK:STDOUT: %impl.elem0.loc10_47.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc10_47.1: = bound_method %int_1, %impl.elem0.loc10_47.1 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc10_47.1: = specific_function %impl.elem0.loc10_47.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_47.2: = bound_method %int_1, %specific_fn.loc10_47.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc10_47.1: init %i32 = call %bound_method.loc10_47.2(%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc10_47.2: %i32 = value_of_initializer %int.convert_checked.loc10_47.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc10_47.3: %i32 = converted %int_1, %.loc10_47.2 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc10_47.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc10_47.3: = bound_method %int_2, %impl.elem0.loc10_47.2 [concrete = constants.%Convert.bound.ef9] +// CHECK:STDOUT: %specific_fn.loc10_47.2: = specific_function %impl.elem0.loc10_47.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_47.4: = bound_method %int_2, %specific_fn.loc10_47.2 [concrete = constants.%bound_method.b92] +// CHECK:STDOUT: %int.convert_checked.loc10_47.2: init %i32 = call %bound_method.loc10_47.4(%int_2) [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc10_47.4: %i32 = value_of_initializer %int.convert_checked.loc10_47.2 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %.loc10_47.5: %i32 = converted %int_2, %.loc10_47.4 [concrete = constants.%int_2.ef8] +// CHECK:STDOUT: %tuple.loc10_47: %tuple.type.d07 = tuple_value (%.loc10_47.3, %.loc10_47.5) [concrete = constants.%tuple.21c] +// CHECK:STDOUT: %.loc10_48.2: %tuple.type.d07 = converted %.loc10_47.1, %tuple.loc10_47 [concrete = constants.%tuple.21c] +// CHECK:STDOUT: %struct.loc10_48: %struct_type.a.b.fe2 = struct_value (%true, %.loc10_48.2) [concrete = constants.%struct.682] +// CHECK:STDOUT: %.loc10_48.3: %struct_type.a.b.fe2 = converted %.loc10_48.1, %struct.loc10_48 [concrete = constants.%struct.682] +// CHECK:STDOUT: %.Self.ref.loc10_54: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] +// CHECK:STDOUT: %X.ref.loc10_54: %I.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0.e7f] +// CHECK:STDOUT: %.Self.as_type.loc10_54: type = facet_access_type %.Self.ref.loc10_54 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %.loc10_54: type = converted %.Self.ref.loc10_54, %.Self.as_type.loc10_54 [symbolic_self = constants.%.Self.as_type] +// CHECK:STDOUT: %impl.elem0.loc10_54: %struct_type.a.b.fe2 = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] +// CHECK:STDOUT: %false: bool = bool_literal false [concrete = constants.%false] +// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba] +// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4.0c1] +// CHECK:STDOUT: %.loc10_82.1: %tuple.type.f94 = tuple_literal (%int_3, %int_4) +// CHECK:STDOUT: %.loc10_83.1: %struct_type.a.b.aa4 = struct_literal (%false, %.loc10_82.1) +// CHECK:STDOUT: %impl.elem0.loc10_82.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc10_82.1: = bound_method %int_3, %impl.elem0.loc10_82.1 [concrete = constants.%Convert.bound.b30] +// CHECK:STDOUT: %specific_fn.loc10_82.1: = specific_function %impl.elem0.loc10_82.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_82.2: = bound_method %int_3, %specific_fn.loc10_82.1 [concrete = constants.%bound_method.047] +// CHECK:STDOUT: %int.convert_checked.loc10_82.1: init %i32 = call %bound_method.loc10_82.2(%int_3) [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc10_82.2: %i32 = value_of_initializer %int.convert_checked.loc10_82.1 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %.loc10_82.3: %i32 = converted %int_3, %.loc10_82.2 [concrete = constants.%int_3.822] +// CHECK:STDOUT: %impl.elem0.loc10_82.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc10_82.3: = bound_method %int_4, %impl.elem0.loc10_82.2 [concrete = constants.%Convert.bound.ac3] +// CHECK:STDOUT: %specific_fn.loc10_82.2: = specific_function %impl.elem0.loc10_82.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_82.4: = bound_method %int_4, %specific_fn.loc10_82.2 [concrete = constants.%bound_method.1da] +// CHECK:STDOUT: %int.convert_checked.loc10_82.2: init %i32 = call %bound_method.loc10_82.4(%int_4) [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc10_82.4: %i32 = value_of_initializer %int.convert_checked.loc10_82.2 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %.loc10_82.5: %i32 = converted %int_4, %.loc10_82.4 [concrete = constants.%int_4.940] +// CHECK:STDOUT: %tuple.loc10_82: %tuple.type.d07 = tuple_value (%.loc10_82.3, %.loc10_82.5) [concrete = constants.%tuple.ffd] +// CHECK:STDOUT: %.loc10_83.2: %tuple.type.d07 = converted %.loc10_82.1, %tuple.loc10_82 [concrete = constants.%tuple.ffd] +// CHECK:STDOUT: %struct.loc10_83: %struct_type.a.b.fe2 = struct_value (%false, %.loc10_83.2) [concrete = constants.%struct.68c] +// CHECK:STDOUT: %.loc10_83.3: %struct_type.a.b.fe2 = converted %.loc10_83.1, %struct.loc10_83 [concrete = constants.%struct.68c] +// CHECK:STDOUT: %.loc10_14: type = where_expr %.Self [concrete = constants.%I_where.type] { +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_20, %.loc10_48.3 +// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc10_54, %.loc10_83.3 +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (), @impl.dd8 [concrete] +// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] +// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.a.b.fe2 = impl_witness_assoc_constant constants.%struct.682 [concrete = constants.%struct.682] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: interface @I { +// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self.826] +// CHECK:STDOUT: %X: %struct_type.a.b.fe2 = assoc_const_decl @X [concrete] { +// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%X [concrete = constants.%assoc0.e7f] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self +// CHECK:STDOUT: .X = @X.%assoc0 +// CHECK:STDOUT: witness = (%X) +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic assoc_const @X(@I.%Self: %I.type) { +// CHECK:STDOUT: assoc_const X:! %struct_type.a.b.fe2; +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.dd8: %.loc10_7.2 as %.loc10_14 { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: witness = file.%I.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: specific @X(constants.%Self.826) {} +// CHECK:STDOUT: +// CHECK:STDOUT: specific @X(constants.%I.facet) {} +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/impl_self_as.carbon b/toolchain/check/testdata/impl/impl_self_as.carbon similarity index 97% rename from toolchain/check/testdata/impl/no_prelude/impl_self_as.carbon rename to toolchain/check/testdata/impl/impl_self_as.carbon index 1ee890073628..5d8e1fc6747f 100644 --- a/toolchain/check/testdata/impl/no_prelude/impl_self_as.carbon +++ b/toolchain/check/testdata/impl/impl_self_as.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/impl_self_as.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/impl_self_as.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/impl_self_as.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/impl_self_as.carbon // --- match.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/impl/no_prelude/impl_thunk.carbon b/toolchain/check/testdata/impl/impl_thunk.carbon similarity index 99% rename from toolchain/check/testdata/impl/no_prelude/impl_thunk.carbon rename to toolchain/check/testdata/impl/impl_thunk.carbon index 7d8677f9a9a4..c55d172252c4 100644 --- a/toolchain/check/testdata/impl/no_prelude/impl_thunk.carbon +++ b/toolchain/check/testdata/impl/impl_thunk.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/impl_thunk.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/impl_thunk.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/impl_thunk.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/impl_thunk.carbon // --- no_thunk_param_name_differs.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/impl_where_redecl.carbon b/toolchain/check/testdata/impl/impl_where_redecl.carbon similarity index 95% rename from toolchain/check/testdata/impl/no_prelude/impl_where_redecl.carbon rename to toolchain/check/testdata/impl/impl_where_redecl.carbon index b61e06527c99..20aaf4ce4879 100644 --- a/toolchain/check/testdata/impl/no_prelude/impl_where_redecl.carbon +++ b/toolchain/check/testdata/impl/impl_where_redecl.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/impl_where_redecl.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/impl_where_redecl.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/impl_where_redecl.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/impl_where_redecl.carbon // `impl` declarations only match when they are the same syntactically. diff --git a/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon b/toolchain/check/testdata/impl/import_builtin_call.carbon similarity index 99% rename from toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon rename to toolchain/check/testdata/impl/import_builtin_call.carbon index bac3e7b4fae6..dbec8982af65 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon +++ b/toolchain/check/testdata/impl/import_builtin_call.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/import_builtin_call.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_builtin_call.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_builtin_call.carbon // --- generic_impl.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/import_compound.carbon b/toolchain/check/testdata/impl/import_compound.carbon similarity index 99% rename from toolchain/check/testdata/impl/no_prelude/import_compound.carbon rename to toolchain/check/testdata/impl/import_compound.carbon index 08a81c02f921..e8405b97f497 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_compound.carbon +++ b/toolchain/check/testdata/impl/import_compound.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/import_compound.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/import_compound.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_compound.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_compound.carbon // --- core.carbon package Core; diff --git a/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon b/toolchain/check/testdata/impl/import_extend_impl.carbon similarity index 98% rename from toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon rename to toolchain/check/testdata/impl/import_extend_impl.carbon index 2b13ac1e393b..b4561b17ebc9 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon +++ b/toolchain/check/testdata/impl/import_extend_impl.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/import_extend_impl.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_extend_impl.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_extend_impl.carbon // --- extend_impl_library.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon b/toolchain/check/testdata/impl/import_generic.carbon similarity index 99% rename from toolchain/check/testdata/impl/no_prelude/import_generic.carbon rename to toolchain/check/testdata/impl/import_generic.carbon index 06d765b44f13..ba992c477d35 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_generic.carbon +++ b/toolchain/check/testdata/impl/import_generic.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/import_generic.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/import_generic.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_generic.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_generic.carbon // --- import_generic.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/import_impl_with_no_interface.carbon b/toolchain/check/testdata/impl/import_impl_with_no_interface.carbon similarity index 82% rename from toolchain/check/testdata/impl/no_prelude/import_impl_with_no_interface.carbon rename to toolchain/check/testdata/impl/import_impl_with_no_interface.carbon index 9f468385a7b0..57294b19ca53 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_impl_with_no_interface.carbon +++ b/toolchain/check/testdata/impl/import_impl_with_no_interface.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/import_impl_with_no_interface.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/import_impl_with_no_interface.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_impl_with_no_interface.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_impl_with_no_interface.carbon // --- fail_lib.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon b/toolchain/check/testdata/impl/import_interface_assoc_const.carbon similarity index 99% rename from toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon rename to toolchain/check/testdata/impl/import_interface_assoc_const.carbon index a59c6afd670b..898fea021f47 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon +++ b/toolchain/check/testdata/impl/import_interface_assoc_const.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/import_interface_assoc_const.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_interface_assoc_const.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_interface_assoc_const.carbon // --- interface.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/impl/no_prelude/import_thunk.carbon b/toolchain/check/testdata/impl/import_thunk.carbon similarity index 99% rename from toolchain/check/testdata/impl/no_prelude/import_thunk.carbon rename to toolchain/check/testdata/impl/import_thunk.carbon index 7b7377684ce6..57253aaafc03 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_thunk.carbon +++ b/toolchain/check/testdata/impl/import_thunk.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/import_thunk.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/import_thunk.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_thunk.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_thunk.carbon // --- a.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon b/toolchain/check/testdata/impl/import_use_generic.carbon similarity index 99% rename from toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon rename to toolchain/check/testdata/impl/import_use_generic.carbon index 80a06a56d5f6..8307ade0e972 100644 --- a/toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon +++ b/toolchain/check/testdata/impl/import_use_generic.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/import_use_generic.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/import_use_generic.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/import_use_generic.carbon // --- import_generic.carbon diff --git a/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon b/toolchain/check/testdata/impl/lookup/specific_args.carbon similarity index 99% rename from toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon rename to toolchain/check/testdata/impl/lookup/specific_args.carbon index a4fa155e68f5..b1afddf9fc35 100644 --- a/toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon +++ b/toolchain/check/testdata/impl/lookup/specific_args.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/lookup/specific_args.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/no_prelude/specific_args.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/lookup/specific_args.carbon // --- types.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/name_poisoning.carbon b/toolchain/check/testdata/impl/name_poisoning.carbon similarity index 91% rename from toolchain/check/testdata/impl/no_prelude/name_poisoning.carbon rename to toolchain/check/testdata/impl/name_poisoning.carbon index ee913df58ffb..cd9c7ef0f317 100644 --- a/toolchain/check/testdata/impl/no_prelude/name_poisoning.carbon +++ b/toolchain/check/testdata/impl/name_poisoning.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/name_poisoning.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/name_poisoning.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/name_poisoning.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/name_poisoning.carbon // --- using_poisoned_name_in_impl.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon b/toolchain/check/testdata/impl/no_definition_in_impl_file.carbon similarity index 98% rename from toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon rename to toolchain/check/testdata/impl/no_definition_in_impl_file.carbon index 907b488a09b1..df17fe1282c4 100644 --- a/toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon +++ b/toolchain/check/testdata/impl/no_definition_in_impl_file.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_definition_in_impl_file.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/no_definition_in_impl_file.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_definition_in_impl_file.carbon // --- fail_decl_in_api_definition_in_impl.carbon diff --git a/toolchain/check/testdata/impl/no_prelude/impl_assoc_const.carbon b/toolchain/check/testdata/impl/no_prelude/impl_assoc_const.carbon deleted file mode 100644 index 37414a323622..000000000000 --- a/toolchain/check/testdata/impl/no_prelude/impl_assoc_const.carbon +++ /dev/null @@ -1,1265 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present -// -// AUTOUPDATE -// TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/impl_assoc_const.carbon -// TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/impl_assoc_const.carbon - -// --- success.carbon -library "[[@TEST_NAME]]"; - -interface I { let T:! type; } - -impl () as I where .T = {} {} - -// --- redecl.carbon -library "[[@TEST_NAME]]"; - -interface I2 { let T2:! type; } - -impl () as I2 where .T2 = {}; -impl () as I2 where .T2 = {} {} - -// --- fail_redecl_adds_rewrites.carbon -library "[[@TEST_NAME]]"; - -interface I3 { let T3:! type; } - -// CHECK:STDERR: fail_redecl_adds_rewrites.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition] -// CHECK:STDERR: impl () as I3; -// CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: -impl () as I3; -impl () as I3 where .T3 = {} {} - -// --- fail_mismatch.carbon -library "[[@TEST_NAME]]"; - -interface J { let U:! type; } - -// CHECK:STDERR: fail_mismatch.carbon:[[@LINE+4]]:1: error: impl declared but not defined [ImplMissingDefinition] -// CHECK:STDERR: impl () as J where .U = {}; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: -impl () as J where .U = {}; -impl () as J where .U = () {} - -// --- fail_mismatch_bad_value.carbon -library "[[@TEST_NAME]]"; - -interface I4 { - let T4:! type; - let T5:! type; - let T6:! type; -} - -// CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+8]]:27: error: name `BAD1` not found [NameNotFound] -// CHECK:STDERR: impl () as I4 where .T4 = BAD1 and .T5 = {.a: {}} and .T6 = BAD2; -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -// CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+4]]:61: error: name `BAD2` not found [NameNotFound] -// CHECK:STDERR: impl () as I4 where .T4 = BAD1 and .T5 = {.a: {}} and .T6 = BAD2; -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -impl () as I4 where .T4 = BAD1 and .T5 = {.a: {}} and .T6 = BAD2; - -// CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+8]]:46: error: name `BAD3` not found [NameNotFound] -// CHECK:STDERR: impl () as I4 where .T4 = {.b: {}} and .T5 = BAD3 and .T6 = BAD4 {} -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -// CHECK:STDERR: fail_mismatch_bad_value.carbon:[[@LINE+4]]:61: error: name `BAD4` not found [NameNotFound] -// CHECK:STDERR: impl () as I4 where .T4 = {.b: {}} and .T5 = BAD3 and .T6 = BAD4 {} -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -impl () as I4 where .T4 = {.b: {}} and .T5 = BAD3 and .T6 = BAD4 {} - -// --- fail_missing_on_definition.carbon -library "[[@TEST_NAME]]"; - -interface K { let V:! type; } - -impl () as K where .V = {}; -// CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE+11]]:1: error: associated constant V not given a value in impl of interface K [ImplAssociatedConstantNeedsValue] -// CHECK:STDERR: impl () as K {} -// CHECK:STDERR: ^~~~~~~~~~~~~~ -// CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE-6]]:19: note: associated constant declared here [AssociatedConstantHere] -// CHECK:STDERR: interface K { let V:! type; } -// CHECK:STDERR: ^~~~~~~~ -// CHECK:STDERR: -// CHECK:STDERR: fail_missing_on_definition.carbon:[[@LINE-8]]:1: error: impl declared but not defined [ImplMissingDefinition] -// CHECK:STDERR: impl () as K where .V = {}; -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: -impl () as K {} - -// --- fail_two_different.carbon -library "[[@TEST_NAME]]"; - -interface L { let W:! type; } - -// CHECK:STDERR: fail_two_different.carbon:[[@LINE+4]]:12: error: associated constant W given two different values `()` and `{}` [AssociatedConstantWithDifferentValues] -// CHECK:STDERR: impl () as L where .W = {} and .W = () {} -// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~ -// CHECK:STDERR: -impl () as L where .W = {} and .W = () {} - -// --- fail_two_different_first_bad.carbon -library "[[@TEST_NAME]]"; - -interface L2 { let W2:! type; } - -// CHECK:STDERR: fail_two_different_first_bad.carbon:[[@LINE+4]]:27: error: name `BAD5` not found [NameNotFound] -// CHECK:STDERR: impl () as L2 where .W2 = BAD5 and .W2 = () {} -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -impl () as L2 where .W2 = BAD5 and .W2 = () {} - -// --- fail_two_different_second_bad.carbon -library "[[@TEST_NAME]]"; - -interface L3 { let W3:! type; } - -// CHECK:STDERR: fail_two_different_second_bad.carbon:[[@LINE+4]]:40: error: name `BAD6` not found [NameNotFound] -// CHECK:STDERR: impl () as L3 where .W3 = {} and .W3 = BAD6 {} -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -impl () as L3 where .W3 = {} and .W3 = BAD6 {} - -// --- fail_two_different_both_bad.carbon -library "[[@TEST_NAME]]"; - -interface L4 { let W4:! type; } - -// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+8]]:27: error: name `BAD7` not found [NameNotFound] -// CHECK:STDERR: impl () as L4 where .W4 = BAD7 and .W4 = BAD8 {} -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -// CHECK:STDERR: fail_two_different_both_bad.carbon:[[@LINE+4]]:42: error: name `BAD8` not found [NameNotFound] -// CHECK:STDERR: impl () as L4 where .W4 = BAD7 and .W4 = BAD8 {} -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -impl () as L4 where .W4 = BAD7 and .W4 = BAD8 {} - -// --- repeated.carbon -library "[[@TEST_NAME]]"; - -interface M { let X:! type; } - -impl () as M where .X = {} and .X = {} {} - -// --- non-type.carbon -library "[[@TEST_NAME]]"; - -interface N { - let Y:! {.a: {}}; -} - -impl () as N where .Y = {.a = {}} { } - -// --- fail_where_rewrite_function.carbon -library "[[@TEST_NAME]]"; - -interface IF { fn F(); } - -class CD { } - -// CHECK:STDERR: fail_where_rewrite_function.carbon:[[@LINE+4]]:12: error: rewrite specified for associated function F [RewriteForAssociatedFunction] -// CHECK:STDERR: impl CD as IF where .F = 0 { -// CHECK:STDERR: ^~~~~~~~~~~~~~~ -// CHECK:STDERR: -impl CD as IF where .F = 0 { - fn F() {} -} - -// CHECK:STDOUT: --- success.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete] -// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %I.assoc_type: type = assoc_entity_type @I [concrete] -// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %I.lookup_impl_witness: = lookup_impl_witness %.Self, @I [symbolic_self] -// CHECK:STDOUT: %I.facet: %I.type = facet_value %.Self.as_type, (%I.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %I_where.type: type = facet_type <@I where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness file.%I.impl_witness_table [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .I = %I.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %.loc5_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_7.2: type = converted %.loc5_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type] -// CHECK:STDOUT: %.Self: %I.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %I.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T.ref: %I.assoc_type = name_ref T, @T.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc5_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc5_26.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc5_26.2: type = converted %.loc5_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc5_14: type = where_expr %.Self [concrete = constants.%I_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc5_26.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %I.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete] -// CHECK:STDOUT: %I.impl_witness: = impl_witness %I.impl_witness_table [concrete = constants.%I.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @I { -// CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %T: type = assoc_const_decl @T [concrete] { -// CHECK:STDOUT: %assoc0: %I.assoc_type = assoc_entity element0, @I.%T [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .T = @T.%assoc0 -// CHECK:STDOUT: witness = (%T) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T(@I.%Self: %I.type) { -// CHECK:STDOUT: assoc_const T:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc5_7.2 as %.loc5_14 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I.impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T(constants.%I.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- redecl.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %I2.type: type = facet_type <@I2> [concrete] -// CHECK:STDOUT: %Self: %I2.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %I2.assoc_type: type = assoc_entity_type @I2 [concrete] -// CHECK:STDOUT: %assoc0: %I2.assoc_type = assoc_entity element0, @I2.%T2 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %.Self: %I2.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %I2.lookup_impl_witness: = lookup_impl_witness %.Self, @I2 [symbolic_self] -// CHECK:STDOUT: %I2.facet: %I2.type = facet_value %.Self.as_type, (%I2.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I2.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %I2_where.type: type = facet_type <@I2 where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %I2.impl_witness: = impl_witness file.%I2.impl_witness_table [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .I2 = %I2.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %I2.decl: type = interface_decl @I2 [concrete = constants.%I2.type] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %.loc5_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_7.2: type = converted %.loc5_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %I2.ref.loc5: type = name_ref I2, file.%I2.decl [concrete = constants.%I2.type] -// CHECK:STDOUT: %.Self.1: %I2.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc5: %I2.type = name_ref .Self, %.Self.1 [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T2.ref.loc5: %I2.assoc_type = name_ref T2, @T2.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc5: type = facet_access_type %.Self.ref.loc5 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc5_21: type = converted %.Self.ref.loc5, %.Self.as_type.loc5 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc5: type = impl_witness_access constants.%I2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc5_28.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc5_28.2: type = converted %.loc5_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc5_15: type = where_expr %.Self.1 [concrete = constants.%I2_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc5, %.loc5_28.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %I2.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete] -// CHECK:STDOUT: %I2.impl_witness: = impl_witness %I2.impl_witness_table [concrete = constants.%I2.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %.loc6_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %I2.ref.loc6: type = name_ref I2, file.%I2.decl [concrete = constants.%I2.type] -// CHECK:STDOUT: %.Self.2: %I2.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc6: %I2.type = name_ref .Self, %.Self.2 [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T2.ref.loc6: %I2.assoc_type = name_ref T2, @T2.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc6: type = facet_access_type %.Self.ref.loc6 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc6_21: type = converted %.Self.ref.loc6, %.Self.as_type.loc6 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc6: type = impl_witness_access constants.%I2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc6_28.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc6_28.2: type = converted %.loc6_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc6_15: type = where_expr %.Self.2 [concrete = constants.%I2_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc6, %.loc6_28.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @I2 { -// CHECK:STDOUT: %Self: %I2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %T2: type = assoc_const_decl @T2 [concrete] { -// CHECK:STDOUT: %assoc0: %I2.assoc_type = assoc_entity element0, @I2.%T2 [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .T2 = @T2.%assoc0 -// CHECK:STDOUT: witness = (%T2) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T2(@I2.%Self: %I2.type) { -// CHECK:STDOUT: assoc_const T2:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc5_7.2 as %.loc5_15 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I2.impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T2(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T2(constants.%I2.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_redecl_adds_rewrites.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %I3.type: type = facet_type <@I3> [concrete] -// CHECK:STDOUT: %Self: %I3.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %I3.assoc_type: type = assoc_entity_type @I3 [concrete] -// CHECK:STDOUT: %assoc0: %I3.assoc_type = assoc_entity element0, @I3.%T3 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %I3.impl_witness.c9d: = impl_witness file.%I3.impl_witness_table.loc9 [concrete] -// CHECK:STDOUT: %.Self: %I3.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %I3.lookup_impl_witness: = lookup_impl_witness %.Self, @I3 [symbolic_self] -// CHECK:STDOUT: %I3.facet: %I3.type = facet_value %.Self.as_type, (%I3.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I3.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %I3_where.type: type = facet_type <@I3 where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %I3.impl_witness.ea7: = impl_witness file.%I3.impl_witness_table.loc10 [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .I3 = %I3.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %I3.decl: type = interface_decl @I3 [concrete = constants.%I3.type] {} {} -// CHECK:STDOUT: impl_decl @impl.b46 [concrete] {} { -// CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %I3.ref: type = name_ref I3, file.%I3.decl [concrete = constants.%I3.type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %I3.impl_witness_table.loc9 = impl_witness_table (), @impl.b46 [concrete] -// CHECK:STDOUT: %I3.impl_witness.loc9: = impl_witness %I3.impl_witness_table.loc9 [concrete = constants.%I3.impl_witness.c9d] -// CHECK:STDOUT: impl_decl @impl.4b6 [concrete] {} { -// CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %I3.ref: type = name_ref I3, file.%I3.decl [concrete = constants.%I3.type] -// CHECK:STDOUT: %.Self: %I3.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %I3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T3.ref: %I3.assoc_type = name_ref T3, @T3.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc10_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I3.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc10_28.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc10_28.2: type = converted %.loc10_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc10_15: type = where_expr %.Self [concrete = constants.%I3_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_28.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %I3.impl_witness_table.loc10 = impl_witness_table (%impl_witness_assoc_constant), @impl.4b6 [concrete] -// CHECK:STDOUT: %I3.impl_witness.loc10: = impl_witness %I3.impl_witness_table.loc10 [concrete = constants.%I3.impl_witness.ea7] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @I3 { -// CHECK:STDOUT: %Self: %I3.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %T3: type = assoc_const_decl @T3 [concrete] { -// CHECK:STDOUT: %assoc0: %I3.assoc_type = assoc_entity element0, @I3.%T3 [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .T3 = @T3.%assoc0 -// CHECK:STDOUT: witness = (%T3) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T3(@I3.%Self: %I3.type) { -// CHECK:STDOUT: assoc_const T3:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.b46: %.loc9_7.2 as %I3.ref; -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4b6: %.loc10_7.2 as %.loc10_15 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%I3.impl_witness.loc10 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T3(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T3(constants.%I3.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_mismatch.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %J.type: type = facet_type <@J> [concrete] -// CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %J.assoc_type: type = assoc_entity_type @J [concrete] -// CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %J.lookup_impl_witness: = lookup_impl_witness %.Self, @J [symbolic_self] -// CHECK:STDOUT: %J.facet: %J.type = facet_value %.Self.as_type, (%J.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %J.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %J_where.type.49a: type = facet_type <@J where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %J.impl_witness.2a1: = impl_witness file.%J.impl_witness_table.loc9 [concrete] -// CHECK:STDOUT: %J_where.type.344: type = facet_type <@J where %impl.elem0 = %empty_tuple.type> [concrete] -// CHECK:STDOUT: %J.impl_witness.006: = impl_witness file.%J.impl_witness_table.loc10 [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .J = %J.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %J.decl: type = interface_decl @J [concrete = constants.%J.type] {} {} -// CHECK:STDOUT: impl_decl @impl.3df [concrete] {} { -// CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] -// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc9_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc9_26.2: type = converted %.loc9_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc9_14: type = where_expr %.Self [concrete = constants.%J_where.type.49a] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc9_26.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table.loc9 = impl_witness_table (%impl_witness_assoc_constant.loc9), @impl.3df [concrete] -// CHECK:STDOUT: %J.impl_witness.loc9: = impl_witness %J.impl_witness_table.loc9 [concrete = constants.%J.impl_witness.2a1] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc9: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: impl_decl @impl.153 [concrete] {} { -// CHECK:STDOUT: %.loc10_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_7.2: type = converted %.loc10_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %J.ref: type = name_ref J, file.%J.decl [concrete = constants.%J.type] -// CHECK:STDOUT: %.Self: %J.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %J.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %U.ref: %J.assoc_type = name_ref U, @U.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc10_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%J.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc10_26.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc10_26.2: type = converted %.loc10_26.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc10_14: type = where_expr %.Self [concrete = constants.%J_where.type.344] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc10_26.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %J.impl_witness_table.loc10 = impl_witness_table (%impl_witness_assoc_constant.loc10), @impl.153 [concrete] -// CHECK:STDOUT: %J.impl_witness.loc10: = impl_witness %J.impl_witness_table.loc10 [concrete = constants.%J.impl_witness.006] -// CHECK:STDOUT: %impl_witness_assoc_constant.loc10: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @J { -// CHECK:STDOUT: %Self: %J.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %U: type = assoc_const_decl @U [concrete] { -// CHECK:STDOUT: %assoc0: %J.assoc_type = assoc_entity element0, @J.%U [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .U = @U.%assoc0 -// CHECK:STDOUT: witness = (%U) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @U(@J.%Self: %J.type) { -// CHECK:STDOUT: assoc_const U:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.3df: %.loc9_7.2 as %.loc9_14; -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.153: %.loc10_7.2 as %.loc10_14 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%J.impl_witness.loc10 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @U(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @U(constants.%J.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_mismatch_bad_value.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %I4.type: type = facet_type <@I4> [concrete] -// CHECK:STDOUT: %Self: %I4.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %I4.assoc_type: type = assoc_entity_type @I4 [concrete] -// CHECK:STDOUT: %assoc0: %I4.assoc_type = assoc_entity element0, @I4.%T4 [concrete] -// CHECK:STDOUT: %assoc1: %I4.assoc_type = assoc_entity element1, @I4.%T5 [concrete] -// CHECK:STDOUT: %assoc2: %I4.assoc_type = assoc_entity element2, @I4.%T6 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %.Self: %I4.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %I4.lookup_impl_witness: = lookup_impl_witness %.Self, @I4 [symbolic_self] -// CHECK:STDOUT: %I4.facet: %I4.type = facet_value %.Self.as_type, (%I4.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %I4.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %impl.elem1: type = impl_witness_access %I4.lookup_impl_witness, element1 [symbolic_self] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_struct_type} [concrete] -// CHECK:STDOUT: %impl.elem2: type = impl_witness_access %I4.lookup_impl_witness, element2 [symbolic_self] -// CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %empty_struct_type} [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .I4 = %I4.decl -// CHECK:STDOUT: .BAD1 = -// CHECK:STDOUT: .BAD2 = -// CHECK:STDOUT: .BAD3 = -// CHECK:STDOUT: .BAD4 = -// CHECK:STDOUT: } -// CHECK:STDOUT: %I4.decl: type = interface_decl @I4 [concrete = constants.%I4.type] {} {} -// CHECK:STDOUT: impl_decl @impl.de506c.1 [concrete] {} { -// CHECK:STDOUT: %.loc17_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc17_7.2: type = converted %.loc17_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %I4.ref: type = name_ref I4, file.%I4.decl [concrete = constants.%I4.type] -// CHECK:STDOUT: %.Self: %I4.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc17_21: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T4.ref: %I4.assoc_type = name_ref T4, @T4.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc17_21: type = facet_access_type %.Self.ref.loc17_21 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc17_21: type = converted %.Self.ref.loc17_21, %.Self.as_type.loc17_21 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I4.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %BAD1.ref: = name_ref BAD1, [concrete = ] -// CHECK:STDOUT: %.Self.ref.loc17_36: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T5.ref: %I4.assoc_type = name_ref T5, @T5.%assoc1 [concrete = constants.%assoc1] -// CHECK:STDOUT: %.Self.as_type.loc17_36: type = facet_access_type %.Self.ref.loc17_36 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc17_36: type = converted %.Self.ref.loc17_36, %.Self.as_type.loc17_36 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem1: type = impl_witness_access constants.%I4.lookup_impl_witness, element1 [symbolic_self = constants.%impl.elem1] -// CHECK:STDOUT: %.loc17_48.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc17_48.2: type = converted %.loc17_48.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %struct_type.a: type = struct_type {.a: %empty_struct_type} [concrete = constants.%struct_type.a] -// CHECK:STDOUT: %.Self.ref.loc17_55: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T6.ref: %I4.assoc_type = name_ref T6, @T6.%assoc2 [concrete = constants.%assoc2] -// CHECK:STDOUT: %.Self.as_type.loc17_55: type = facet_access_type %.Self.ref.loc17_55 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc17_55: type = converted %.Self.ref.loc17_55, %.Self.as_type.loc17_55 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem2: type = impl_witness_access constants.%I4.lookup_impl_witness, element2 [symbolic_self = constants.%impl.elem2] -// CHECK:STDOUT: %BAD2.ref: = name_ref BAD2, [concrete = ] -// CHECK:STDOUT: %.loc17_15: type = where_expr %.Self [concrete = ] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, -// CHECK:STDOUT: requirement_rewrite %impl.elem1, %struct_type.a -// CHECK:STDOUT: requirement_rewrite %impl.elem2, -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: impl_decl @impl.de506c.2 [concrete] {} { -// CHECK:STDOUT: %.loc27_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc27_7.2: type = converted %.loc27_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %I4.ref: type = name_ref I4, file.%I4.decl [concrete = constants.%I4.type] -// CHECK:STDOUT: %.Self: %I4.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc27_21: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T4.ref: %I4.assoc_type = name_ref T4, @T4.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc27_21: type = facet_access_type %.Self.ref.loc27_21 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc27_21: type = converted %.Self.ref.loc27_21, %.Self.as_type.loc27_21 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%I4.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc27_33.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc27_33.2: type = converted %.loc27_33.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %struct_type.b: type = struct_type {.b: %empty_struct_type} [concrete = constants.%struct_type.b] -// CHECK:STDOUT: %.Self.ref.loc27_40: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T5.ref: %I4.assoc_type = name_ref T5, @T5.%assoc1 [concrete = constants.%assoc1] -// CHECK:STDOUT: %.Self.as_type.loc27_40: type = facet_access_type %.Self.ref.loc27_40 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc27_40: type = converted %.Self.ref.loc27_40, %.Self.as_type.loc27_40 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem1: type = impl_witness_access constants.%I4.lookup_impl_witness, element1 [symbolic_self = constants.%impl.elem1] -// CHECK:STDOUT: %BAD3.ref: = name_ref BAD3, [concrete = ] -// CHECK:STDOUT: %.Self.ref.loc27_55: %I4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %T6.ref: %I4.assoc_type = name_ref T6, @T6.%assoc2 [concrete = constants.%assoc2] -// CHECK:STDOUT: %.Self.as_type.loc27_55: type = facet_access_type %.Self.ref.loc27_55 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc27_55: type = converted %.Self.ref.loc27_55, %.Self.as_type.loc27_55 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem2: type = impl_witness_access constants.%I4.lookup_impl_witness, element2 [symbolic_self = constants.%impl.elem2] -// CHECK:STDOUT: %BAD4.ref: = name_ref BAD4, [concrete = ] -// CHECK:STDOUT: %.loc27_15: type = where_expr %.Self [concrete = ] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %struct_type.b -// CHECK:STDOUT: requirement_rewrite %impl.elem1, -// CHECK:STDOUT: requirement_rewrite %impl.elem2, -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @I4 { -// CHECK:STDOUT: %Self: %I4.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %T4: type = assoc_const_decl @T4 [concrete] { -// CHECK:STDOUT: %assoc0: %I4.assoc_type = assoc_entity element0, @I4.%T4 [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: %T5: type = assoc_const_decl @T5 [concrete] { -// CHECK:STDOUT: %assoc1: %I4.assoc_type = assoc_entity element1, @I4.%T5 [concrete = constants.%assoc1] -// CHECK:STDOUT: } -// CHECK:STDOUT: %T6: type = assoc_const_decl @T6 [concrete] { -// CHECK:STDOUT: %assoc2: %I4.assoc_type = assoc_entity element2, @I4.%T6 [concrete = constants.%assoc2] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .T4 = @T4.%assoc0 -// CHECK:STDOUT: .T5 = @T5.%assoc1 -// CHECK:STDOUT: .T6 = @T6.%assoc2 -// CHECK:STDOUT: witness = (%T4, %T5, %T6) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T4(@I4.%Self: %I4.type) { -// CHECK:STDOUT: assoc_const T4:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T5(@I4.%Self: %I4.type) { -// CHECK:STDOUT: assoc_const T5:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @T6(@I4.%Self: %I4.type) { -// CHECK:STDOUT: assoc_const T6:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.de506c.1: %.loc17_7.2 as %.loc17_15; -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.de506c.2: %.loc27_7.2 as %.loc27_15 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T4(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T5(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T6(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T4(constants.%I4.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T5(constants.%I4.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @T6(constants.%I4.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_missing_on_definition.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %K.type: type = facet_type <@K> [concrete] -// CHECK:STDOUT: %Self: %K.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %K.assoc_type: type = assoc_entity_type @K [concrete] -// CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @K.%V [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %K.lookup_impl_witness: = lookup_impl_witness %.Self, @K [symbolic_self] -// CHECK:STDOUT: %K.facet: %K.type = facet_value %.Self.as_type, (%K.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %K.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %K_where.type: type = facet_type <@K where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %K.impl_witness.3ea: = impl_witness file.%K.impl_witness_table.loc5 [concrete] -// CHECK:STDOUT: %K.impl_witness.3f0: = impl_witness file.%K.impl_witness_table.loc17 [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .K = %K.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %K.decl: type = interface_decl @K [concrete = constants.%K.type] {} {} -// CHECK:STDOUT: impl_decl @impl.16d [concrete] {} { -// CHECK:STDOUT: %.loc5_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_7.2: type = converted %.loc5_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [concrete = constants.%K.type] -// CHECK:STDOUT: %.Self: %K.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %K.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %V.ref: %K.assoc_type = name_ref V, @V.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc5_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access constants.%K.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc5_26.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc5_26.2: type = converted %.loc5_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc5_14: type = where_expr %.Self [concrete = constants.%K_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc5_26.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %K.impl_witness_table.loc5 = impl_witness_table (%impl_witness_assoc_constant), @impl.16d [concrete] -// CHECK:STDOUT: %K.impl_witness.loc5: = impl_witness %K.impl_witness_table.loc5 [concrete = constants.%K.impl_witness.3ea] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: impl_decl @impl.4b0 [concrete] {} { -// CHECK:STDOUT: %.loc17_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc17_7.2: type = converted %.loc17_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %K.ref: type = name_ref K, file.%K.decl [concrete = constants.%K.type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %K.impl_witness_table.loc17 = impl_witness_table (), @impl.4b0 [concrete] -// CHECK:STDOUT: %K.impl_witness.loc17: = impl_witness %K.impl_witness_table.loc17 [concrete = constants.%K.impl_witness.3f0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @K { -// CHECK:STDOUT: %Self: %K.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %V: type = assoc_const_decl @V [concrete] { -// CHECK:STDOUT: %assoc0: %K.assoc_type = assoc_entity element0, @K.%V [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .V = @V.%assoc0 -// CHECK:STDOUT: witness = (%V) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @V(@K.%Self: %K.type) { -// CHECK:STDOUT: assoc_const V:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.16d: %.loc5_7.2 as %.loc5_14; -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.4b0: %.loc17_7.2 as %K.ref { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%K.impl_witness.loc17 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @V(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @V(constants.%K.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_two_different.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %L.type: type = facet_type <@L> [concrete] -// CHECK:STDOUT: %Self: %L.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %L.assoc_type: type = assoc_entity_type @L [concrete] -// CHECK:STDOUT: %assoc0: %L.assoc_type = assoc_entity element0, @L.%W [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %.Self: %L.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %L.lookup_impl_witness: = lookup_impl_witness %.Self, @L [symbolic_self] -// CHECK:STDOUT: %L.facet: %L.type = facet_value %.Self.as_type, (%L.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %L.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %L_where.type: type = facet_type <@L where %impl.elem0 = %empty_tuple.type and %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %L.impl_witness: = impl_witness file.%L.impl_witness_table [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .L = %L.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %L.decl: type = interface_decl @L [concrete = constants.%L.type] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %L.ref: type = name_ref L, file.%L.decl [concrete = constants.%L.type] -// CHECK:STDOUT: %.Self: %L.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc9_20: %L.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %W.ref.loc9_20: %L.assoc_type = name_ref W, @W.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc9_20: type = facet_access_type %.Self.ref.loc9_20 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc9_20: type = converted %.Self.ref.loc9_20, %.Self.as_type.loc9_20 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc9_20: type = impl_witness_access constants.%L.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc9_26.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc9_26.2: type = converted %.loc9_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.Self.ref.loc9_32: %L.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %W.ref.loc9_32: %L.assoc_type = name_ref W, @W.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc9_32: type = facet_access_type %.Self.ref.loc9_32 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc9_32: type = converted %.Self.ref.loc9_32, %.Self.as_type.loc9_32 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc9_32: type = impl_witness_access constants.%L.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc9_38.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_38.2: type = converted %.loc9_38.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc9_14: type = where_expr %.Self [concrete = constants.%L_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_20, %.loc9_26.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_32, %.loc9_38.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %L.impl_witness_table = impl_witness_table (), @impl [concrete] -// CHECK:STDOUT: %L.impl_witness: = impl_witness %L.impl_witness_table [concrete = constants.%L.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @L { -// CHECK:STDOUT: %Self: %L.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %W: type = assoc_const_decl @W [concrete] { -// CHECK:STDOUT: %assoc0: %L.assoc_type = assoc_entity element0, @L.%W [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .W = @W.%assoc0 -// CHECK:STDOUT: witness = (%W) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @W(@L.%Self: %L.type) { -// CHECK:STDOUT: assoc_const W:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc9_7.2 as %.loc9_14 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%L.impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @W(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @W(constants.%L.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_two_different_first_bad.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %L2.type: type = facet_type <@L2> [concrete] -// CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %L2.assoc_type: type = assoc_entity_type @L2 [concrete] -// CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, @L2.%W2 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %.Self: %L2.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %L2.lookup_impl_witness: = lookup_impl_witness %.Self, @L2 [symbolic_self] -// CHECK:STDOUT: %L2.facet: %L2.type = facet_value %.Self.as_type, (%L2.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %L2.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .L2 = %L2.decl -// CHECK:STDOUT: .BAD5 = -// CHECK:STDOUT: } -// CHECK:STDOUT: %L2.decl: type = interface_decl @L2 [concrete = constants.%L2.type] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %L2.ref: type = name_ref L2, file.%L2.decl [concrete = constants.%L2.type] -// CHECK:STDOUT: %.Self: %L2.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc9_21: %L2.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %W2.ref.loc9_21: %L2.assoc_type = name_ref W2, @W2.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc9_21: type = facet_access_type %.Self.ref.loc9_21 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc9_21: type = converted %.Self.ref.loc9_21, %.Self.as_type.loc9_21 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc9_21: type = impl_witness_access constants.%L2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %BAD5.ref: = name_ref BAD5, [concrete = ] -// CHECK:STDOUT: %.Self.ref.loc9_36: %L2.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %W2.ref.loc9_36: %L2.assoc_type = name_ref W2, @W2.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc9_36: type = facet_access_type %.Self.ref.loc9_36 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc9_36: type = converted %.Self.ref.loc9_36, %.Self.as_type.loc9_36 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc9_36: type = impl_witness_access constants.%L2.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc9_43.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_43.2: type = converted %.loc9_43.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %.loc9_15: type = where_expr %.Self [concrete = ] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_21, -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_36, %.loc9_43.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @L2 { -// CHECK:STDOUT: %Self: %L2.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %W2: type = assoc_const_decl @W2 [concrete] { -// CHECK:STDOUT: %assoc0: %L2.assoc_type = assoc_entity element0, @L2.%W2 [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .W2 = @W2.%assoc0 -// CHECK:STDOUT: witness = (%W2) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @W2(@L2.%Self: %L2.type) { -// CHECK:STDOUT: assoc_const W2:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc9_7.2 as %.loc9_15 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @W2(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @W2(constants.%L2.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_two_different_second_bad.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %L3.type: type = facet_type <@L3> [concrete] -// CHECK:STDOUT: %Self: %L3.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %L3.assoc_type: type = assoc_entity_type @L3 [concrete] -// CHECK:STDOUT: %assoc0: %L3.assoc_type = assoc_entity element0, @L3.%W3 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %.Self: %L3.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %L3.lookup_impl_witness: = lookup_impl_witness %.Self, @L3 [symbolic_self] -// CHECK:STDOUT: %L3.facet: %L3.type = facet_value %.Self.as_type, (%L3.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %L3.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .L3 = %L3.decl -// CHECK:STDOUT: .BAD6 = -// CHECK:STDOUT: } -// CHECK:STDOUT: %L3.decl: type = interface_decl @L3 [concrete = constants.%L3.type] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %.loc9_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc9_7.2: type = converted %.loc9_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %L3.ref: type = name_ref L3, file.%L3.decl [concrete = constants.%L3.type] -// CHECK:STDOUT: %.Self: %L3.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc9_21: %L3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %W3.ref.loc9_21: %L3.assoc_type = name_ref W3, @W3.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc9_21: type = facet_access_type %.Self.ref.loc9_21 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc9_21: type = converted %.Self.ref.loc9_21, %.Self.as_type.loc9_21 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc9_21: type = impl_witness_access constants.%L3.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc9_28.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc9_28.2: type = converted %.loc9_28.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.Self.ref.loc9_34: %L3.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %W3.ref.loc9_34: %L3.assoc_type = name_ref W3, @W3.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc9_34: type = facet_access_type %.Self.ref.loc9_34 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc9_34: type = converted %.Self.ref.loc9_34, %.Self.as_type.loc9_34 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc9_34: type = impl_witness_access constants.%L3.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %BAD6.ref: = name_ref BAD6, [concrete = ] -// CHECK:STDOUT: %.loc9_15: type = where_expr %.Self [concrete = ] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_21, %.loc9_28.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc9_34, -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @L3 { -// CHECK:STDOUT: %Self: %L3.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %W3: type = assoc_const_decl @W3 [concrete] { -// CHECK:STDOUT: %assoc0: %L3.assoc_type = assoc_entity element0, @L3.%W3 [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .W3 = @W3.%assoc0 -// CHECK:STDOUT: witness = (%W3) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @W3(@L3.%Self: %L3.type) { -// CHECK:STDOUT: assoc_const W3:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc9_7.2 as %.loc9_15 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @W3(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @W3(constants.%L3.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_two_different_both_bad.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %L4.type: type = facet_type <@L4> [concrete] -// CHECK:STDOUT: %Self: %L4.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %L4.assoc_type: type = assoc_entity_type @L4 [concrete] -// CHECK:STDOUT: %assoc0: %L4.assoc_type = assoc_entity element0, @L4.%W4 [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %.Self: %L4.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %L4.lookup_impl_witness: = lookup_impl_witness %.Self, @L4 [symbolic_self] -// CHECK:STDOUT: %L4.facet: %L4.type = facet_value %.Self.as_type, (%L4.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %L4.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .L4 = %L4.decl -// CHECK:STDOUT: .BAD7 = -// CHECK:STDOUT: .BAD8 = -// CHECK:STDOUT: } -// CHECK:STDOUT: %L4.decl: type = interface_decl @L4 [concrete = constants.%L4.type] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %.loc13_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc13_7.2: type = converted %.loc13_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %L4.ref: type = name_ref L4, file.%L4.decl [concrete = constants.%L4.type] -// CHECK:STDOUT: %.Self: %L4.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc13_21: %L4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %W4.ref.loc13_21: %L4.assoc_type = name_ref W4, @W4.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc13_21: type = facet_access_type %.Self.ref.loc13_21 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc13_21: type = converted %.Self.ref.loc13_21, %.Self.as_type.loc13_21 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc13_21: type = impl_witness_access constants.%L4.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %BAD7.ref: = name_ref BAD7, [concrete = ] -// CHECK:STDOUT: %.Self.ref.loc13_36: %L4.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %W4.ref.loc13_36: %L4.assoc_type = name_ref W4, @W4.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc13_36: type = facet_access_type %.Self.ref.loc13_36 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc13_36: type = converted %.Self.ref.loc13_36, %.Self.as_type.loc13_36 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc13_36: type = impl_witness_access constants.%L4.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %BAD8.ref: = name_ref BAD8, [concrete = ] -// CHECK:STDOUT: %.loc13_15: type = where_expr %.Self [concrete = ] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc13_21, -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc13_36, -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @L4 { -// CHECK:STDOUT: %Self: %L4.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %W4: type = assoc_const_decl @W4 [concrete] { -// CHECK:STDOUT: %assoc0: %L4.assoc_type = assoc_entity element0, @L4.%W4 [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .W4 = @W4.%assoc0 -// CHECK:STDOUT: witness = (%W4) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @W4(@L4.%Self: %L4.type) { -// CHECK:STDOUT: assoc_const W4:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc13_7.2 as %.loc13_15 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @W4(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @W4(constants.%L4.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- repeated.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %M.type: type = facet_type <@M> [concrete] -// CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %M.assoc_type: type = assoc_entity_type @M [concrete] -// CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%X [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %M.lookup_impl_witness: = lookup_impl_witness %.Self, @M [symbolic_self] -// CHECK:STDOUT: %M.facet: %M.type = facet_value %.Self.as_type, (%M.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: type = impl_witness_access %M.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %M_where.type: type = facet_type <@M where %impl.elem0 = %empty_struct_type> [concrete] -// CHECK:STDOUT: %M.impl_witness: = impl_witness file.%M.impl_witness_table [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .M = %M.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %M.decl: type = interface_decl @M [concrete = constants.%M.type] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %.loc5_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_7.2: type = converted %.loc5_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %M.ref: type = name_ref M, file.%M.decl [concrete = constants.%M.type] -// CHECK:STDOUT: %.Self: %M.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref.loc5_20: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %X.ref.loc5_20: %M.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc5_20: type = facet_access_type %.Self.ref.loc5_20 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc5_20: type = converted %.Self.ref.loc5_20, %.Self.as_type.loc5_20 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc5_20: type = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc5_26.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc5_26.2: type = converted %.loc5_26.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.Self.ref.loc5_32: %M.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %X.ref.loc5_32: %M.assoc_type = name_ref X, @X.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type.loc5_32: type = facet_access_type %.Self.ref.loc5_32 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc5_32: type = converted %.Self.ref.loc5_32, %.Self.as_type.loc5_32 [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0.loc5_32: type = impl_witness_access constants.%M.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc5_38.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc5_38.2: type = converted %.loc5_38.1, constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %.loc5_14: type = where_expr %.Self [concrete = constants.%M_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc5_20, %.loc5_26.2 -// CHECK:STDOUT: requirement_rewrite %impl.elem0.loc5_32, %.loc5_38.2 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %M.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete] -// CHECK:STDOUT: %M.impl_witness: = impl_witness %M.impl_witness_table [concrete = constants.%M.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: type = impl_witness_assoc_constant constants.%empty_struct_type [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @M { -// CHECK:STDOUT: %Self: %M.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %X: type = assoc_const_decl @X [concrete] { -// CHECK:STDOUT: %assoc0: %M.assoc_type = assoc_entity element0, @M.%X [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .X = @X.%assoc0 -// CHECK:STDOUT: witness = (%X) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @X(@M.%Self: %M.type) { -// CHECK:STDOUT: assoc_const X:! type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc5_7.2 as %.loc5_14 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%M.impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @X(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @X(constants.%M.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- non-type.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %N.type: type = facet_type <@N> [concrete] -// CHECK:STDOUT: %Self: %N.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %struct_type.a.225: type = struct_type {.a: %empty_struct_type} [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %N.assoc_type: type = assoc_entity_type @N [concrete] -// CHECK:STDOUT: %assoc0: %N.assoc_type = assoc_entity element0, @N.%Y [concrete] -// CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %N.lookup_impl_witness: = lookup_impl_witness %.Self, @N [symbolic_self] -// CHECK:STDOUT: %N.facet: %N.type = facet_value %.Self.as_type, (%N.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %impl.elem0: %struct_type.a.225 = impl_witness_access %N.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete] -// CHECK:STDOUT: %struct: %struct_type.a.225 = struct_value (%empty_struct) [concrete] -// CHECK:STDOUT: %N_where.type: type = facet_type <@N where %impl.elem0 = %struct> [concrete] -// CHECK:STDOUT: %N.impl_witness: = impl_witness file.%N.impl_witness_table [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .N = %N.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.decl: type = interface_decl @N [concrete = constants.%N.type] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %.loc7_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc7_7.2: type = converted %.loc7_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %N.ref: type = name_ref N, file.%N.decl [concrete = constants.%N.type] -// CHECK:STDOUT: %.Self: %N.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %N.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %Y.ref: %N.assoc_type = name_ref Y, @Y.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc7_20: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0: %struct_type.a.225 = impl_witness_access constants.%N.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %.loc7_32: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc7_33.1: %struct_type.a.225 = struct_literal (%.loc7_32) -// CHECK:STDOUT: %empty_struct: %empty_struct_type = struct_value () [concrete = constants.%empty_struct] -// CHECK:STDOUT: %.loc7_33.2: %empty_struct_type = converted %.loc7_32, %empty_struct [concrete = constants.%empty_struct] -// CHECK:STDOUT: %struct: %struct_type.a.225 = struct_value (%.loc7_33.2) [concrete = constants.%struct] -// CHECK:STDOUT: %.loc7_33.3: %struct_type.a.225 = converted %.loc7_33.1, %struct [concrete = constants.%struct] -// CHECK:STDOUT: %.loc7_14: type = where_expr %.Self [concrete = constants.%N_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %.loc7_33.3 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %N.impl_witness_table = impl_witness_table (%impl_witness_assoc_constant), @impl [concrete] -// CHECK:STDOUT: %N.impl_witness: = impl_witness %N.impl_witness_table [concrete = constants.%N.impl_witness] -// CHECK:STDOUT: %impl_witness_assoc_constant: %struct_type.a.225 = impl_witness_assoc_constant constants.%struct [concrete = constants.%struct] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @N { -// CHECK:STDOUT: %Self: %N.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %Y: %struct_type.a.225 = assoc_const_decl @Y [concrete] { -// CHECK:STDOUT: %assoc0: %N.assoc_type = assoc_entity element0, @N.%Y [concrete = constants.%assoc0] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .Y = @Y.%assoc0 -// CHECK:STDOUT: witness = (%Y) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic assoc_const @Y(@N.%Self: %N.type) { -// CHECK:STDOUT: assoc_const Y:! %struct_type.a.225; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc7_7.2 as %.loc7_14 { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: witness = file.%N.impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Y(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @Y(constants.%N.facet) {} -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_where_rewrite_function.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %IF.type: type = facet_type <@IF> [concrete] -// CHECK:STDOUT: %Self: %IF.type = bind_symbolic_name Self, 0 [symbolic] -// CHECK:STDOUT: %F.type.496: type = fn_type @F.1 [concrete] -// CHECK:STDOUT: %F.1de: %F.type.496 = struct_value () [concrete] -// CHECK:STDOUT: %IF.assoc_type: type = assoc_entity_type @IF [concrete] -// CHECK:STDOUT: %assoc0: %IF.assoc_type = assoc_entity element0, @IF.%F.decl [concrete] -// CHECK:STDOUT: %CD: type = class_type @CD [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %.Self: %IF.type = bind_symbolic_name .Self [symbolic_self] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self [symbolic_self] -// CHECK:STDOUT: %IF.lookup_impl_witness: = lookup_impl_witness %.Self, @IF [symbolic_self] -// CHECK:STDOUT: %IF.facet.01b: %IF.type = facet_value %.Self.as_type, (%IF.lookup_impl_witness) [symbolic_self] -// CHECK:STDOUT: %.c5b: type = fn_type_with_self_type %F.type.496, %IF.facet.01b [symbolic_self] -// CHECK:STDOUT: %impl.elem0: %.c5b = impl_witness_access %IF.lookup_impl_witness, element0 [symbolic_self] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] -// CHECK:STDOUT: %IF_where.type: type = facet_type <@IF where %impl.elem0 = %int_0> [concrete] -// CHECK:STDOUT: %IF.impl_witness: = impl_witness file.%IF.impl_witness_table [concrete] -// CHECK:STDOUT: %F.type.f56: type = fn_type @F.2 [concrete] -// CHECK:STDOUT: %F.fae: %F.type.f56 = struct_value () [concrete] -// CHECK:STDOUT: %IF.facet.60c: %IF.type = facet_value %CD, (%IF.impl_witness) [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .IF = %IF.decl -// CHECK:STDOUT: .CD = %CD.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %IF.decl: type = interface_decl @IF [concrete = constants.%IF.type] {} {} -// CHECK:STDOUT: %CD.decl: type = class_decl @CD [concrete = constants.%CD] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %CD.ref: type = name_ref CD, file.%CD.decl [concrete = constants.%CD] -// CHECK:STDOUT: %IF.ref: type = name_ref IF, file.%IF.decl [concrete = constants.%IF.type] -// CHECK:STDOUT: %.Self: %IF.type = bind_symbolic_name .Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %.Self.ref: %IF.type = name_ref .Self, %.Self [symbolic_self = constants.%.Self] -// CHECK:STDOUT: %F.ref: %IF.assoc_type = name_ref F, @IF.%assoc0 [concrete = constants.%assoc0] -// CHECK:STDOUT: %.Self.as_type: type = facet_access_type %.Self.ref [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %.loc11_21: type = converted %.Self.ref, %.Self.as_type [symbolic_self = constants.%.Self.as_type] -// CHECK:STDOUT: %impl.elem0: %.c5b = impl_witness_access constants.%IF.lookup_impl_witness, element0 [symbolic_self = constants.%impl.elem0] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc11_15: type = where_expr %.Self [concrete = constants.%IF_where.type] { -// CHECK:STDOUT: requirement_rewrite %impl.elem0, %int_0 -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: %IF.impl_witness_table = impl_witness_table (@impl.%F.decl), @impl [concrete] -// CHECK:STDOUT: %IF.impl_witness: = impl_witness %IF.impl_witness_table [concrete = constants.%IF.impl_witness] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: interface @IF { -// CHECK:STDOUT: %Self: %IF.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self] -// CHECK:STDOUT: %F.decl: %F.type.496 = fn_decl @F.1 [concrete = constants.%F.1de] {} {} -// CHECK:STDOUT: %assoc0: %IF.assoc_type = assoc_entity element0, %F.decl [concrete = constants.%assoc0] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self -// CHECK:STDOUT: .F = %assoc0 -// CHECK:STDOUT: witness = (%F.decl) -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %CD.ref as %.loc11_15 { -// CHECK:STDOUT: %F.decl: %F.type.f56 = fn_decl @F.2 [concrete = constants.%F.fae] {} {} -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: witness = file.%IF.impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @CD { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%CD -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @F.1(@IF.%Self: %IF.type) { -// CHECK:STDOUT: fn(); -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F.2() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%Self) {} -// CHECK:STDOUT: -// CHECK:STDOUT: specific @F.1(constants.%IF.facet.60c) {} -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon b/toolchain/check/testdata/impl/self_in_class.carbon similarity index 97% rename from toolchain/check/testdata/impl/no_prelude/self_in_class.carbon rename to toolchain/check/testdata/impl/self_in_class.carbon index 995749ef93da..29ea9dadc042 100644 --- a/toolchain/check/testdata/impl/no_prelude/self_in_class.carbon +++ b/toolchain/check/testdata/impl/self_in_class.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/self_in_class.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/self_in_class.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/self_in_class.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/self_in_class.carbon interface DefaultConstructible { fn Make() -> Self; diff --git a/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon b/toolchain/check/testdata/impl/self_in_signature.carbon similarity index 99% rename from toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon rename to toolchain/check/testdata/impl/self_in_signature.carbon index 9a7432f90e50..00dc87c409e1 100644 --- a/toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon +++ b/toolchain/check/testdata/impl/self_in_signature.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/self_in_signature.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/self_in_signature.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/self_in_signature.carbon interface UseSelf { fn F[self: Self](x: Self) -> Self; diff --git a/toolchain/check/testdata/impl/no_prelude/todo_impl_with_unrelated_fn.carbon b/toolchain/check/testdata/impl/todo_impl_with_unrelated_fn.carbon similarity index 95% rename from toolchain/check/testdata/impl/no_prelude/todo_impl_with_unrelated_fn.carbon rename to toolchain/check/testdata/impl/todo_impl_with_unrelated_fn.carbon index 8375d30a4e8f..4ffa0f0d5204 100644 --- a/toolchain/check/testdata/impl/no_prelude/todo_impl_with_unrelated_fn.carbon +++ b/toolchain/check/testdata/impl/todo_impl_with_unrelated_fn.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/no_prelude/todo_impl_with_unrelated_fn.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/impl/todo_impl_with_unrelated_fn.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/todo_impl_with_unrelated_fn.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/todo_impl_with_unrelated_fn.carbon interface A { fn B(); diff --git a/toolchain/check/testdata/interface/no_prelude/as_type.carbon b/toolchain/check/testdata/interface/as_type.carbon similarity index 91% rename from toolchain/check/testdata/interface/no_prelude/as_type.carbon rename to toolchain/check/testdata/interface/as_type.carbon index d95da898fc63..093b5c2c14f8 100644 --- a/toolchain/check/testdata/interface/no_prelude/as_type.carbon +++ b/toolchain/check/testdata/interface/as_type.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/as_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.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/as_type.carbon interface Empty {} diff --git a/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon b/toolchain/check/testdata/interface/assoc_const_in_generic.carbon similarity index 98% rename from toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon rename to toolchain/check/testdata/interface/assoc_const_in_generic.carbon index 88874fcdd1d4..0802d98a59f7 100644 --- a/toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon +++ b/toolchain/check/testdata/interface/assoc_const_in_generic.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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/assoc_const_in_generic.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/assoc_const_in_generic.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/assoc_const_in_generic.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/assoc_const_in_generic.carbon interface I(T:! type) { fn F(U:! type) -> U; diff --git a/toolchain/check/testdata/interface/no_prelude/basic.carbon b/toolchain/check/testdata/interface/basic.carbon similarity index 94% rename from toolchain/check/testdata/interface/no_prelude/basic.carbon rename to toolchain/check/testdata/interface/basic.carbon index a66189f133b0..9d312a942949 100644 --- a/toolchain/check/testdata/interface/no_prelude/basic.carbon +++ b/toolchain/check/testdata/interface/basic.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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/basic.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/basic.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/basic.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/basic.carbon interface Empty { } diff --git a/toolchain/check/testdata/interface/no_prelude/export_name.carbon b/toolchain/check/testdata/interface/export_name.carbon similarity index 95% rename from toolchain/check/testdata/interface/no_prelude/export_name.carbon rename to toolchain/check/testdata/interface/export_name.carbon index ff4bd6b5f392..077e471e9895 100644 --- a/toolchain/check/testdata/interface/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/interface/export_name.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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/export_name.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/export_name.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/export_name.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/export_name.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon b/toolchain/check/testdata/interface/fail_add_member_outside_definition.carbon similarity index 96% rename from toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon rename to toolchain/check/testdata/interface/fail_add_member_outside_definition.carbon index c76b0f7eab2b..8df965c316a2 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon +++ b/toolchain/check/testdata/interface/fail_add_member_outside_definition.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_add_member_outside_definition.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_add_member_outside_definition.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_add_member_outside_definition.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_add_member_outside_definition.carbon interface Interface { } diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_alias.carbon b/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon similarity index 99% rename from toolchain/check/testdata/interface/no_prelude/fail_assoc_const_alias.carbon rename to toolchain/check/testdata/interface/fail_assoc_const_alias.carbon index baa0ffbe657a..60ba3c0b83f2 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_alias.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_alias.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_assoc_const_alias.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_assoc_const_alias.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_alias.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_assoc_const_alias.carbon // --- core.carbon package Core; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon b/toolchain/check/testdata/interface/fail_assoc_const_not_binding.carbon similarity index 95% rename from toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon rename to toolchain/check/testdata/interface/fail_assoc_const_not_binding.carbon index 8259fc98ed7c..bbf6a2767ac1 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_not_binding.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_assoc_const_not_binding.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_assoc_const_not_binding.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_binding.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_assoc_const_not_binding.carbon // --- fail_tuple_pattern.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon b/toolchain/check/testdata/interface/fail_assoc_const_not_constant.carbon similarity index 81% rename from toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon rename to toolchain/check/testdata/interface/fail_assoc_const_not_constant.carbon index 208fcaffc2d4..d5d6b319b3d9 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_not_constant.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // 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_assoc_const_not_constant.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_assoc_const_not_constant.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_not_constant.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_assoc_const_not_constant.carbon interface I { // CHECK:STDERR: fail_assoc_const_not_constant.carbon:[[@LINE+4]]:7: error: found runtime binding pattern in associated constant declaration; expected a `:!` binding [ExpectedSymbolicBindingInAssociatedConstant] diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon b/toolchain/check/testdata/interface/fail_assoc_const_template.carbon similarity index 90% rename from toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon rename to toolchain/check/testdata/interface/fail_assoc_const_template.carbon index 348251d9da86..9ddb22b537ea 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_const_template.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_assoc_const_template.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_assoc_const_template.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_const_template.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_assoc_const_template.carbon interface I { // CHECK:STDERR: fail_assoc_const_template.carbon:[[@LINE+4]]:20: error: associated constant has `template` binding [TemplateBindingInAssociatedConstantDecl] diff --git a/toolchain/check/testdata/interface/no_prelude/fail_assoc_fn_invalid_use.carbon b/toolchain/check/testdata/interface/fail_assoc_fn_invalid_use.carbon similarity index 96% rename from toolchain/check/testdata/interface/no_prelude/fail_assoc_fn_invalid_use.carbon rename to toolchain/check/testdata/interface/fail_assoc_fn_invalid_use.carbon index d76ed1bce343..ae5bda4ee31c 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_assoc_fn_invalid_use.carbon +++ b/toolchain/check/testdata/interface/fail_assoc_fn_invalid_use.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_assoc_fn_invalid_use.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_assoc_fn_invalid_use.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_assoc_fn_invalid_use.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_assoc_fn_invalid_use.carbon // --- fail_member_access.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon b/toolchain/check/testdata/interface/fail_definition_imported.carbon similarity index 92% rename from toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon rename to toolchain/check/testdata/interface/fail_definition_imported.carbon index bac5c652d14e..5a6884247e43 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon +++ b/toolchain/check/testdata/interface/fail_definition_imported.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_definition_imported.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_definition_imported.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_definition_imported.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_definition_imported.carbon // --- a.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon b/toolchain/check/testdata/interface/fail_duplicate.carbon similarity index 98% rename from toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon rename to toolchain/check/testdata/interface/fail_duplicate.carbon index b9c7a12c7471..be196fb46535 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon +++ b/toolchain/check/testdata/interface/fail_duplicate.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_duplicate.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_duplicate.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_duplicate.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_duplicate.carbon // --- fail_redefine_without_dependents.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon b/toolchain/check/testdata/interface/fail_generic_redeclaration.carbon similarity index 97% rename from toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon rename to toolchain/check/testdata/interface/fail_generic_redeclaration.carbon index b45b11ca80d7..f8f2ca46ad28 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon +++ b/toolchain/check/testdata/interface/fail_generic_redeclaration.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_generic_redeclaration.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_generic_redeclaration.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_generic_redeclaration.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_generic_redeclaration.carbon interface NotGeneric; // CHECK:STDERR: fail_generic_redeclaration.carbon:[[@LINE+7]]:1: error: redeclaration differs because of parameter list [RedeclParamListDiffers] diff --git a/toolchain/check/testdata/interface/no_prelude/fail_incomplete_type.carbon b/toolchain/check/testdata/interface/fail_incomplete_type.carbon similarity index 92% rename from toolchain/check/testdata/interface/no_prelude/fail_incomplete_type.carbon rename to toolchain/check/testdata/interface/fail_incomplete_type.carbon index 6a5f94a4b57b..96937142763a 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_incomplete_type.carbon +++ b/toolchain/check/testdata/interface/fail_incomplete_type.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_incomplete_type.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_incomplete_type.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_incomplete_type.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_incomplete_type.carbon class C; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon b/toolchain/check/testdata/interface/fail_lookup_in_type_type.carbon similarity index 93% rename from toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon rename to toolchain/check/testdata/interface/fail_lookup_in_type_type.carbon index c9849e8c0df7..b22c536c7127 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon +++ b/toolchain/check/testdata/interface/fail_lookup_in_type_type.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_lookup_in_type_type.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_lookup_in_type_type.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_lookup_in_type_type.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_lookup_in_type_type.carbon // --- fail_lookup_in_type.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon b/toolchain/check/testdata/interface/fail_lookup_undefined.carbon similarity index 96% rename from toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon rename to toolchain/check/testdata/interface/fail_lookup_undefined.carbon index a5c01c645650..c099175eee01 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon +++ b/toolchain/check/testdata/interface/fail_lookup_undefined.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_lookup_undefined.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_lookup_undefined.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_lookup_undefined.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_lookup_undefined.carbon interface Undefined; diff --git a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/interface/fail_modifiers.carbon similarity index 98% rename from toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon rename to toolchain/check/testdata/interface/fail_modifiers.carbon index 8e312d756acd..5963637ad215 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/interface/fail_modifiers.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_modifiers.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_modifiers.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_modifiers.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_modifiers.carbon // --- fail_abstract.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon b/toolchain/check/testdata/interface/fail_redeclare_member.carbon similarity index 93% rename from toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon rename to toolchain/check/testdata/interface/fail_redeclare_member.carbon index 94d343e31e99..ab551503bb96 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon +++ b/toolchain/check/testdata/interface/fail_redeclare_member.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_redeclare_member.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_redeclare_member.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_redeclare_member.carbon interface Interface { fn F(); diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon b/toolchain/check/testdata/interface/fail_todo_generic_default_fn.carbon similarity index 98% rename from toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon rename to toolchain/check/testdata/interface/fail_todo_generic_default_fn.carbon index 479eba87c96e..d662c553c175 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_generic_default_fn.carbon +++ b/toolchain/check/testdata/interface/fail_todo_generic_default_fn.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_todo_generic_default_fn.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_todo_generic_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/fail_todo_generic_default_fn.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_todo_generic_default_fn.carbon interface I(T:! type) { // TODO: Use `default` here. diff --git a/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon b/toolchain/check/testdata/interface/fail_todo_modifiers.carbon similarity index 94% rename from toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon rename to toolchain/check/testdata/interface/fail_todo_modifiers.carbon index 6fbf7cb2371a..e27c04f49c79 100644 --- a/toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon +++ b/toolchain/check/testdata/interface/fail_todo_modifiers.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_todo_modifiers.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/fail_todo_modifiers.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_todo_modifiers.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/fail_todo_modifiers.carbon interface Modifiers { // CHECK:STDERR: fail_todo_modifiers.carbon:[[@LINE+4]]:3: error: semantics TODO: `interface modifier` [SemanticsTodo] diff --git a/toolchain/check/testdata/interface/no_prelude/generic.carbon b/toolchain/check/testdata/interface/generic.carbon similarity index 99% rename from toolchain/check/testdata/interface/no_prelude/generic.carbon rename to toolchain/check/testdata/interface/generic.carbon index 897a1fa72693..552f03bd07e3 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic.carbon +++ b/toolchain/check/testdata/interface/generic.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/generic.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/generic.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/generic.carbon // --- generic.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/generic_binding_after_assoc_const.carbon b/toolchain/check/testdata/interface/generic_binding_after_assoc_const.carbon similarity index 94% rename from toolchain/check/testdata/interface/no_prelude/generic_binding_after_assoc_const.carbon rename to toolchain/check/testdata/interface/generic_binding_after_assoc_const.carbon index 4ffb1a4b43f3..86a3d605c593 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_binding_after_assoc_const.carbon +++ b/toolchain/check/testdata/interface/generic_binding_after_assoc_const.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_binding_after_assoc_const.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/generic_binding_after_assoc_const.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/generic_binding_after_assoc_const.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/generic_binding_after_assoc_const.carbon interface I { fn F(T:! type); diff --git a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon b/toolchain/check/testdata/interface/generic_import.carbon similarity index 98% rename from toolchain/check/testdata/interface/no_prelude/generic_import.carbon rename to toolchain/check/testdata/interface/generic_import.carbon index 3dcfd9cf4465..98cf38a61bd3 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_import.carbon +++ b/toolchain/check/testdata/interface/generic_import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/generic_import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/generic_import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/generic_import.carbon // --- a.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon b/toolchain/check/testdata/interface/generic_vs_params.carbon similarity index 99% rename from toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon rename to toolchain/check/testdata/interface/generic_vs_params.carbon index 95c9bcbf0f49..3d1299d36cd1 100644 --- a/toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon +++ b/toolchain/check/testdata/interface/generic_vs_params.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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_vs_params.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/generic_vs_params.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/generic_vs_params.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/generic_vs_params.carbon // --- params.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/import.carbon b/toolchain/check/testdata/interface/import.carbon similarity index 98% rename from toolchain/check/testdata/interface/no_prelude/import.carbon rename to toolchain/check/testdata/interface/import.carbon index 449801b7f06b..d1c6e6cecd1f 100644 --- a/toolchain/check/testdata/interface/no_prelude/import.carbon +++ b/toolchain/check/testdata/interface/import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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/import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/import.carbon // --- a.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/import_access.carbon b/toolchain/check/testdata/interface/import_access.carbon similarity index 99% rename from toolchain/check/testdata/interface/no_prelude/import_access.carbon rename to toolchain/check/testdata/interface/import_access.carbon index 33abb55b4878..1a59246efca3 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/interface/import_access.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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/import_access.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/import_access.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/import_access.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/import_access.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon b/toolchain/check/testdata/interface/import_interface_decl.carbon similarity index 95% rename from toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon rename to toolchain/check/testdata/interface/import_interface_decl.carbon index 3c20968656f9..78094185966a 100644 --- a/toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon +++ b/toolchain/check/testdata/interface/import_interface_decl.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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/import_interface_decl.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/import_interface_decl.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/import_interface_decl.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/import_interface_decl.carbon // --- a.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/check/testdata/interface/no_prelude/local.carbon b/toolchain/check/testdata/interface/local.carbon similarity index 97% rename from toolchain/check/testdata/interface/no_prelude/local.carbon rename to toolchain/check/testdata/interface/local.carbon index b13b2e54915f..06d2b4db7a59 100644 --- a/toolchain/check/testdata/interface/no_prelude/local.carbon +++ b/toolchain/check/testdata/interface/local.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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/local.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/local.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/local.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/local.carbon fn F() { interface I { diff --git a/toolchain/check/testdata/interface/no_prelude/name_poisoning.carbon b/toolchain/check/testdata/interface/name_poisoning.carbon similarity index 97% rename from toolchain/check/testdata/interface/no_prelude/name_poisoning.carbon rename to toolchain/check/testdata/interface/name_poisoning.carbon index 4afeb36b9410..94453e7c504b 100644 --- a/toolchain/check/testdata/interface/no_prelude/name_poisoning.carbon +++ b/toolchain/check/testdata/interface/name_poisoning.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // 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/name_poisoning.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/name_poisoning.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/name_poisoning.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/name_poisoning.carbon // --- no_poison.carbon diff --git a/toolchain/check/testdata/interface/no_prelude/self.carbon b/toolchain/check/testdata/interface/self.carbon similarity index 96% rename from toolchain/check/testdata/interface/no_prelude/self.carbon rename to toolchain/check/testdata/interface/self.carbon index c42bcb584acf..14fd4e33cc8c 100644 --- a/toolchain/check/testdata/interface/no_prelude/self.carbon +++ b/toolchain/check/testdata/interface/self.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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/self.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/self.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/self.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/self.carbon interface UseSelf { fn F[self: Self]() -> Self; diff --git a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon b/toolchain/check/testdata/interface/syntactic_merge.carbon similarity index 99% rename from toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon rename to toolchain/check/testdata/interface/syntactic_merge.carbon index cbbfcccf7989..8b9c55423863 100644 --- a/toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +++ b/toolchain/check/testdata/interface/syntactic_merge.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // 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/syntactic_merge.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/syntactic_merge.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/syntactic_merge.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/syntactic_merge.carbon // --- basic.carbon diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/bad_import.carbon b/toolchain/check/testdata/interop/cpp/bad_import.carbon similarity index 93% rename from toolchain/check/testdata/interop/cpp/no_prelude/bad_import.carbon rename to toolchain/check/testdata/interop/cpp/bad_import.carbon index abbb46d00ef4..192808f6b70d 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/bad_import.carbon +++ b/toolchain/check/testdata/interop/cpp/bad_import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/bad_import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/bad_import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/bad_import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/bad_import.carbon // --- fail_import_cpp.carbon diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/class.carbon b/toolchain/check/testdata/interop/cpp/class.carbon similarity index 99% rename from toolchain/check/testdata/interop/cpp/no_prelude/class.carbon rename to toolchain/check/testdata/interop/cpp/class.carbon index 2de176984499..6b08fe3c2dd1 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/class.carbon +++ b/toolchain/check/testdata/interop/cpp/class.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/class.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/class.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/class.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/class.carbon // ============================================================================ // Declaration diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/cpp_diagnostics.carbon b/toolchain/check/testdata/interop/cpp/cpp_diagnostics.carbon similarity index 99% rename from toolchain/check/testdata/interop/cpp/no_prelude/cpp_diagnostics.carbon rename to toolchain/check/testdata/interop/cpp/cpp_diagnostics.carbon index b11961ef272f..c7438c2713cb 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/cpp_diagnostics.carbon +++ b/toolchain/check/testdata/interop/cpp/cpp_diagnostics.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/cpp_diagnostics.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/cpp_diagnostics.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/cpp_diagnostics.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/cpp_diagnostics.carbon // ============================================================================ // One error diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/cpp_namespace.carbon b/toolchain/check/testdata/interop/cpp/cpp_namespace.carbon similarity index 97% rename from toolchain/check/testdata/interop/cpp/no_prelude/cpp_namespace.carbon rename to toolchain/check/testdata/interop/cpp/cpp_namespace.carbon index bf27d8f70632..9086544445ec 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/cpp_namespace.carbon +++ b/toolchain/check/testdata/interop/cpp/cpp_namespace.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/cpp_namespace.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/cpp_namespace.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/cpp_namespace.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/cpp_namespace.carbon // --- header.h diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/fail_fuzzing.carbon b/toolchain/check/testdata/interop/cpp/fail_fuzzing.carbon similarity index 82% rename from toolchain/check/testdata/interop/cpp/no_prelude/fail_fuzzing.carbon rename to toolchain/check/testdata/interop/cpp/fail_fuzzing.carbon index 41f9a07de78c..7e7652d4b255 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/fail_fuzzing.carbon +++ b/toolchain/check/testdata/interop/cpp/fail_fuzzing.carbon @@ -6,9 +6,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/fail_fuzzing.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/fail_fuzzing.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/fail_fuzzing.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/fail_fuzzing.carbon // CHECK:STDERR: fail_fuzzing.carbon:[[@LINE+4]]:1: error: `Cpp` import found during fuzzing [CppInteropFuzzing] // CHECK:STDERR: import Cpp library "file.h"; diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon b/toolchain/check/testdata/interop/cpp/file_not_found.carbon similarity index 89% rename from toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon rename to toolchain/check/testdata/interop/cpp/file_not_found.carbon index f72ab172472a..cf8b95e3d5fe 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon +++ b/toolchain/check/testdata/interop/cpp/file_not_found.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/file_not_found.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/file_not_found.carbon // CHECK:STDERR: fail_cpp_file_not_found.carbon.generated.cpp_imports.h:1: error: C++: // CHECK:STDERR: fail_cpp_file_not_found.carbon.generated.cpp_imports.h:1:10: fatal error: 'not_found.h' file not found // CHECK:STDERR: 1 | #include "not_found.h" diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/function/function.carbon b/toolchain/check/testdata/interop/cpp/function/function.carbon similarity index 98% rename from toolchain/check/testdata/interop/cpp/no_prelude/function/function.carbon rename to toolchain/check/testdata/interop/cpp/function/function.carbon index f09fadc30228..c38e1698fb1c 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/function/function.carbon +++ b/toolchain/check/testdata/interop/cpp/function/function.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/function/function.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/function.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/function/function.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/function.carbon // ============================================================================ // Global diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/function/inline.carbon b/toolchain/check/testdata/interop/cpp/function/inline.carbon similarity index 95% rename from toolchain/check/testdata/interop/cpp/no_prelude/function/inline.carbon rename to toolchain/check/testdata/interop/cpp/function/inline.carbon index 2343057e9f89..597dd531754d 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/function/inline.carbon +++ b/toolchain/check/testdata/interop/cpp/function/inline.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/function/inline.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/inline.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/function/inline.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/inline.carbon // ============================================================================ // With definition diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/function/struct.carbon b/toolchain/check/testdata/interop/cpp/function/struct.carbon similarity index 99% rename from toolchain/check/testdata/interop/cpp/no_prelude/function/struct.carbon rename to toolchain/check/testdata/interop/cpp/function/struct.carbon index b473ce352d0f..14ab85695c6b 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/function/struct.carbon +++ b/toolchain/check/testdata/interop/cpp/function/struct.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/function/struct.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/struct.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/function/struct.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/struct.carbon // ============================================================================ // Forward-declared struct as parameter type diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/include.carbon b/toolchain/check/testdata/interop/cpp/include.carbon similarity index 86% rename from toolchain/check/testdata/interop/cpp/no_prelude/include.carbon rename to toolchain/check/testdata/interop/cpp/include.carbon index e9207960ecf7..ef14a2319dd7 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/include.carbon +++ b/toolchain/check/testdata/interop/cpp/include.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/include.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/include.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/include.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/include.carbon // --- included_file.h diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/multiple_imports.carbon b/toolchain/check/testdata/interop/cpp/multiple_imports.carbon similarity index 85% rename from toolchain/check/testdata/interop/cpp/no_prelude/multiple_imports.carbon rename to toolchain/check/testdata/interop/cpp/multiple_imports.carbon index 2da97aad3683..1bc22a17bb49 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/multiple_imports.carbon +++ b/toolchain/check/testdata/interop/cpp/multiple_imports.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/multiple_imports.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/multiple_imports.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/multiple_imports.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/multiple_imports.carbon // --- file1.h diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/namespace.carbon b/toolchain/check/testdata/interop/cpp/namespace.carbon similarity index 98% rename from toolchain/check/testdata/interop/cpp/no_prelude/namespace.carbon rename to toolchain/check/testdata/interop/cpp/namespace.carbon index 3b5073fc01cb..63040064d3ff 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/namespace.carbon +++ b/toolchain/check/testdata/interop/cpp/namespace.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/namespace.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/namespace.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/namespace.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/namespace.carbon // ============================================================================ // Single diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/struct.carbon b/toolchain/check/testdata/interop/cpp/struct.carbon similarity index 99% rename from toolchain/check/testdata/interop/cpp/no_prelude/struct.carbon rename to toolchain/check/testdata/interop/cpp/struct.carbon index 0c5c6943cbab..31848cd2efb1 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/struct.carbon +++ b/toolchain/check/testdata/interop/cpp/struct.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/struct.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/struct.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/struct.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/struct.carbon // ============================================================================ // Declaration diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/union.carbon b/toolchain/check/testdata/interop/cpp/union.carbon similarity index 99% rename from toolchain/check/testdata/interop/cpp/no_prelude/union.carbon rename to toolchain/check/testdata/interop/cpp/union.carbon index b38348a35048..5119cfede544 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/union.carbon +++ b/toolchain/check/testdata/interop/cpp/union.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/union.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/union.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/union.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/union.carbon // ============================================================================ // Declaration diff --git a/toolchain/check/testdata/interop/cpp/no_prelude/unsupported_decl_type.carbon b/toolchain/check/testdata/interop/cpp/unsupported_decl_type.carbon similarity index 91% rename from toolchain/check/testdata/interop/cpp/no_prelude/unsupported_decl_type.carbon rename to toolchain/check/testdata/interop/cpp/unsupported_decl_type.carbon index abcd0e3c3482..219890367e16 100644 --- a/toolchain/check/testdata/interop/cpp/no_prelude/unsupported_decl_type.carbon +++ b/toolchain/check/testdata/interop/cpp/unsupported_decl_type.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/unsupported_decl_type.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/unsupported_decl_type.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/unsupported_decl_type.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/unsupported_decl_type.carbon // --- unsupported_decl.h diff --git a/toolchain/check/testdata/let/no_prelude/import.carbon b/toolchain/check/testdata/let/import.carbon similarity index 97% rename from toolchain/check/testdata/let/no_prelude/import.carbon rename to toolchain/check/testdata/let/import.carbon index 45ce8e4aae24..835bbf81811e 100644 --- a/toolchain/check/testdata/let/no_prelude/import.carbon +++ b/toolchain/check/testdata/let/import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/let/no_prelude/import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/let/import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/no_prelude/import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/import.carbon // --- implicit.carbon diff --git a/toolchain/check/testdata/let/no_prelude/import_access.carbon b/toolchain/check/testdata/let/import_access.carbon similarity index 97% rename from toolchain/check/testdata/let/no_prelude/import_access.carbon rename to toolchain/check/testdata/let/import_access.carbon index f2930fb81b29..f9b352bac5dc 100644 --- a/toolchain/check/testdata/let/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/let/import_access.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/let/no_prelude/import_access.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/let/import_access.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/no_prelude/import_access.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/let/import_access.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/operators/overloaded/index.carbon b/toolchain/check/testdata/operators/overloaded/index.carbon index 496b8c96f740..0f283a9f0a7a 100644 --- a/toolchain/check/testdata/operators/overloaded/index.carbon +++ b/toolchain/check/testdata/operators/overloaded/index.carbon @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: @@ -11,646 +11,437 @@ // TIP: To dump output, run: // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/overloaded/index.carbon -// --- overloaded_index.carbon +// --- core_wrong_index_with.carbon + +package Core library "[[@TEST_NAME]]"; + +class IndexWith {} + +// --- fail_wrong_index_with.carbon library "[[@TEST_NAME]]"; -class C {} -class ElementType {} -class SubscriptType {} +import Core library "core_wrong_index_with"; -impl C as Core.IndexWith(SubscriptType, ElementType) { - fn At[self: Self](subscript: SubscriptType) -> ElementType { - return {}; - } -} - -let s: SubscriptType = {}; -let c: C = {}; -let x: ElementType = c[s]; - -// --- overloaded_builtin.carbon - -library "[[@TEST_NAME]]"; - -impl (i32, i32) as Core.IndexWith(i32, i32) { - fn At[self: Self](subscript: i32) -> i32 { - return self.0; - } -} - -let s: (i32, i32) = (1, 5); -let e: i32 = s[0]; - -// --- fail_invalid_subscript_type.carbon - -library "[[@TEST_NAME]]"; - -class C { } -class ElementType {} -class SubscriptType {} - -impl C as Core.IndexWith(SubscriptType, ElementType) { - fn At[self: Self](subscript: SubscriptType) -> ElementType { - return {}; - } -} - -let c: C = {}; -// CHECK:STDERR: fail_invalid_subscript_type.carbon:[[@LINE+7]]:22: error: cannot implicitly convert expression of type `Core.IntLiteral` to `SubscriptType` [ConversionFailure] -// CHECK:STDERR: let x: ElementType = c[0]; -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: fail_invalid_subscript_type.carbon:[[@LINE+4]]:22: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(SubscriptType)` [MissingImplInMemberAccessNote] -// CHECK:STDERR: let x: ElementType = c[0]; -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_wrong_index_with.carbon:[[@LINE+4]]:10: error: type `Core.IntLiteral` does not support indexing [TypeNotIndexable] +// CHECK:STDERR: fn F() { 0[1]; } +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -let x: ElementType = c[0]; +fn F() { 0[1]; } -// --- fail_index_with_not_implemented.carbon +// --- fail_missing_index_with.carbon library "[[@TEST_NAME]]"; -class C { } - -let c: C = {}; -// CHECK:STDERR: fail_index_with_not_implemented.carbon:[[@LINE+4]]:14: error: type `C` does not support indexing [TypeNotIndexable] -// CHECK:STDERR: let x: i32 = c[0]; -// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_missing_index_with.carbon:[[@LINE+8]]:10: error: `Core.IndexWith` implicitly referenced here, but package `Core` not found [CoreNotFound] +// CHECK:STDERR: fn F() { 0[1]; } +// CHECK:STDERR: ^~~~ // CHECK:STDERR: -let x: i32 = c[0]; +// CHECK:STDERR: fail_missing_index_with.carbon:[[@LINE+4]]:10: error: type `Core.IntLiteral` does not support indexing [TypeNotIndexable] +// CHECK:STDERR: fn F() { 0[1]; } +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +fn F() { 0[1]; } +// --- core_wrong_arg_count.carbon -// CHECK:STDOUT: --- overloaded_index.carbon +package Core library "[[@TEST_NAME]]"; + +interface IndexWith(SubscriptType:! type) { + fn At[self: Self](subscript: SubscriptType) -> (); +} + +// --- wrong_arg_count.carbon + +library "[[@TEST_NAME]]"; + +import Core library "core_wrong_arg_count"; + +impl () as Core.IndexWith(()) { + fn At[self: Self](subscript: ()) -> () { + return (); + } +} + +fn F() { ()[()]; } + +// CHECK:STDOUT: --- core_wrong_index_with.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %IndexWith: type = class_type @IndexWith [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .IndexWith = %IndexWith.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %IndexWith.decl: type = class_decl @IndexWith [concrete = constants.%IndexWith] {} {} +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @IndexWith { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%IndexWith +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_wrong_index_with.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %IndexWith: type = class_type @IndexWith [concrete] // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] // CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %ElementType.e6b: type = class_type @ElementType [concrete] -// CHECK:STDOUT: %SubscriptType.8ee: type = class_type @SubscriptType [concrete] -// CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete] -// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete] -// CHECK:STDOUT: %IndexWith.type.e80: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.8ee, %ElementType.e6b)> [concrete] -// CHECK:STDOUT: %At.type.b3f: type = fn_type @At.1, @IndexWith(%SubscriptType.8ee, %ElementType.e6b) [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness file.%IndexWith.impl_witness_table [concrete] -// CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] -// CHECK:STDOUT: %pattern_type.df7: type = pattern_type %SubscriptType.8ee [concrete] -// CHECK:STDOUT: %pattern_type.c39: type = pattern_type %ElementType.e6b [concrete] -// CHECK:STDOUT: %At.type.178: type = fn_type @At.2 [concrete] -// CHECK:STDOUT: %At.d43: %At.type.178 = struct_value () [concrete] -// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.e80 = facet_value %C, (%IndexWith.impl_witness) [concrete] -// CHECK:STDOUT: %ElementType.val: %ElementType.e6b = struct_value () [concrete] -// CHECK:STDOUT: %SubscriptType.val: %SubscriptType.8ee = struct_value () [concrete] -// CHECK:STDOUT: %C.val: %C = struct_value () [concrete] -// CHECK:STDOUT: %.d94: type = fn_type_with_self_type %At.type.b3f, %IndexWith.facet [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .IndexWith = %Core.IndexWith -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: import Core//core_wrong_index_with // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic] +// CHECK:STDOUT: %Core.IndexWith: type = import_ref Core//core_wrong_index_with, IndexWith, loaded [concrete = constants.%IndexWith] +// CHECK:STDOUT: %Core.import_ref.8f2: = import_ref Core//core_wrong_index_with, loc4_18, loaded [concrete = constants.%complete_type] +// CHECK:STDOUT: %Core.import_ref.4c7 = import_ref Core//core_wrong_index_with, inst16 [no loc], unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .ElementType = %ElementType.decl -// CHECK:STDOUT: .SubscriptType = %SubscriptType.decl -// CHECK:STDOUT: .s = %s -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} -// CHECK:STDOUT: %ElementType.decl: type = class_decl @ElementType [concrete = constants.%ElementType.e6b] {} {} -// CHECK:STDOUT: %SubscriptType.decl: type = class_decl @SubscriptType [concrete = constants.%SubscriptType.8ee] {} {} -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] -// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.504 = name_ref IndexWith, imports.%Core.IndexWith [concrete = constants.%IndexWith.generic] -// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [concrete = constants.%SubscriptType.8ee] -// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [concrete = constants.%ElementType.e6b] -// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%SubscriptType.8ee, constants.%ElementType.e6b)> [concrete = constants.%IndexWith.type.e80] -// CHECK:STDOUT: } -// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (@impl.%At.decl), @impl [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %s.patt: %pattern_type.df7 = binding_pattern s [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, %SubscriptType.decl [concrete = constants.%SubscriptType.8ee] -// CHECK:STDOUT: %.loc14_25.1: ref %SubscriptType.8ee = temporary_storage -// CHECK:STDOUT: %.loc14_25.2: init %SubscriptType.8ee = class_init (), %.loc14_25.1 [concrete = constants.%SubscriptType.val] -// CHECK:STDOUT: %.loc14_25.3: ref %SubscriptType.8ee = temporary %.loc14_25.1, %.loc14_25.2 -// CHECK:STDOUT: %.loc14_25.4: ref %SubscriptType.8ee = converted @__global_init.%.loc14, %.loc14_25.3 -// CHECK:STDOUT: %s: ref %SubscriptType.8ee = bind_name s, %.loc14_25.4 -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc15_13.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc15_13.2: init %C = class_init (), %.loc15_13.1 [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc15_13.3: ref %C = temporary %.loc15_13.1, %.loc15_13.2 -// CHECK:STDOUT: %.loc15_13.4: ref %C = converted @__global_init.%.loc15, %.loc15_13.3 -// CHECK:STDOUT: %c: ref %C = bind_name c, %.loc15_13.4 -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %x.patt: %pattern_type.c39 = binding_pattern x [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, %ElementType.decl [concrete = constants.%ElementType.e6b] -// CHECK:STDOUT: %.loc16: ref %ElementType.e6b = temporary @__global_init.%.loc16_25, @__global_init.%At.call -// CHECK:STDOUT: %x: ref %ElementType.e6b = bind_name x, %.loc16 +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C.ref as %IndexWith.type { -// CHECK:STDOUT: %At.decl: %At.type.178 = fn_decl @At.2 [concrete = constants.%At.d43] { -// CHECK:STDOUT: %self.patt: %pattern_type.c48 = binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: %pattern_type.c48 = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %subscript.patt: %pattern_type.df7 = binding_pattern subscript [concrete] -// CHECK:STDOUT: %subscript.param_patt: %pattern_type.df7 = value_param_pattern %subscript.patt, call_param1 [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.c39 = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.c39 = out_param_pattern %return.patt, call_param2 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [concrete = constants.%ElementType.e6b] -// CHECK:STDOUT: %self.param: %C = value_param call_param0 -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%C.ref [concrete = constants.%C] -// CHECK:STDOUT: %self: %C = bind_name self, %self.param -// CHECK:STDOUT: %subscript.param: %SubscriptType.8ee = value_param call_param1 -// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [concrete = constants.%SubscriptType.8ee] -// CHECK:STDOUT: %subscript: %SubscriptType.8ee = bind_name subscript, %subscript.param -// CHECK:STDOUT: %return.param: ref %ElementType.e6b = out_param call_param2 -// CHECK:STDOUT: %return: ref %ElementType.e6b = return_slot %return.param -// CHECK:STDOUT: } +// CHECK:STDOUT: class @IndexWith [from "core_wrong_index_with.carbon"] { +// CHECK:STDOUT: complete_type_witness = imports.%Core.import_ref.8f2 // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .SubscriptType = -// CHECK:STDOUT: .ElementType = -// CHECK:STDOUT: .At = %At.decl -// CHECK:STDOUT: witness = file.%IndexWith.impl_witness +// CHECK:STDOUT: .Self = imports.%Core.import_ref.4c7 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @C { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @ElementType { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%ElementType.e6b -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @SubscriptType { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%SubscriptType.8ee -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @At.2(%self.param: %C, %subscript.param: %SubscriptType.8ee) -> %return.param: %ElementType.e6b { +// CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_13.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc10_13.2: init %ElementType.e6b = class_init (), %return [concrete = constants.%ElementType.val] -// CHECK:STDOUT: %.loc10_14: init %ElementType.e6b = converted %.loc10_13.1, %.loc10_13.2 [concrete = constants.%ElementType.val] -// CHECK:STDOUT: return %.loc10_14 to %return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc15: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %c.ref: ref %C = name_ref c, file.%c -// CHECK:STDOUT: %s.ref: ref %SubscriptType.8ee = name_ref s, file.%s -// CHECK:STDOUT: %.loc16_24: %SubscriptType.8ee = bind_value %s.ref -// CHECK:STDOUT: %impl.elem0: %.d94 = impl_witness_access constants.%IndexWith.impl_witness, element0 [concrete = constants.%At.d43] -// CHECK:STDOUT: %bound_method: = bound_method %c.ref, %impl.elem0 -// CHECK:STDOUT: %.loc16_25: ref %ElementType.e6b = temporary_storage -// CHECK:STDOUT: %.loc16_22: %C = bind_value %c.ref -// CHECK:STDOUT: %At.call: init %ElementType.e6b = call %bound_method(%.loc16_22, %.loc16_24) to %.loc16_25 +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- overloaded_builtin.carbon +// CHECK:STDOUT: --- fail_missing_index_with.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] -// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] -// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] -// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] -// CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete] -// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete] -// CHECK:STDOUT: %IndexWith.type.917: type = facet_type <@IndexWith, @IndexWith(%i32, %i32)> [concrete] -// CHECK:STDOUT: %At.type.d77: type = fn_type @At.1, @IndexWith(%i32, %i32) [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness file.%IndexWith.impl_witness_table [concrete] -// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete] -// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] -// CHECK:STDOUT: %At.type.9ac: type = fn_type @At.2 [concrete] -// CHECK:STDOUT: %At.642: %At.type.9ac = struct_value () [concrete] -// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.917 = facet_value %tuple.type.d07, (%IndexWith.impl_witness) [concrete] -// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] -// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete] -// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] -// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] -// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete] -// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] -// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic] -// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic] -// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete] -// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete] -// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete] -// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete] -// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] -// CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] -// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] -// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] -// CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [concrete] -// CHECK:STDOUT: %bound_method.a25: = bound_method %int_5.64b, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] -// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_5.0f6) [concrete] -// CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] -// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] -// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] -// CHECK:STDOUT: %.2dc: type = fn_type_with_self_type %At.type.d77, %IndexWith.facet [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Int = %Core.Int -// CHECK:STDOUT: .IndexWith = %Core.IndexWith -// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic] -// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] -// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] -// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] +// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .s = %s -// CHECK:STDOUT: .e = %e +// CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: impl_decl @impl.18b [concrete] {} { -// CHECK:STDOUT: %int_32.loc4_7: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_7: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc4_15.1: %tuple.type.24b = tuple_literal (%i32.loc4_7, %i32.loc4_12) -// CHECK:STDOUT: %.loc4_15.2: type = converted %.loc4_15.1, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07] -// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.504 = name_ref IndexWith, imports.%Core.IndexWith [concrete = constants.%IndexWith.generic] -// CHECK:STDOUT: %int_32.loc4_35: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_35: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc4_40: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc4_40: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%i32, constants.%i32)> [concrete = constants.%IndexWith.type.917] -// CHECK:STDOUT: } -// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (@impl.18b.%At.decl), @impl.18b [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %s.patt: %pattern_type.511 = binding_pattern s [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc10_17.1: type = splice_block %.loc10_17.3 [concrete = constants.%tuple.type.d07] { -// CHECK:STDOUT: %int_32.loc10_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %int_32.loc10_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc10_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %.loc10_17.2: %tuple.type.24b = tuple_literal (%i32.loc10_9, %i32.loc10_14) -// CHECK:STDOUT: %.loc10_17.3: type = converted %.loc10_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07] -// CHECK:STDOUT: } -// CHECK:STDOUT: %impl.elem0.loc10_26.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc10_26.1: = bound_method @__global_init.%int_1, %impl.elem0.loc10_26.1 [concrete = constants.%Convert.bound.ab5] -// CHECK:STDOUT: %specific_fn.loc10_26.1: = specific_function %impl.elem0.loc10_26.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_26.2: = bound_method @__global_init.%int_1, %specific_fn.loc10_26.1 [concrete = constants.%bound_method.9a1] -// CHECK:STDOUT: %int.convert_checked.loc10_26.1: init %i32 = call %bound_method.loc10_26.2(@__global_init.%int_1) [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked.loc10_26.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %.loc10_26.2: %i32 = converted @__global_init.%int_1, %.loc10_26.1 [concrete = constants.%int_1.5d2] -// CHECK:STDOUT: %impl.elem0.loc10_26.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc10_26.3: = bound_method @__global_init.%int_5, %impl.elem0.loc10_26.2 [concrete = constants.%Convert.bound.4e6] -// CHECK:STDOUT: %specific_fn.loc10_26.2: = specific_function %impl.elem0.loc10_26.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc10_26.4: = bound_method @__global_init.%int_5, %specific_fn.loc10_26.2 [concrete = constants.%bound_method.a25] -// CHECK:STDOUT: %int.convert_checked.loc10_26.2: init %i32 = call %bound_method.loc10_26.4(@__global_init.%int_5) [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc10_26.3: %i32 = value_of_initializer %int.convert_checked.loc10_26.2 [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %.loc10_26.4: %i32 = converted @__global_init.%int_5, %.loc10_26.3 [concrete = constants.%int_5.0f6] -// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc10_26.2, %.loc10_26.4) [concrete = constants.%tuple] -// CHECK:STDOUT: %.loc10_26.5: %tuple.type.d07 = converted @__global_init.%.loc10, %tuple [concrete = constants.%tuple] -// CHECK:STDOUT: %s: %tuple.type.d07 = bind_name s, %.loc10_26.5 -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %e.patt: %pattern_type.7ce = binding_pattern e [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_8: type = splice_block %i32.loc11 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11_17.1: ref %i32 = temporary_storage -// CHECK:STDOUT: %.loc11_17.2: ref %i32 = temporary %.loc11_17.1, @__global_init.%At.call -// CHECK:STDOUT: %e: ref %i32 = bind_name e, %.loc11_17.2 +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl.18b: %.loc4_15.2 as %IndexWith.type { -// CHECK:STDOUT: %At.decl: %At.type.9ac = fn_decl @At.2 [concrete = constants.%At.642] { -// CHECK:STDOUT: %self.patt: %pattern_type.511 = binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: %pattern_type.511 = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %subscript.patt: %pattern_type.7ce = binding_pattern subscript [concrete] -// CHECK:STDOUT: %subscript.param_patt: %pattern_type.7ce = value_param_pattern %subscript.patt, call_param1 [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete] +// CHECK:STDOUT: fn @F() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- core_wrong_arg_count.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic] +// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] +// CHECK:STDOUT: %IndexWith.type.68b: type = generic_interface_type @IndexWith [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] +// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.68b = struct_value () [concrete] +// CHECK:STDOUT: %IndexWith.type.b94: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic] +// CHECK:STDOUT: %Self: %IndexWith.type.b94 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] +// CHECK:STDOUT: %pattern_type.2ad: type = pattern_type %Self.as_type [symbolic] +// CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %SubscriptType [symbolic] +// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] +// CHECK:STDOUT: %At.type: type = fn_type @At, @IndexWith(%SubscriptType) [symbolic] +// CHECK:STDOUT: %At: %At.type = struct_value () [symbolic] +// CHECK:STDOUT: %IndexWith.assoc_type: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType) [symbolic] +// CHECK:STDOUT: %assoc0: %IndexWith.assoc_type = assoc_entity element0, @IndexWith.%At.decl [symbolic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .IndexWith = %IndexWith.decl +// CHECK:STDOUT: } +// CHECK:STDOUT: %IndexWith.decl: %IndexWith.type.68b = interface_decl @IndexWith [concrete = constants.%IndexWith.generic] { +// CHECK:STDOUT: %SubscriptType.patt: %pattern_type.98f = symbolic_binding_pattern SubscriptType, 0 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %int_32.loc5_40: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_40: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] -// CHECK:STDOUT: %self.param: %tuple.type.d07 = value_param call_param0 -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.18b.%.loc4_15.2 [concrete = constants.%tuple.type.d07] -// CHECK:STDOUT: %self: %tuple.type.d07 = bind_name self, %self.param -// CHECK:STDOUT: %subscript.param: %i32 = value_param call_param1 -// CHECK:STDOUT: %.loc5: type = splice_block %i32.loc5_32 [concrete = constants.%i32] { -// CHECK:STDOUT: %int_32.loc5_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] -// CHECK:STDOUT: %i32.loc5_32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %SubscriptType.loc4_21.1: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType.loc4_21.2 (constants.%SubscriptType)] +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: generic interface @IndexWith(%SubscriptType.loc4_21.1: type) { +// CHECK:STDOUT: %SubscriptType.loc4_21.2: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType.loc4_21.2 (constants.%SubscriptType)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.loc4_21.2)> [symbolic = %IndexWith.type (constants.%IndexWith.type.b94)] +// CHECK:STDOUT: %Self.2: @IndexWith.%IndexWith.type (%IndexWith.type.b94) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %At.type: type = fn_type @At, @IndexWith(%SubscriptType.loc4_21.2) [symbolic = %At.type (constants.%At.type)] +// CHECK:STDOUT: %At: @IndexWith.%At.type (%At.type) = struct_value () [symbolic = %At (constants.%At)] +// CHECK:STDOUT: %IndexWith.assoc_type: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType.loc4_21.2) [symbolic = %IndexWith.assoc_type (constants.%IndexWith.assoc_type)] +// CHECK:STDOUT: %assoc0.loc5_52.2: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type) = assoc_entity element0, %At.decl [symbolic = %assoc0.loc5_52.2 (constants.%assoc0)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: %Self.1: @IndexWith.%IndexWith.type (%IndexWith.type.b94) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] +// CHECK:STDOUT: %At.decl: @IndexWith.%At.type (%At.type) = fn_decl @At [symbolic = @IndexWith.%At (constants.%At)] { +// CHECK:STDOUT: %self.patt: @At.%pattern_type.loc5_9 (%pattern_type.2ad) = binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: @At.%pattern_type.loc5_9 (%pattern_type.2ad) = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %subscript.patt: @At.%pattern_type.loc5_21 (%pattern_type.7dc) = binding_pattern subscript [concrete] +// CHECK:STDOUT: %subscript.param_patt: @At.%pattern_type.loc5_21 (%pattern_type.7dc) = value_param_pattern %subscript.patt, call_param1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param2 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %.loc5_51.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc5_51.2: type = converted %.loc5_51.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %self.param: @At.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param0 +// CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.3 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { +// CHECK:STDOUT: %.loc5_15.2: @At.%IndexWith.type (%IndexWith.type.b94) = specific_constant @IndexWith.%Self.1, @IndexWith(constants.%SubscriptType) [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.ref: @At.%IndexWith.type (%IndexWith.type.b94) = name_ref Self, %.loc5_15.2 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %.loc5_15.3: type = converted %Self.ref, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: } +// CHECK:STDOUT: %self: @At.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name self, %self.param +// CHECK:STDOUT: %subscript.param: @At.%SubscriptType (%SubscriptType) = value_param call_param1 +// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, @IndexWith.%SubscriptType.loc4_21.1 [symbolic = %SubscriptType (constants.%SubscriptType)] +// CHECK:STDOUT: %subscript: @At.%SubscriptType (%SubscriptType) = bind_name subscript, %subscript.param +// CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param2 +// CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } -// CHECK:STDOUT: %subscript: %i32 = bind_name subscript, %subscript.param -// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 -// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: %assoc0.loc5_52.1: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type) = assoc_entity element0, %At.decl [symbolic = %assoc0.loc5_52.2 (constants.%assoc0)] +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = %Self.1 +// CHECK:STDOUT: .SubscriptType = +// CHECK:STDOUT: .At = %assoc0.loc5_52.1 +// CHECK:STDOUT: witness = (%At.decl) // CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .At = %At.decl -// CHECK:STDOUT: witness = file.%IndexWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @At.2(%self.param: %tuple.type.d07, %subscript.param: %i32) -> %i32 { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %self.ref: %tuple.type.d07 = name_ref self, %self -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %tuple.elem0: %i32 = tuple_access %self.ref, element0 -// CHECK:STDOUT: return %tuple.elem0 +// CHECK:STDOUT: generic fn @At(@IndexWith.%SubscriptType.loc4_21.1: type, @IndexWith.%Self.1: @IndexWith.%IndexWith.type (%IndexWith.type.b94)) { +// CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)] +// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.b94)] +// CHECK:STDOUT: %Self: @At.%IndexWith.type (%IndexWith.type.b94) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)] +// CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type.loc5_9: type = pattern_type %Self.as_type.loc5_15.1 [symbolic = %pattern_type.loc5_9 (constants.%pattern_type.2ad)] +// CHECK:STDOUT: %pattern_type.loc5_21: type = pattern_type %SubscriptType [symbolic = %pattern_type.loc5_21 (constants.%pattern_type.7dc)] +// CHECK:STDOUT: +// CHECK:STDOUT: fn(%self.param: @At.%Self.as_type.loc5_15.1 (%Self.as_type), %subscript.param: @At.%SubscriptType (%SubscriptType)) -> %empty_tuple.type; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] -// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] -// CHECK:STDOUT: %.loc10: %tuple.type.f94 = tuple_literal (%int_1, %int_5) -// CHECK:STDOUT: %s.ref: %tuple.type.d07 = name_ref s, file.%s -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] -// CHECK:STDOUT: %impl.elem0.loc11_17.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] -// CHECK:STDOUT: %bound_method.loc11_17.1: = bound_method %int_0, %impl.elem0.loc11_17.1 [concrete = constants.%Convert.bound.d04] -// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc11_17.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] -// CHECK:STDOUT: %bound_method.loc11_17.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.b6e] -// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_17.2(%int_0) [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc11_17.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %.loc11_17.2: %i32 = converted %int_0, %.loc11_17.1 [concrete = constants.%int_0.6a9] -// CHECK:STDOUT: %impl.elem0.loc11_17.2: %.2dc = impl_witness_access constants.%IndexWith.impl_witness, element0 [concrete = constants.%At.642] -// CHECK:STDOUT: %bound_method.loc11_17.3: = bound_method %s.ref, %impl.elem0.loc11_17.2 -// CHECK:STDOUT: %At.call: init %i32 = call %bound_method.loc11_17.3(%s.ref, %.loc11_17.2) -// CHECK:STDOUT: return +// CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType) { +// CHECK:STDOUT: %SubscriptType.loc4_21.2 => constants.%SubscriptType // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_invalid_subscript_type.carbon +// CHECK:STDOUT: specific @At(constants.%SubscriptType, constants.%Self) { +// CHECK:STDOUT: %SubscriptType => constants.%SubscriptType +// CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.b94 +// CHECK:STDOUT: %Self => constants.%Self +// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type +// CHECK:STDOUT: %pattern_type.loc5_9 => constants.%pattern_type.2ad +// CHECK:STDOUT: %pattern_type.loc5_21 => constants.%pattern_type.7dc +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- wrong_arg_count.carbon // CHECK:STDOUT: // CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %ElementType.e6b: type = class_type @ElementType [concrete] -// CHECK:STDOUT: %SubscriptType.8ee: type = class_type @SubscriptType [concrete] +// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] // CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete] // CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete] -// CHECK:STDOUT: %IndexWith.type.e80: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.8ee, %ElementType.e6b)> [concrete] -// CHECK:STDOUT: %At.type.b3f: type = fn_type @At.1, @IndexWith(%SubscriptType.8ee, %ElementType.e6b) [concrete] +// CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic] +// CHECK:STDOUT: %IndexWith.type.bd2: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic] +// CHECK:STDOUT: %Self.30a: %IndexWith.type.bd2 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %At.type.cf4: type = fn_type @At.1, @IndexWith(%SubscriptType) [symbolic] +// CHECK:STDOUT: %At.281: %At.type.cf4 = struct_value () [symbolic] +// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.30a [symbolic] +// CHECK:STDOUT: %pattern_type.e1a: type = pattern_type %Self.as_type [symbolic] +// CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %SubscriptType [symbolic] +// CHECK:STDOUT: %IndexWith.assoc_type.290: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType) [symbolic] +// CHECK:STDOUT: %assoc0.af8: %IndexWith.assoc_type.290 = assoc_entity element0, imports.%Core.import_ref.e99 [symbolic] +// CHECK:STDOUT: %IndexWith.type.a51: type = facet_type <@IndexWith, @IndexWith(%empty_tuple.type)> [concrete] +// CHECK:STDOUT: %Self.8f0: %IndexWith.type.a51 = bind_symbolic_name Self, 1 [symbolic] +// CHECK:STDOUT: %At.type.969: type = fn_type @At.1, @IndexWith(%empty_tuple.type) [concrete] +// CHECK:STDOUT: %At.9b9: %At.type.969 = struct_value () [concrete] +// CHECK:STDOUT: %IndexWith.assoc_type.3d4: type = assoc_entity_type @IndexWith, @IndexWith(%empty_tuple.type) [concrete] +// CHECK:STDOUT: %assoc0.21b: %IndexWith.assoc_type.3d4 = assoc_entity element0, imports.%Core.import_ref.e99 [concrete] // CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness file.%IndexWith.impl_witness_table [concrete] -// CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] -// CHECK:STDOUT: %pattern_type.df7: type = pattern_type %SubscriptType.8ee [concrete] -// CHECK:STDOUT: %pattern_type.c39: type = pattern_type %ElementType.e6b [concrete] -// CHECK:STDOUT: %At.type.178: type = fn_type @At.2 [concrete] -// CHECK:STDOUT: %At.d43: %At.type.178 = struct_value () [concrete] -// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.e80 = facet_value %C, (%IndexWith.impl_witness) [concrete] -// CHECK:STDOUT: %ElementType.val: %ElementType.e6b = struct_value () [concrete] -// CHECK:STDOUT: %C.val: %C = struct_value () [concrete] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] -// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] -// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] -// CHECK:STDOUT: %.d94: type = fn_type_with_self_type %At.type.b3f, %IndexWith.facet [concrete] +// CHECK:STDOUT: %At.type.486: type = fn_type @At.2 [concrete] +// CHECK:STDOUT: %At.7c4: %At.type.486 = struct_value () [concrete] +// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.a51 = facet_value %empty_tuple.type, (%IndexWith.impl_witness) [concrete] +// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] +// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] +// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] +// CHECK:STDOUT: %assoc0.e1e: %IndexWith.assoc_type.290 = assoc_entity element0, imports.%Core.import_ref.981 [symbolic] +// CHECK:STDOUT: %.ffc: type = fn_type_with_self_type %At.type.969, %IndexWith.facet [concrete] +// CHECK:STDOUT: %At.bound: = bound_method %empty_tuple, %At.7c4 [concrete] // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: imports { // CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { // CHECK:STDOUT: .IndexWith = %Core.IndexWith -// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: import Core//core_wrong_arg_count // CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic] -// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//core_wrong_arg_count, IndexWith, loaded [concrete = constants.%IndexWith.generic] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//core_wrong_arg_count, loc4_21, loaded [symbolic = @IndexWith.%SubscriptType (constants.%SubscriptType)] +// CHECK:STDOUT: %Core.import_ref.68a = import_ref Core//core_wrong_arg_count, inst25 [no loc], unloaded +// CHECK:STDOUT: %Core.import_ref.613: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type.290) = import_ref Core//core_wrong_arg_count, loc5_52, loaded [symbolic = @IndexWith.%assoc0 (constants.%assoc0.e1e)] +// CHECK:STDOUT: %Core.At: @IndexWith.%At.type (%At.type.cf4) = import_ref Core//core_wrong_arg_count, At, loaded [symbolic = @IndexWith.%At (constants.%At.281)] +// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//core_wrong_arg_count, loc4_21, loaded [symbolic = @IndexWith.%SubscriptType (constants.%SubscriptType)] +// CHECK:STDOUT: %Core.import_ref.fb5: @IndexWith.%IndexWith.type (%IndexWith.type.bd2) = import_ref Core//core_wrong_arg_count, inst25 [no loc], loaded [symbolic = @IndexWith.%Self (constants.%Self.30a)] +// CHECK:STDOUT: %Core.import_ref.e99: @IndexWith.%At.type (%At.type.cf4) = import_ref Core//core_wrong_arg_count, loc5_52, loaded [symbolic = @IndexWith.%At (constants.%At.281)] +// CHECK:STDOUT: %Core.import_ref.981 = import_ref Core//core_wrong_arg_count, loc5_52, unloaded // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: file { // CHECK:STDOUT: package: = namespace [concrete] { // CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .ElementType = %ElementType.decl -// CHECK:STDOUT: .SubscriptType = %SubscriptType.decl -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: .F = %F.decl // CHECK:STDOUT: } // CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} -// CHECK:STDOUT: %ElementType.decl: type = class_decl @ElementType [concrete = constants.%ElementType.e6b] {} {} -// CHECK:STDOUT: %SubscriptType.decl: type = class_decl @SubscriptType [concrete = constants.%SubscriptType.8ee] {} {} // CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc6_7.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] // CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] // CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.504 = name_ref IndexWith, imports.%Core.IndexWith [concrete = constants.%IndexWith.generic] -// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [concrete = constants.%SubscriptType.8ee] -// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [concrete = constants.%ElementType.e6b] -// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%SubscriptType.8ee, constants.%ElementType.e6b)> [concrete = constants.%IndexWith.type.e80] +// CHECK:STDOUT: %.loc6_28: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc6_29: type = converted %.loc6_28, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%empty_tuple.type)> [concrete = constants.%IndexWith.type.a51] // CHECK:STDOUT: } // CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (@impl.%At.decl), @impl [concrete] // CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc14_13.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc14_13.2: init %C = class_init (), %.loc14_13.1 [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc14_13.3: ref %C = temporary %.loc14_13.1, %.loc14_13.2 -// CHECK:STDOUT: %.loc14_13.4: ref %C = converted @__global_init.%.loc14, %.loc14_13.3 -// CHECK:STDOUT: %c: ref %C = bind_name c, %.loc14_13.4 -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %x.patt: %pattern_type.c39 = binding_pattern x [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, %ElementType.decl [concrete = constants.%ElementType.e6b] -// CHECK:STDOUT: %.loc22: ref %ElementType.e6b = temporary @__global_init.%.loc22_25.2, @__global_init.%At.call -// CHECK:STDOUT: %x: ref %ElementType.e6b = bind_name x, %.loc22 +// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %C.ref as %IndexWith.type { -// CHECK:STDOUT: %At.decl: %At.type.178 = fn_decl @At.2 [concrete = constants.%At.d43] { -// CHECK:STDOUT: %self.patt: %pattern_type.c48 = binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: %pattern_type.c48 = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %subscript.patt: %pattern_type.df7 = binding_pattern subscript [concrete] -// CHECK:STDOUT: %subscript.param_patt: %pattern_type.df7 = value_param_pattern %subscript.patt, call_param1 [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.c39 = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.c39 = out_param_pattern %return.patt, call_param2 [concrete] +// CHECK:STDOUT: generic interface @IndexWith(imports.%Core.import_ref.5ab3ec.1: type) [from "core_wrong_arg_count.carbon"] { +// CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)] +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.bd2)] +// CHECK:STDOUT: %Self: @IndexWith.%IndexWith.type (%IndexWith.type.bd2) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.30a)] +// CHECK:STDOUT: %At.type: type = fn_type @At.1, @IndexWith(%SubscriptType) [symbolic = %At.type (constants.%At.type.cf4)] +// CHECK:STDOUT: %At: @IndexWith.%At.type (%At.type.cf4) = struct_value () [symbolic = %At (constants.%At.281)] +// CHECK:STDOUT: %IndexWith.assoc_type: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType) [symbolic = %IndexWith.assoc_type (constants.%IndexWith.assoc_type.290)] +// CHECK:STDOUT: %assoc0: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type.290) = assoc_entity element0, imports.%Core.import_ref.e99 [symbolic = %assoc0 (constants.%assoc0.af8)] +// CHECK:STDOUT: +// CHECK:STDOUT: interface { +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = imports.%Core.import_ref.68a +// CHECK:STDOUT: .At = imports.%Core.import_ref.613 +// CHECK:STDOUT: witness = (imports.%Core.At) +// CHECK:STDOUT: } +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl: %.loc6_7.2 as %IndexWith.type { +// CHECK:STDOUT: %At.decl: %At.type.486 = fn_decl @At.2 [concrete = constants.%At.7c4] { +// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %subscript.patt: %pattern_type.cb1 = binding_pattern subscript [concrete] +// CHECK:STDOUT: %subscript.param_patt: %pattern_type.cb1 = value_param_pattern %subscript.patt, call_param1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param2 [concrete] // CHECK:STDOUT: } { -// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [concrete = constants.%ElementType.e6b] -// CHECK:STDOUT: %self.param: %C = value_param call_param0 -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%C.ref [concrete = constants.%C] -// CHECK:STDOUT: %self: %C = bind_name self, %self.param -// CHECK:STDOUT: %subscript.param: %SubscriptType.8ee = value_param call_param1 -// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [concrete = constants.%SubscriptType.8ee] -// CHECK:STDOUT: %subscript: %SubscriptType.8ee = bind_name subscript, %subscript.param -// CHECK:STDOUT: %return.param: ref %ElementType.e6b = out_param call_param2 -// CHECK:STDOUT: %return: ref %ElementType.e6b = return_slot %return.param +// CHECK:STDOUT: %.loc7_40.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc7_40.2: type = converted %.loc7_40.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc6_7.2 [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param +// CHECK:STDOUT: %subscript.param: %empty_tuple.type = value_param call_param1 +// CHECK:STDOUT: %.loc7_33.1: type = splice_block %.loc7_33.3 [concrete = constants.%empty_tuple.type] { +// CHECK:STDOUT: %.loc7_33.2: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc7_33.3: type = converted %.loc7_33.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] +// CHECK:STDOUT: } +// CHECK:STDOUT: %subscript: %empty_tuple.type = bind_name subscript, %subscript.param +// CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param2 +// CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param // CHECK:STDOUT: } // CHECK:STDOUT: // CHECK:STDOUT: !members: -// CHECK:STDOUT: .SubscriptType = -// CHECK:STDOUT: .ElementType = // CHECK:STDOUT: .At = %At.decl // CHECK:STDOUT: witness = file.%IndexWith.impl_witness // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @C { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: generic fn @At.1(imports.%Core.import_ref.5ab3ec.2: type, imports.%Core.import_ref.fb5: @IndexWith.%IndexWith.type (%IndexWith.type.bd2)) [from "core_wrong_arg_count.carbon"] { +// CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)] +// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.bd2)] +// CHECK:STDOUT: %Self: @At.1.%IndexWith.type (%IndexWith.type.bd2) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.30a)] +// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)] +// CHECK:STDOUT: %pattern_type.1: type = pattern_type %Self.as_type [symbolic = %pattern_type.1 (constants.%pattern_type.e1a)] +// CHECK:STDOUT: %pattern_type.2: type = pattern_type %SubscriptType [symbolic = %pattern_type.2 (constants.%pattern_type.7dc)] // CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: fn; // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @ElementType { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%ElementType.e6b -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @SubscriptType { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%SubscriptType.8ee -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @At.2(%self.param: %C, %subscript.param: %SubscriptType.8ee) -> %return.param: %ElementType.e6b { +// CHECK:STDOUT: fn @At.2(%self.param: %empty_tuple.type, %subscript.param: %empty_tuple.type) -> %empty_tuple.type { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc10_13.1: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %.loc10_13.2: init %ElementType.e6b = class_init (), %return [concrete = constants.%ElementType.val] -// CHECK:STDOUT: %.loc10_14: init %ElementType.e6b = converted %.loc10_13.1, %.loc10_13.2 [concrete = constants.%ElementType.val] -// CHECK:STDOUT: return %.loc10_14 to %return +// CHECK:STDOUT: %.loc8_13: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc8_14: %empty_tuple.type = converted %.loc8_13, %empty_tuple [concrete = constants.%empty_tuple] +// CHECK:STDOUT: return %.loc8_14 // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: fn @F() { // CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc14: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %c.ref: ref %C = name_ref c, file.%c -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %.loc22_25.1: %SubscriptType.8ee = converted %int_0, [concrete = ] -// CHECK:STDOUT: %impl.elem0: %.d94 = impl_witness_access constants.%IndexWith.impl_witness, element0 [concrete = constants.%At.d43] -// CHECK:STDOUT: %bound_method: = bound_method %c.ref, %impl.elem0 -// CHECK:STDOUT: %.loc22_25.2: ref %ElementType.e6b = temporary_storage -// CHECK:STDOUT: %.loc22_22: %C = bind_value %c.ref -// CHECK:STDOUT: %At.call: init %ElementType.e6b = call %bound_method(%.loc22_22, ) to %.loc22_25.2 +// CHECK:STDOUT: %.loc12_11.1: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %.loc12_14: %empty_tuple.type = tuple_literal () +// CHECK:STDOUT: %empty_tuple.loc12_11: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_11.2: %empty_tuple.type = converted %.loc12_11.1, %empty_tuple.loc12_11 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %empty_tuple.loc12_14: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %.loc12_15: %empty_tuple.type = converted %.loc12_14, %empty_tuple.loc12_14 [concrete = constants.%empty_tuple] +// CHECK:STDOUT: %impl.elem0: %.ffc = impl_witness_access constants.%IndexWith.impl_witness, element0 [concrete = constants.%At.7c4] +// CHECK:STDOUT: %bound_method: = bound_method %.loc12_11.2, %impl.elem0 [concrete = constants.%At.bound] +// CHECK:STDOUT: %At.call: init %empty_tuple.type = call %bound_method(%.loc12_11.2, %.loc12_15) // CHECK:STDOUT: return // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: --- fail_index_with_not_implemented.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %C: type = class_type @C [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] -// CHECK:STDOUT: %C.val: %C = struct_value () [concrete] -// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] -// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] -// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] -// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] -// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] -// CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete] -// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete] +// CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType) { +// CHECK:STDOUT: %SubscriptType => constants.%SubscriptType // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .Int = %Core.Int -// CHECK:STDOUT: .IndexWith = %Core.IndexWith -// CHECK:STDOUT: import Core//prelude -// CHECK:STDOUT: import Core//prelude/... -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] -// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic] +// CHECK:STDOUT: specific @At.1(constants.%SubscriptType, constants.%Self.30a) { +// CHECK:STDOUT: %SubscriptType => constants.%SubscriptType +// CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.bd2 +// CHECK:STDOUT: %Self => constants.%Self.30a +// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type +// CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.e1a +// CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.7dc // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .C = %C.decl -// CHECK:STDOUT: .c = %c -// CHECK:STDOUT: .x = %x -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] -// CHECK:STDOUT: %.loc6_13.1: ref %C = temporary_storage -// CHECK:STDOUT: %.loc6_13.2: init %C = class_init (), %.loc6_13.1 [concrete = constants.%C.val] -// CHECK:STDOUT: %.loc6_13.3: ref %C = temporary %.loc6_13.1, %.loc6_13.2 -// CHECK:STDOUT: %.loc6_13.4: ref %C = converted @__global_init.%.loc6, %.loc6_13.3 -// CHECK:STDOUT: %c: ref %C = bind_name c, %.loc6_13.4 -// CHECK:STDOUT: name_binding_decl { -// CHECK:STDOUT: %x.patt: %pattern_type.7ce = binding_pattern x [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: %.loc11: type = splice_block %i32 [concrete = constants.%i32] { -// 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: } -// CHECK:STDOUT: %x: %i32 = bind_name x, [concrete = ] +// CHECK:STDOUT: specific @IndexWith(constants.%empty_tuple.type) { +// CHECK:STDOUT: %SubscriptType => constants.%empty_tuple.type +// CHECK:STDOUT: +// CHECK:STDOUT: !definition: +// CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.a51 +// CHECK:STDOUT: %Self => constants.%Self.8f0 +// CHECK:STDOUT: %At.type => constants.%At.type.969 +// CHECK:STDOUT: %At => constants.%At.9b9 +// CHECK:STDOUT: %IndexWith.assoc_type => constants.%IndexWith.assoc_type.3d4 +// CHECK:STDOUT: %assoc0 => constants.%assoc0.21b // CHECK:STDOUT: } // CHECK:STDOUT: -// CHECK:STDOUT: class @C { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%C -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @__global_init() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc6: %empty_struct_type = struct_literal () -// CHECK:STDOUT: %c.ref: ref %C = name_ref c, file.%c -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: return +// CHECK:STDOUT: specific @At.1(constants.%empty_tuple.type, constants.%IndexWith.facet) { +// CHECK:STDOUT: %SubscriptType => constants.%empty_tuple.type +// CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.a51 +// CHECK:STDOUT: %Self => constants.%IndexWith.facet +// CHECK:STDOUT: %Self.as_type => constants.%empty_tuple.type +// CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.cb1 +// CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.cb1 // CHECK:STDOUT: } // CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon new file mode 100644 index 000000000000..b66361aaf644 --- /dev/null +++ b/toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon @@ -0,0 +1,656 @@ +// Part of the Carbon Language project, under the Apache License v2.0 with LLVM +// Exceptions. See /LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". +// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// +// AUTOUPDATE +// TIP: To test this file alone, run: +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon +// TIP: To dump output, run: +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/overloaded/index_with_prelude.carbon + +// --- overloaded_index.carbon + +library "[[@TEST_NAME]]"; + +class C {} +class ElementType {} +class SubscriptType {} + +impl C as Core.IndexWith(SubscriptType, ElementType) { + fn At[self: Self](subscript: SubscriptType) -> ElementType { + return {}; + } +} + +let s: SubscriptType = {}; +let c: C = {}; +let x: ElementType = c[s]; + +// --- overloaded_builtin.carbon + +library "[[@TEST_NAME]]"; + +impl (i32, i32) as Core.IndexWith(i32, i32) { + fn At[self: Self](subscript: i32) -> i32 { + return self.0; + } +} + +let s: (i32, i32) = (1, 5); +let e: i32 = s[0]; + +// --- fail_invalid_subscript_type.carbon + +library "[[@TEST_NAME]]"; + +class C { } +class ElementType {} +class SubscriptType {} + +impl C as Core.IndexWith(SubscriptType, ElementType) { + fn At[self: Self](subscript: SubscriptType) -> ElementType { + return {}; + } +} + +let c: C = {}; +// CHECK:STDERR: fail_invalid_subscript_type.carbon:[[@LINE+7]]:22: error: cannot implicitly convert expression of type `Core.IntLiteral` to `SubscriptType` [ConversionFailure] +// CHECK:STDERR: let x: ElementType = c[0]; +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: fail_invalid_subscript_type.carbon:[[@LINE+4]]:22: note: type `Core.IntLiteral` does not implement interface `Core.ImplicitAs(SubscriptType)` [MissingImplInMemberAccessNote] +// CHECK:STDERR: let x: ElementType = c[0]; +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +let x: ElementType = c[0]; + +// --- fail_index_with_not_implemented.carbon + +library "[[@TEST_NAME]]"; + +class C { } + +let c: C = {}; +// CHECK:STDERR: fail_index_with_not_implemented.carbon:[[@LINE+4]]:14: error: type `C` does not support indexing [TypeNotIndexable] +// CHECK:STDERR: let x: i32 = c[0]; +// CHECK:STDERR: ^~~~ +// CHECK:STDERR: +let x: i32 = c[0]; + + +// CHECK:STDOUT: --- overloaded_index.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %ElementType.e6b: type = class_type @ElementType [concrete] +// CHECK:STDOUT: %SubscriptType.8ee: type = class_type @SubscriptType [concrete] +// CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete] +// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete] +// CHECK:STDOUT: %IndexWith.type.e80: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.8ee, %ElementType.e6b)> [concrete] +// CHECK:STDOUT: %At.type.b3f: type = fn_type @At.1, @IndexWith(%SubscriptType.8ee, %ElementType.e6b) [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness file.%IndexWith.impl_witness_table [concrete] +// CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] +// CHECK:STDOUT: %pattern_type.df7: type = pattern_type %SubscriptType.8ee [concrete] +// CHECK:STDOUT: %pattern_type.c39: type = pattern_type %ElementType.e6b [concrete] +// CHECK:STDOUT: %At.type.178: type = fn_type @At.2 [concrete] +// CHECK:STDOUT: %At.d43: %At.type.178 = struct_value () [concrete] +// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.e80 = facet_value %C, (%IndexWith.impl_witness) [concrete] +// CHECK:STDOUT: %ElementType.val: %ElementType.e6b = struct_value () [concrete] +// CHECK:STDOUT: %SubscriptType.val: %SubscriptType.8ee = struct_value () [concrete] +// CHECK:STDOUT: %C.val: %C = struct_value () [concrete] +// CHECK:STDOUT: %.d94: type = fn_type_with_self_type %At.type.b3f, %IndexWith.facet [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .IndexWith = %Core.IndexWith +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .ElementType = %ElementType.decl +// CHECK:STDOUT: .SubscriptType = %SubscriptType.decl +// CHECK:STDOUT: .s = %s +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} +// CHECK:STDOUT: %ElementType.decl: type = class_decl @ElementType [concrete = constants.%ElementType.e6b] {} {} +// CHECK:STDOUT: %SubscriptType.decl: type = class_decl @SubscriptType [concrete = constants.%SubscriptType.8ee] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.504 = name_ref IndexWith, imports.%Core.IndexWith [concrete = constants.%IndexWith.generic] +// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [concrete = constants.%SubscriptType.8ee] +// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [concrete = constants.%ElementType.e6b] +// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%SubscriptType.8ee, constants.%ElementType.e6b)> [concrete = constants.%IndexWith.type.e80] +// CHECK:STDOUT: } +// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (@impl.%At.decl), @impl [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %s.patt: %pattern_type.df7 = binding_pattern s [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, %SubscriptType.decl [concrete = constants.%SubscriptType.8ee] +// CHECK:STDOUT: %.loc14_25.1: ref %SubscriptType.8ee = temporary_storage +// CHECK:STDOUT: %.loc14_25.2: init %SubscriptType.8ee = class_init (), %.loc14_25.1 [concrete = constants.%SubscriptType.val] +// CHECK:STDOUT: %.loc14_25.3: ref %SubscriptType.8ee = temporary %.loc14_25.1, %.loc14_25.2 +// CHECK:STDOUT: %.loc14_25.4: ref %SubscriptType.8ee = converted @__global_init.%.loc14, %.loc14_25.3 +// CHECK:STDOUT: %s: ref %SubscriptType.8ee = bind_name s, %.loc14_25.4 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc15_13.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc15_13.2: init %C = class_init (), %.loc15_13.1 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc15_13.3: ref %C = temporary %.loc15_13.1, %.loc15_13.2 +// CHECK:STDOUT: %.loc15_13.4: ref %C = converted @__global_init.%.loc15, %.loc15_13.3 +// CHECK:STDOUT: %c: ref %C = bind_name c, %.loc15_13.4 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %x.patt: %pattern_type.c39 = binding_pattern x [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, %ElementType.decl [concrete = constants.%ElementType.e6b] +// CHECK:STDOUT: %.loc16: ref %ElementType.e6b = temporary @__global_init.%.loc16_25, @__global_init.%At.call +// CHECK:STDOUT: %x: ref %ElementType.e6b = bind_name x, %.loc16 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl: %C.ref as %IndexWith.type { +// CHECK:STDOUT: %At.decl: %At.type.178 = fn_decl @At.2 [concrete = constants.%At.d43] { +// CHECK:STDOUT: %self.patt: %pattern_type.c48 = binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: %pattern_type.c48 = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %subscript.patt: %pattern_type.df7 = binding_pattern subscript [concrete] +// CHECK:STDOUT: %subscript.param_patt: %pattern_type.df7 = value_param_pattern %subscript.patt, call_param1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.c39 = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.c39 = out_param_pattern %return.patt, call_param2 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [concrete = constants.%ElementType.e6b] +// CHECK:STDOUT: %self.param: %C = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%C.ref [concrete = constants.%C] +// CHECK:STDOUT: %self: %C = bind_name self, %self.param +// CHECK:STDOUT: %subscript.param: %SubscriptType.8ee = value_param call_param1 +// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [concrete = constants.%SubscriptType.8ee] +// CHECK:STDOUT: %subscript: %SubscriptType.8ee = bind_name subscript, %subscript.param +// CHECK:STDOUT: %return.param: ref %ElementType.e6b = out_param call_param2 +// CHECK:STDOUT: %return: ref %ElementType.e6b = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .SubscriptType = +// CHECK:STDOUT: .ElementType = +// CHECK:STDOUT: .At = %At.decl +// CHECK:STDOUT: witness = file.%IndexWith.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @ElementType { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%ElementType.e6b +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @SubscriptType { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%SubscriptType.8ee +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @At.2(%self.param: %C, %subscript.param: %SubscriptType.8ee) -> %return.param: %ElementType.e6b { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc10_13.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc10_13.2: init %ElementType.e6b = class_init (), %return [concrete = constants.%ElementType.val] +// CHECK:STDOUT: %.loc10_14: init %ElementType.e6b = converted %.loc10_13.1, %.loc10_13.2 [concrete = constants.%ElementType.val] +// CHECK:STDOUT: return %.loc10_14 to %return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc14: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc15: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %c.ref: ref %C = name_ref c, file.%c +// CHECK:STDOUT: %s.ref: ref %SubscriptType.8ee = name_ref s, file.%s +// CHECK:STDOUT: %.loc16_24: %SubscriptType.8ee = bind_value %s.ref +// CHECK:STDOUT: %impl.elem0: %.d94 = impl_witness_access constants.%IndexWith.impl_witness, element0 [concrete = constants.%At.d43] +// CHECK:STDOUT: %bound_method: = bound_method %c.ref, %impl.elem0 +// CHECK:STDOUT: %.loc16_25: ref %ElementType.e6b = temporary_storage +// CHECK:STDOUT: %.loc16_22: %C = bind_value %c.ref +// CHECK:STDOUT: %At.call: init %ElementType.e6b = call %bound_method(%.loc16_22, %.loc16_24) to %.loc16_25 +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- overloaded_builtin.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] +// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %tuple.type.24b: type = tuple_type (type, type) [concrete] +// CHECK:STDOUT: %tuple.type.d07: type = tuple_type (%i32, %i32) [concrete] +// CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete] +// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete] +// CHECK:STDOUT: %IndexWith.type.917: type = facet_type <@IndexWith, @IndexWith(%i32, %i32)> [concrete] +// CHECK:STDOUT: %At.type.d77: type = fn_type @At.1, @IndexWith(%i32, %i32) [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness file.%IndexWith.impl_witness_table [concrete] +// CHECK:STDOUT: %pattern_type.511: type = pattern_type %tuple.type.d07 [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %At.type.9ac: type = fn_type @At.2 [concrete] +// CHECK:STDOUT: %At.642: %At.type.9ac = struct_value () [concrete] +// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.917 = facet_value %tuple.type.d07, (%IndexWith.impl_witness) [concrete] +// CHECK:STDOUT: %int_0.5c6: Core.IntLiteral = int_value 0 [concrete] +// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete] +// CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete] +// CHECK:STDOUT: %tuple.type.f94: type = tuple_type (Core.IntLiteral, Core.IntLiteral) [concrete] +// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] +// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.type.205: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete] +// CHECK:STDOUT: %Convert.type.1b6: type = fn_type @Convert.1, @ImplicitAs(%i32) [concrete] +// CHECK:STDOUT: %To.c80: Core.IntLiteral = bind_symbolic_name To, 0 [symbolic] +// CHECK:STDOUT: %Convert.type.0f9: type = fn_type @Convert.2, @impl.4f9(%To.c80) [symbolic] +// CHECK:STDOUT: %Convert.f06: %Convert.type.0f9 = struct_value () [symbolic] +// CHECK:STDOUT: %ImplicitAs.impl_witness.c75: = impl_witness imports.%ImplicitAs.impl_witness_table.a2f, @impl.4f9(%int_32) [concrete] +// CHECK:STDOUT: %Convert.type.035: type = fn_type @Convert.2, @impl.4f9(%int_32) [concrete] +// CHECK:STDOUT: %Convert.956: %Convert.type.035 = struct_value () [concrete] +// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.205 = facet_value Core.IntLiteral, (%ImplicitAs.impl_witness.c75) [concrete] +// CHECK:STDOUT: %.9c3: type = fn_type_with_self_type %Convert.type.1b6, %ImplicitAs.facet [concrete] +// CHECK:STDOUT: %Convert.bound.ab5: = bound_method %int_1.5b8, %Convert.956 [concrete] +// CHECK:STDOUT: %Convert.specific_fn: = specific_function %Convert.956, @Convert.2(%int_32) [concrete] +// CHECK:STDOUT: %bound_method.9a1: = bound_method %int_1.5b8, %Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_1.5d2: %i32 = int_value 1 [concrete] +// CHECK:STDOUT: %Convert.bound.4e6: = bound_method %int_5.64b, %Convert.956 [concrete] +// CHECK:STDOUT: %bound_method.a25: = bound_method %int_5.64b, %Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_5.0f6: %i32 = int_value 5 [concrete] +// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%int_1.5d2, %int_5.0f6) [concrete] +// CHECK:STDOUT: %Convert.bound.d04: = bound_method %int_0.5c6, %Convert.956 [concrete] +// CHECK:STDOUT: %bound_method.b6e: = bound_method %int_0.5c6, %Convert.specific_fn [concrete] +// CHECK:STDOUT: %int_0.6a9: %i32 = int_value 0 [concrete] +// CHECK:STDOUT: %.2dc: type = fn_type_with_self_type %At.type.d77, %IndexWith.facet [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .IndexWith = %Core.IndexWith +// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic] +// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] +// CHECK:STDOUT: %Core.import_ref.a5b: @impl.4f9.%Convert.type (%Convert.type.0f9) = import_ref Core//prelude/types/int, loc19_39, loaded [symbolic = @impl.4f9.%Convert (constants.%Convert.f06)] +// CHECK:STDOUT: %ImplicitAs.impl_witness_table.a2f = impl_witness_table (%Core.import_ref.a5b), @impl.4f9 [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .s = %s +// CHECK:STDOUT: .e = %e +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: impl_decl @impl.18b [concrete] {} { +// CHECK:STDOUT: %int_32.loc4_7: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_7: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc4_12: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_12: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc4_15.1: %tuple.type.24b = tuple_literal (%i32.loc4_7, %i32.loc4_12) +// CHECK:STDOUT: %.loc4_15.2: type = converted %.loc4_15.1, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.504 = name_ref IndexWith, imports.%Core.IndexWith [concrete = constants.%IndexWith.generic] +// CHECK:STDOUT: %int_32.loc4_35: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_35: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc4_40: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc4_40: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%i32, constants.%i32)> [concrete = constants.%IndexWith.type.917] +// CHECK:STDOUT: } +// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (@impl.18b.%At.decl), @impl.18b [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %s.patt: %pattern_type.511 = binding_pattern s [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc10_17.1: type = splice_block %.loc10_17.3 [concrete = constants.%tuple.type.d07] { +// CHECK:STDOUT: %int_32.loc10_9: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc10_9: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %int_32.loc10_14: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc10_14: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %.loc10_17.2: %tuple.type.24b = tuple_literal (%i32.loc10_9, %i32.loc10_14) +// CHECK:STDOUT: %.loc10_17.3: type = converted %.loc10_17.2, constants.%tuple.type.d07 [concrete = constants.%tuple.type.d07] +// CHECK:STDOUT: } +// CHECK:STDOUT: %impl.elem0.loc10_26.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc10_26.1: = bound_method @__global_init.%int_1, %impl.elem0.loc10_26.1 [concrete = constants.%Convert.bound.ab5] +// CHECK:STDOUT: %specific_fn.loc10_26.1: = specific_function %impl.elem0.loc10_26.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_26.2: = bound_method @__global_init.%int_1, %specific_fn.loc10_26.1 [concrete = constants.%bound_method.9a1] +// CHECK:STDOUT: %int.convert_checked.loc10_26.1: init %i32 = call %bound_method.loc10_26.2(@__global_init.%int_1) [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc10_26.1: %i32 = value_of_initializer %int.convert_checked.loc10_26.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %.loc10_26.2: %i32 = converted @__global_init.%int_1, %.loc10_26.1 [concrete = constants.%int_1.5d2] +// CHECK:STDOUT: %impl.elem0.loc10_26.2: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc10_26.3: = bound_method @__global_init.%int_5, %impl.elem0.loc10_26.2 [concrete = constants.%Convert.bound.4e6] +// CHECK:STDOUT: %specific_fn.loc10_26.2: = specific_function %impl.elem0.loc10_26.2, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc10_26.4: = bound_method @__global_init.%int_5, %specific_fn.loc10_26.2 [concrete = constants.%bound_method.a25] +// CHECK:STDOUT: %int.convert_checked.loc10_26.2: init %i32 = call %bound_method.loc10_26.4(@__global_init.%int_5) [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc10_26.3: %i32 = value_of_initializer %int.convert_checked.loc10_26.2 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %.loc10_26.4: %i32 = converted @__global_init.%int_5, %.loc10_26.3 [concrete = constants.%int_5.0f6] +// CHECK:STDOUT: %tuple: %tuple.type.d07 = tuple_value (%.loc10_26.2, %.loc10_26.4) [concrete = constants.%tuple] +// CHECK:STDOUT: %.loc10_26.5: %tuple.type.d07 = converted @__global_init.%.loc10, %tuple [concrete = constants.%tuple] +// CHECK:STDOUT: %s: %tuple.type.d07 = bind_name s, %.loc10_26.5 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %e.patt: %pattern_type.7ce = binding_pattern e [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc11_8: type = splice_block %i32.loc11 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc11: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc11: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc11_17.1: ref %i32 = temporary_storage +// CHECK:STDOUT: %.loc11_17.2: ref %i32 = temporary %.loc11_17.1, @__global_init.%At.call +// CHECK:STDOUT: %e: ref %i32 = bind_name e, %.loc11_17.2 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl.18b: %.loc4_15.2 as %IndexWith.type { +// CHECK:STDOUT: %At.decl: %At.type.9ac = fn_decl @At.2 [concrete = constants.%At.642] { +// CHECK:STDOUT: %self.patt: %pattern_type.511 = binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: %pattern_type.511 = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %subscript.patt: %pattern_type.7ce = binding_pattern subscript [concrete] +// CHECK:STDOUT: %subscript.param_patt: %pattern_type.7ce = value_param_pattern %subscript.patt, call_param1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.7ce = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.7ce = out_param_pattern %return.patt, call_param2 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %int_32.loc5_40: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_40: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: %self.param: %tuple.type.d07 = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.18b.%.loc4_15.2 [concrete = constants.%tuple.type.d07] +// CHECK:STDOUT: %self: %tuple.type.d07 = bind_name self, %self.param +// CHECK:STDOUT: %subscript.param: %i32 = value_param call_param1 +// CHECK:STDOUT: %.loc5: type = splice_block %i32.loc5_32 [concrete = constants.%i32] { +// CHECK:STDOUT: %int_32.loc5_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32] +// CHECK:STDOUT: %i32.loc5_32: type = class_type @Int, @Int(constants.%int_32) [concrete = constants.%i32] +// CHECK:STDOUT: } +// CHECK:STDOUT: %subscript: %i32 = bind_name subscript, %subscript.param +// CHECK:STDOUT: %return.param: ref %i32 = out_param call_param2 +// CHECK:STDOUT: %return: ref %i32 = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .At = %At.decl +// CHECK:STDOUT: witness = file.%IndexWith.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @At.2(%self.param: %tuple.type.d07, %subscript.param: %i32) -> %i32 { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %self.ref: %tuple.type.d07 = name_ref self, %self +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] +// CHECK:STDOUT: %tuple.elem0: %i32 = tuple_access %self.ref, element0 +// CHECK:STDOUT: return %tuple.elem0 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8] +// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b] +// CHECK:STDOUT: %.loc10: %tuple.type.f94 = tuple_literal (%int_1, %int_5) +// CHECK:STDOUT: %s.ref: %tuple.type.d07 = name_ref s, file.%s +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6] +// CHECK:STDOUT: %impl.elem0.loc11_17.1: %.9c3 = impl_witness_access constants.%ImplicitAs.impl_witness.c75, element0 [concrete = constants.%Convert.956] +// CHECK:STDOUT: %bound_method.loc11_17.1: = bound_method %int_0, %impl.elem0.loc11_17.1 [concrete = constants.%Convert.bound.d04] +// CHECK:STDOUT: %specific_fn: = specific_function %impl.elem0.loc11_17.1, @Convert.2(constants.%int_32) [concrete = constants.%Convert.specific_fn] +// CHECK:STDOUT: %bound_method.loc11_17.2: = bound_method %int_0, %specific_fn [concrete = constants.%bound_method.b6e] +// CHECK:STDOUT: %int.convert_checked: init %i32 = call %bound_method.loc11_17.2(%int_0) [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc11_17.1: %i32 = value_of_initializer %int.convert_checked [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %.loc11_17.2: %i32 = converted %int_0, %.loc11_17.1 [concrete = constants.%int_0.6a9] +// CHECK:STDOUT: %impl.elem0.loc11_17.2: %.2dc = impl_witness_access constants.%IndexWith.impl_witness, element0 [concrete = constants.%At.642] +// CHECK:STDOUT: %bound_method.loc11_17.3: = bound_method %s.ref, %impl.elem0.loc11_17.2 +// CHECK:STDOUT: %At.call: init %i32 = call %bound_method.loc11_17.3(%s.ref, %.loc11_17.2) +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_invalid_subscript_type.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %ElementType.e6b: type = class_type @ElementType [concrete] +// CHECK:STDOUT: %SubscriptType.8ee: type = class_type @SubscriptType [concrete] +// CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete] +// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete] +// CHECK:STDOUT: %IndexWith.type.e80: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.8ee, %ElementType.e6b)> [concrete] +// CHECK:STDOUT: %At.type.b3f: type = fn_type @At.1, @IndexWith(%SubscriptType.8ee, %ElementType.e6b) [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness file.%IndexWith.impl_witness_table [concrete] +// CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] +// CHECK:STDOUT: %pattern_type.df7: type = pattern_type %SubscriptType.8ee [concrete] +// CHECK:STDOUT: %pattern_type.c39: type = pattern_type %ElementType.e6b [concrete] +// CHECK:STDOUT: %At.type.178: type = fn_type @At.2 [concrete] +// CHECK:STDOUT: %At.d43: %At.type.178 = struct_value () [concrete] +// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.e80 = facet_value %C, (%IndexWith.impl_witness) [concrete] +// CHECK:STDOUT: %ElementType.val: %ElementType.e6b = struct_value () [concrete] +// CHECK:STDOUT: %C.val: %C = struct_value () [concrete] +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] +// CHECK:STDOUT: %ImplicitAs.type.cc7: type = generic_interface_type @ImplicitAs [concrete] +// CHECK:STDOUT: %ImplicitAs.generic: %ImplicitAs.type.cc7 = struct_value () [concrete] +// CHECK:STDOUT: %.d94: type = fn_type_with_self_type %At.type.b3f, %IndexWith.facet [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .IndexWith = %Core.IndexWith +// CHECK:STDOUT: .ImplicitAs = %Core.ImplicitAs +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic] +// CHECK:STDOUT: %Core.ImplicitAs: %ImplicitAs.type.cc7 = import_ref Core//prelude/operators/as, ImplicitAs, loaded [concrete = constants.%ImplicitAs.generic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .ElementType = %ElementType.decl +// CHECK:STDOUT: .SubscriptType = %SubscriptType.decl +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} +// CHECK:STDOUT: %ElementType.decl: type = class_decl @ElementType [concrete = constants.%ElementType.e6b] {} {} +// CHECK:STDOUT: %SubscriptType.decl: type = class_decl @SubscriptType [concrete = constants.%SubscriptType.8ee] {} {} +// CHECK:STDOUT: impl_decl @impl [concrete] {} { +// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C] +// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] +// CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.504 = name_ref IndexWith, imports.%Core.IndexWith [concrete = constants.%IndexWith.generic] +// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [concrete = constants.%SubscriptType.8ee] +// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [concrete = constants.%ElementType.e6b] +// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%SubscriptType.8ee, constants.%ElementType.e6b)> [concrete = constants.%IndexWith.type.e80] +// CHECK:STDOUT: } +// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (@impl.%At.decl), @impl [concrete] +// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc14_13.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc14_13.2: init %C = class_init (), %.loc14_13.1 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc14_13.3: ref %C = temporary %.loc14_13.1, %.loc14_13.2 +// CHECK:STDOUT: %.loc14_13.4: ref %C = converted @__global_init.%.loc14, %.loc14_13.3 +// CHECK:STDOUT: %c: ref %C = bind_name c, %.loc14_13.4 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %x.patt: %pattern_type.c39 = binding_pattern x [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, %ElementType.decl [concrete = constants.%ElementType.e6b] +// CHECK:STDOUT: %.loc22: ref %ElementType.e6b = temporary @__global_init.%.loc22_25.2, @__global_init.%At.call +// CHECK:STDOUT: %x: ref %ElementType.e6b = bind_name x, %.loc22 +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: impl @impl: %C.ref as %IndexWith.type { +// CHECK:STDOUT: %At.decl: %At.type.178 = fn_decl @At.2 [concrete = constants.%At.d43] { +// CHECK:STDOUT: %self.patt: %pattern_type.c48 = binding_pattern self [concrete] +// CHECK:STDOUT: %self.param_patt: %pattern_type.c48 = value_param_pattern %self.patt, call_param0 [concrete] +// CHECK:STDOUT: %subscript.patt: %pattern_type.df7 = binding_pattern subscript [concrete] +// CHECK:STDOUT: %subscript.param_patt: %pattern_type.df7 = value_param_pattern %subscript.patt, call_param1 [concrete] +// CHECK:STDOUT: %return.patt: %pattern_type.c39 = return_slot_pattern [concrete] +// CHECK:STDOUT: %return.param_patt: %pattern_type.c39 = out_param_pattern %return.patt, call_param2 [concrete] +// CHECK:STDOUT: } { +// CHECK:STDOUT: %ElementType.ref: type = name_ref ElementType, file.%ElementType.decl [concrete = constants.%ElementType.e6b] +// CHECK:STDOUT: %self.param: %C = value_param call_param0 +// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%C.ref [concrete = constants.%C] +// CHECK:STDOUT: %self: %C = bind_name self, %self.param +// CHECK:STDOUT: %subscript.param: %SubscriptType.8ee = value_param call_param1 +// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, file.%SubscriptType.decl [concrete = constants.%SubscriptType.8ee] +// CHECK:STDOUT: %subscript: %SubscriptType.8ee = bind_name subscript, %subscript.param +// CHECK:STDOUT: %return.param: ref %ElementType.e6b = out_param call_param2 +// CHECK:STDOUT: %return: ref %ElementType.e6b = return_slot %return.param +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .SubscriptType = +// CHECK:STDOUT: .ElementType = +// CHECK:STDOUT: .At = %At.decl +// CHECK:STDOUT: witness = file.%IndexWith.impl_witness +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @ElementType { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%ElementType.e6b +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @SubscriptType { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%SubscriptType.8ee +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @At.2(%self.param: %C, %subscript.param: %SubscriptType.8ee) -> %return.param: %ElementType.e6b { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc10_13.1: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %.loc10_13.2: init %ElementType.e6b = class_init (), %return [concrete = constants.%ElementType.val] +// CHECK:STDOUT: %.loc10_14: init %ElementType.e6b = converted %.loc10_13.1, %.loc10_13.2 [concrete = constants.%ElementType.val] +// CHECK:STDOUT: return %.loc10_14 to %return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc14: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %c.ref: ref %C = name_ref c, file.%c +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] +// CHECK:STDOUT: %.loc22_25.1: %SubscriptType.8ee = converted %int_0, [concrete = ] +// CHECK:STDOUT: %impl.elem0: %.d94 = impl_witness_access constants.%IndexWith.impl_witness, element0 [concrete = constants.%At.d43] +// CHECK:STDOUT: %bound_method: = bound_method %c.ref, %impl.elem0 +// CHECK:STDOUT: %.loc22_25.2: ref %ElementType.e6b = temporary_storage +// CHECK:STDOUT: %.loc22_22: %C = bind_value %c.ref +// CHECK:STDOUT: %At.call: init %ElementType.e6b = call %bound_method(%.loc22_22, ) to %.loc22_25.2 +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: --- fail_index_with_not_implemented.carbon +// CHECK:STDOUT: +// CHECK:STDOUT: constants { +// CHECK:STDOUT: %C: type = class_type @C [concrete] +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] +// CHECK:STDOUT: %complete_type.357: = complete_type_witness %empty_struct_type [concrete] +// CHECK:STDOUT: %pattern_type.c48: type = pattern_type %C [concrete] +// CHECK:STDOUT: %C.val: %C = struct_value () [concrete] +// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete] +// CHECK:STDOUT: %Int.type: type = generic_class_type @Int [concrete] +// CHECK:STDOUT: %Int.generic: %Int.type = struct_value () [concrete] +// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete] +// CHECK:STDOUT: %pattern_type.7ce: type = pattern_type %i32 [concrete] +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] +// CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete] +// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: imports { +// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { +// CHECK:STDOUT: .Int = %Core.Int +// CHECK:STDOUT: .IndexWith = %Core.IndexWith +// CHECK:STDOUT: import Core//prelude +// CHECK:STDOUT: import Core//prelude/... +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.Int: %Int.type = import_ref Core//prelude/types/int, Int, loaded [concrete = constants.%Int.generic] +// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//prelude/operators/index, IndexWith, loaded [concrete = constants.%IndexWith.generic] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: file { +// CHECK:STDOUT: package: = namespace [concrete] { +// CHECK:STDOUT: .Core = imports.%Core +// CHECK:STDOUT: .C = %C.decl +// CHECK:STDOUT: .c = %c +// CHECK:STDOUT: .x = %x +// CHECK:STDOUT: } +// CHECK:STDOUT: %Core.import = import Core +// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {} +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %c.patt: %pattern_type.c48 = binding_pattern c [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %C.ref: type = name_ref C, %C.decl [concrete = constants.%C] +// CHECK:STDOUT: %.loc6_13.1: ref %C = temporary_storage +// CHECK:STDOUT: %.loc6_13.2: init %C = class_init (), %.loc6_13.1 [concrete = constants.%C.val] +// CHECK:STDOUT: %.loc6_13.3: ref %C = temporary %.loc6_13.1, %.loc6_13.2 +// CHECK:STDOUT: %.loc6_13.4: ref %C = converted @__global_init.%.loc6, %.loc6_13.3 +// CHECK:STDOUT: %c: ref %C = bind_name c, %.loc6_13.4 +// CHECK:STDOUT: name_binding_decl { +// CHECK:STDOUT: %x.patt: %pattern_type.7ce = binding_pattern x [concrete] +// CHECK:STDOUT: } +// CHECK:STDOUT: %.loc11: type = splice_block %i32 [concrete = constants.%i32] { +// 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: } +// CHECK:STDOUT: %x: %i32 = bind_name x, [concrete = ] +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: class @C { +// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] +// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type.357] +// CHECK:STDOUT: complete_type_witness = %complete_type +// CHECK:STDOUT: +// CHECK:STDOUT: !members: +// CHECK:STDOUT: .Self = constants.%C +// CHECK:STDOUT: } +// CHECK:STDOUT: +// CHECK:STDOUT: fn @__global_init() { +// CHECK:STDOUT: !entry: +// CHECK:STDOUT: %.loc6: %empty_struct_type = struct_literal () +// CHECK:STDOUT: %c.ref: ref %C = name_ref c, file.%c +// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] +// CHECK:STDOUT: return +// CHECK:STDOUT: } +// CHECK:STDOUT: diff --git a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon b/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon deleted file mode 100644 index 990250c5eb2a..000000000000 --- a/toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon +++ /dev/null @@ -1,447 +0,0 @@ -// Part of the Carbon Language project, under the Apache License v2.0 with LLVM -// Exceptions. See /LICENSE for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present -// -// AUTOUPDATE -// TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon -// TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/operators/overloaded/no_prelude/index.carbon - -// --- core_wrong_index_with.carbon - -package Core library "[[@TEST_NAME]]"; - -class IndexWith {} - -// --- fail_wrong_index_with.carbon - -library "[[@TEST_NAME]]"; - -import Core library "core_wrong_index_with"; - -// CHECK:STDERR: fail_wrong_index_with.carbon:[[@LINE+4]]:10: error: type `Core.IntLiteral` does not support indexing [TypeNotIndexable] -// CHECK:STDERR: fn F() { 0[1]; } -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -fn F() { 0[1]; } - -// --- fail_missing_index_with.carbon - -library "[[@TEST_NAME]]"; - -// CHECK:STDERR: fail_missing_index_with.carbon:[[@LINE+8]]:10: error: `Core.IndexWith` implicitly referenced here, but package `Core` not found [CoreNotFound] -// CHECK:STDERR: fn F() { 0[1]; } -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -// CHECK:STDERR: fail_missing_index_with.carbon:[[@LINE+4]]:10: error: type `Core.IntLiteral` does not support indexing [TypeNotIndexable] -// CHECK:STDERR: fn F() { 0[1]; } -// CHECK:STDERR: ^~~~ -// CHECK:STDERR: -fn F() { 0[1]; } - -// --- core_wrong_arg_count.carbon - -package Core library "[[@TEST_NAME]]"; - -interface IndexWith(SubscriptType:! type) { - fn At[self: Self](subscript: SubscriptType) -> (); -} - -// --- wrong_arg_count.carbon - -library "[[@TEST_NAME]]"; - -import Core library "core_wrong_arg_count"; - -impl () as Core.IndexWith(()) { - fn At[self: Self](subscript: ()) -> () { - return (); - } -} - -fn F() { ()[()]; } - -// CHECK:STDOUT: --- core_wrong_index_with.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %IndexWith: type = class_type @IndexWith [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .IndexWith = %IndexWith.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %IndexWith.decl: type = class_decl @IndexWith [concrete = constants.%IndexWith] {} {} -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @IndexWith { -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete = constants.%empty_struct_type] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete = constants.%complete_type] -// CHECK:STDOUT: complete_type_witness = %complete_type -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = constants.%IndexWith -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_wrong_index_with.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] -// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: %IndexWith: type = class_type @IndexWith [concrete] -// CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete] -// CHECK:STDOUT: %complete_type: = complete_type_witness %empty_struct_type [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .IndexWith = %Core.IndexWith -// CHECK:STDOUT: import Core//core_wrong_index_with -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IndexWith: type = import_ref Core//core_wrong_index_with, IndexWith, loaded [concrete = constants.%IndexWith] -// CHECK:STDOUT: %Core.import_ref.8f2: = import_ref Core//core_wrong_index_with, loc4_18, loaded [concrete = constants.%complete_type] -// CHECK:STDOUT: %Core.import_ref.4c7 = import_ref Core//core_wrong_index_with, inst16 [no loc], unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: class @IndexWith [from "core_wrong_index_with.carbon"] { -// CHECK:STDOUT: complete_type_witness = imports.%Core.import_ref.8f2 -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%Core.import_ref.4c7 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- fail_missing_index_with.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] -// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0] -// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1] -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- core_wrong_arg_count.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic] -// CHECK:STDOUT: %pattern_type.98f: type = pattern_type type [concrete] -// CHECK:STDOUT: %IndexWith.type.68b: type = generic_interface_type @IndexWith [concrete] -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.68b = struct_value () [concrete] -// CHECK:STDOUT: %IndexWith.type.b94: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic] -// CHECK:STDOUT: %Self: %IndexWith.type.b94 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic] -// CHECK:STDOUT: %pattern_type.2ad: type = pattern_type %Self.as_type [symbolic] -// CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %SubscriptType [symbolic] -// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] -// CHECK:STDOUT: %At.type: type = fn_type @At, @IndexWith(%SubscriptType) [symbolic] -// CHECK:STDOUT: %At: %At.type = struct_value () [symbolic] -// CHECK:STDOUT: %IndexWith.assoc_type: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType) [symbolic] -// CHECK:STDOUT: %assoc0: %IndexWith.assoc_type = assoc_entity element0, @IndexWith.%At.decl [symbolic] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .IndexWith = %IndexWith.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %IndexWith.decl: %IndexWith.type.68b = interface_decl @IndexWith [concrete = constants.%IndexWith.generic] { -// CHECK:STDOUT: %SubscriptType.patt: %pattern_type.98f = symbolic_binding_pattern SubscriptType, 0 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %SubscriptType.loc4_21.1: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType.loc4_21.2 (constants.%SubscriptType)] -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic interface @IndexWith(%SubscriptType.loc4_21.1: type) { -// CHECK:STDOUT: %SubscriptType.loc4_21.2: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType.loc4_21.2 (constants.%SubscriptType)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType.loc4_21.2)> [symbolic = %IndexWith.type (constants.%IndexWith.type.b94)] -// CHECK:STDOUT: %Self.2: @IndexWith.%IndexWith.type (%IndexWith.type.b94) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %At.type: type = fn_type @At, @IndexWith(%SubscriptType.loc4_21.2) [symbolic = %At.type (constants.%At.type)] -// CHECK:STDOUT: %At: @IndexWith.%At.type (%At.type) = struct_value () [symbolic = %At (constants.%At)] -// CHECK:STDOUT: %IndexWith.assoc_type: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType.loc4_21.2) [symbolic = %IndexWith.assoc_type (constants.%IndexWith.assoc_type)] -// CHECK:STDOUT: %assoc0.loc5_52.2: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type) = assoc_entity element0, %At.decl [symbolic = %assoc0.loc5_52.2 (constants.%assoc0)] -// CHECK:STDOUT: -// CHECK:STDOUT: interface { -// CHECK:STDOUT: %Self.1: @IndexWith.%IndexWith.type (%IndexWith.type.b94) = bind_symbolic_name Self, 1 [symbolic = %Self.2 (constants.%Self)] -// CHECK:STDOUT: %At.decl: @IndexWith.%At.type (%At.type) = fn_decl @At [symbolic = @IndexWith.%At (constants.%At)] { -// CHECK:STDOUT: %self.patt: @At.%pattern_type.loc5_9 (%pattern_type.2ad) = binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: @At.%pattern_type.loc5_9 (%pattern_type.2ad) = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %subscript.patt: @At.%pattern_type.loc5_21 (%pattern_type.7dc) = binding_pattern subscript [concrete] -// CHECK:STDOUT: %subscript.param_patt: @At.%pattern_type.loc5_21 (%pattern_type.7dc) = value_param_pattern %subscript.patt, call_param1 [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param2 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc5_51.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc5_51.2: type = converted %.loc5_51.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %self.param: @At.%Self.as_type.loc5_15.1 (%Self.as_type) = value_param call_param0 -// CHECK:STDOUT: %.loc5_15.1: type = splice_block %.loc5_15.3 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] { -// CHECK:STDOUT: %.loc5_15.2: @At.%IndexWith.type (%IndexWith.type.b94) = specific_constant @IndexWith.%Self.1, @IndexWith(constants.%SubscriptType) [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.ref: @At.%IndexWith.type (%IndexWith.type.b94) = name_ref Self, %.loc5_15.2 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.2: type = facet_access_type %Self.ref [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %.loc5_15.3: type = converted %Self.ref, %Self.as_type.loc5_15.2 [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: } -// CHECK:STDOUT: %self: @At.%Self.as_type.loc5_15.1 (%Self.as_type) = bind_name self, %self.param -// CHECK:STDOUT: %subscript.param: @At.%SubscriptType (%SubscriptType) = value_param call_param1 -// CHECK:STDOUT: %SubscriptType.ref: type = name_ref SubscriptType, @IndexWith.%SubscriptType.loc4_21.1 [symbolic = %SubscriptType (constants.%SubscriptType)] -// CHECK:STDOUT: %subscript: @At.%SubscriptType (%SubscriptType) = bind_name subscript, %subscript.param -// CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param2 -// CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: %assoc0.loc5_52.1: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type) = assoc_entity element0, %At.decl [symbolic = %assoc0.loc5_52.2 (constants.%assoc0)] -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = %Self.1 -// CHECK:STDOUT: .SubscriptType = -// CHECK:STDOUT: .At = %assoc0.loc5_52.1 -// CHECK:STDOUT: witness = (%At.decl) -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @At(@IndexWith.%SubscriptType.loc4_21.1: type, @IndexWith.%Self.1: @IndexWith.%IndexWith.type (%IndexWith.type.b94)) { -// CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)] -// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.b94)] -// CHECK:STDOUT: %Self: @At.%IndexWith.type (%IndexWith.type.b94) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self)] -// CHECK:STDOUT: %Self.as_type.loc5_15.1: type = facet_access_type %Self [symbolic = %Self.as_type.loc5_15.1 (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type.loc5_9: type = pattern_type %Self.as_type.loc5_15.1 [symbolic = %pattern_type.loc5_9 (constants.%pattern_type.2ad)] -// CHECK:STDOUT: %pattern_type.loc5_21: type = pattern_type %SubscriptType [symbolic = %pattern_type.loc5_21 (constants.%pattern_type.7dc)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn(%self.param: @At.%Self.as_type.loc5_15.1 (%Self.as_type), %subscript.param: @At.%SubscriptType (%SubscriptType)) -> %empty_tuple.type; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType) { -// CHECK:STDOUT: %SubscriptType.loc4_21.2 => constants.%SubscriptType -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @At(constants.%SubscriptType, constants.%Self) { -// CHECK:STDOUT: %SubscriptType => constants.%SubscriptType -// CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.b94 -// CHECK:STDOUT: %Self => constants.%Self -// CHECK:STDOUT: %Self.as_type.loc5_15.1 => constants.%Self.as_type -// CHECK:STDOUT: %pattern_type.loc5_9 => constants.%pattern_type.2ad -// CHECK:STDOUT: %pattern_type.loc5_21 => constants.%pattern_type.7dc -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: --- wrong_arg_count.carbon -// CHECK:STDOUT: -// CHECK:STDOUT: constants { -// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete] -// CHECK:STDOUT: %IndexWith.type.504: type = generic_interface_type @IndexWith [concrete] -// CHECK:STDOUT: %IndexWith.generic: %IndexWith.type.504 = struct_value () [concrete] -// CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic] -// CHECK:STDOUT: %IndexWith.type.bd2: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic] -// CHECK:STDOUT: %Self.30a: %IndexWith.type.bd2 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %At.type.cf4: type = fn_type @At.1, @IndexWith(%SubscriptType) [symbolic] -// CHECK:STDOUT: %At.281: %At.type.cf4 = struct_value () [symbolic] -// CHECK:STDOUT: %pattern_type.cb1: type = pattern_type %empty_tuple.type [concrete] -// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self.30a [symbolic] -// CHECK:STDOUT: %pattern_type.e1a: type = pattern_type %Self.as_type [symbolic] -// CHECK:STDOUT: %pattern_type.7dc: type = pattern_type %SubscriptType [symbolic] -// CHECK:STDOUT: %IndexWith.assoc_type.290: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType) [symbolic] -// CHECK:STDOUT: %assoc0.af8: %IndexWith.assoc_type.290 = assoc_entity element0, imports.%Core.import_ref.e99 [symbolic] -// CHECK:STDOUT: %IndexWith.type.a51: type = facet_type <@IndexWith, @IndexWith(%empty_tuple.type)> [concrete] -// CHECK:STDOUT: %Self.8f0: %IndexWith.type.a51 = bind_symbolic_name Self, 1 [symbolic] -// CHECK:STDOUT: %At.type.969: type = fn_type @At.1, @IndexWith(%empty_tuple.type) [concrete] -// CHECK:STDOUT: %At.9b9: %At.type.969 = struct_value () [concrete] -// CHECK:STDOUT: %IndexWith.assoc_type.3d4: type = assoc_entity_type @IndexWith, @IndexWith(%empty_tuple.type) [concrete] -// CHECK:STDOUT: %assoc0.21b: %IndexWith.assoc_type.3d4 = assoc_entity element0, imports.%Core.import_ref.e99 [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness file.%IndexWith.impl_witness_table [concrete] -// CHECK:STDOUT: %At.type.486: type = fn_type @At.2 [concrete] -// CHECK:STDOUT: %At.7c4: %At.type.486 = struct_value () [concrete] -// CHECK:STDOUT: %IndexWith.facet: %IndexWith.type.a51 = facet_value %empty_tuple.type, (%IndexWith.impl_witness) [concrete] -// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete] -// CHECK:STDOUT: %F.type: type = fn_type @F [concrete] -// CHECK:STDOUT: %F: %F.type = struct_value () [concrete] -// CHECK:STDOUT: %assoc0.e1e: %IndexWith.assoc_type.290 = assoc_entity element0, imports.%Core.import_ref.981 [symbolic] -// CHECK:STDOUT: %.ffc: type = fn_type_with_self_type %At.type.969, %IndexWith.facet [concrete] -// CHECK:STDOUT: %At.bound: = bound_method %empty_tuple, %At.7c4 [concrete] -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: imports { -// CHECK:STDOUT: %Core: = namespace file.%Core.import, [concrete] { -// CHECK:STDOUT: .IndexWith = %Core.IndexWith -// CHECK:STDOUT: import Core//core_wrong_arg_count -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.IndexWith: %IndexWith.type.504 = import_ref Core//core_wrong_arg_count, IndexWith, loaded [concrete = constants.%IndexWith.generic] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.1: type = import_ref Core//core_wrong_arg_count, loc4_21, loaded [symbolic = @IndexWith.%SubscriptType (constants.%SubscriptType)] -// CHECK:STDOUT: %Core.import_ref.68a = import_ref Core//core_wrong_arg_count, inst25 [no loc], unloaded -// CHECK:STDOUT: %Core.import_ref.613: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type.290) = import_ref Core//core_wrong_arg_count, loc5_52, loaded [symbolic = @IndexWith.%assoc0 (constants.%assoc0.e1e)] -// CHECK:STDOUT: %Core.At: @IndexWith.%At.type (%At.type.cf4) = import_ref Core//core_wrong_arg_count, At, loaded [symbolic = @IndexWith.%At (constants.%At.281)] -// CHECK:STDOUT: %Core.import_ref.5ab3ec.2: type = import_ref Core//core_wrong_arg_count, loc4_21, loaded [symbolic = @IndexWith.%SubscriptType (constants.%SubscriptType)] -// CHECK:STDOUT: %Core.import_ref.fb5: @IndexWith.%IndexWith.type (%IndexWith.type.bd2) = import_ref Core//core_wrong_arg_count, inst25 [no loc], loaded [symbolic = @IndexWith.%Self (constants.%Self.30a)] -// CHECK:STDOUT: %Core.import_ref.e99: @IndexWith.%At.type (%At.type.cf4) = import_ref Core//core_wrong_arg_count, loc5_52, loaded [symbolic = @IndexWith.%At (constants.%At.281)] -// CHECK:STDOUT: %Core.import_ref.981 = import_ref Core//core_wrong_arg_count, loc5_52, unloaded -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: file { -// CHECK:STDOUT: package: = namespace [concrete] { -// CHECK:STDOUT: .Core = imports.%Core -// CHECK:STDOUT: .F = %F.decl -// CHECK:STDOUT: } -// CHECK:STDOUT: %Core.import = import Core -// CHECK:STDOUT: impl_decl @impl [concrete] {} { -// CHECK:STDOUT: %.loc6_7.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_7.2: type = converted %.loc6_7.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %Core.ref: = name_ref Core, imports.%Core [concrete = imports.%Core] -// CHECK:STDOUT: %IndexWith.ref: %IndexWith.type.504 = name_ref IndexWith, imports.%Core.IndexWith [concrete = constants.%IndexWith.generic] -// CHECK:STDOUT: %.loc6_28: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc6_29: type = converted %.loc6_28, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(constants.%empty_tuple.type)> [concrete = constants.%IndexWith.type.a51] -// CHECK:STDOUT: } -// CHECK:STDOUT: %IndexWith.impl_witness_table = impl_witness_table (@impl.%At.decl), @impl [concrete] -// CHECK:STDOUT: %IndexWith.impl_witness: = impl_witness %IndexWith.impl_witness_table [concrete = constants.%IndexWith.impl_witness] -// CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [concrete = constants.%F] {} {} -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic interface @IndexWith(imports.%Core.import_ref.5ab3ec.1: type) [from "core_wrong_arg_count.carbon"] { -// CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)] -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.bd2)] -// CHECK:STDOUT: %Self: @IndexWith.%IndexWith.type (%IndexWith.type.bd2) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.30a)] -// CHECK:STDOUT: %At.type: type = fn_type @At.1, @IndexWith(%SubscriptType) [symbolic = %At.type (constants.%At.type.cf4)] -// CHECK:STDOUT: %At: @IndexWith.%At.type (%At.type.cf4) = struct_value () [symbolic = %At (constants.%At.281)] -// CHECK:STDOUT: %IndexWith.assoc_type: type = assoc_entity_type @IndexWith, @IndexWith(%SubscriptType) [symbolic = %IndexWith.assoc_type (constants.%IndexWith.assoc_type.290)] -// CHECK:STDOUT: %assoc0: @IndexWith.%IndexWith.assoc_type (%IndexWith.assoc_type.290) = assoc_entity element0, imports.%Core.import_ref.e99 [symbolic = %assoc0 (constants.%assoc0.af8)] -// CHECK:STDOUT: -// CHECK:STDOUT: interface { -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .Self = imports.%Core.import_ref.68a -// CHECK:STDOUT: .At = imports.%Core.import_ref.613 -// CHECK:STDOUT: witness = (imports.%Core.At) -// CHECK:STDOUT: } -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: impl @impl: %.loc6_7.2 as %IndexWith.type { -// CHECK:STDOUT: %At.decl: %At.type.486 = fn_decl @At.2 [concrete = constants.%At.7c4] { -// CHECK:STDOUT: %self.patt: %pattern_type.cb1 = binding_pattern self [concrete] -// CHECK:STDOUT: %self.param_patt: %pattern_type.cb1 = value_param_pattern %self.patt, call_param0 [concrete] -// CHECK:STDOUT: %subscript.patt: %pattern_type.cb1 = binding_pattern subscript [concrete] -// CHECK:STDOUT: %subscript.param_patt: %pattern_type.cb1 = value_param_pattern %subscript.patt, call_param1 [concrete] -// CHECK:STDOUT: %return.patt: %pattern_type.cb1 = return_slot_pattern [concrete] -// CHECK:STDOUT: %return.param_patt: %pattern_type.cb1 = out_param_pattern %return.patt, call_param2 [concrete] -// CHECK:STDOUT: } { -// CHECK:STDOUT: %.loc7_40.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc7_40.2: type = converted %.loc7_40.1, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %self.param: %empty_tuple.type = value_param call_param0 -// CHECK:STDOUT: %Self.ref: type = name_ref Self, @impl.%.loc6_7.2 [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: %self: %empty_tuple.type = bind_name self, %self.param -// CHECK:STDOUT: %subscript.param: %empty_tuple.type = value_param call_param1 -// CHECK:STDOUT: %.loc7_33.1: type = splice_block %.loc7_33.3 [concrete = constants.%empty_tuple.type] { -// CHECK:STDOUT: %.loc7_33.2: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc7_33.3: type = converted %.loc7_33.2, constants.%empty_tuple.type [concrete = constants.%empty_tuple.type] -// CHECK:STDOUT: } -// CHECK:STDOUT: %subscript: %empty_tuple.type = bind_name subscript, %subscript.param -// CHECK:STDOUT: %return.param: ref %empty_tuple.type = out_param call_param2 -// CHECK:STDOUT: %return: ref %empty_tuple.type = return_slot %return.param -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: !members: -// CHECK:STDOUT: .At = %At.decl -// CHECK:STDOUT: witness = file.%IndexWith.impl_witness -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: generic fn @At.1(imports.%Core.import_ref.5ab3ec.2: type, imports.%Core.import_ref.fb5: @IndexWith.%IndexWith.type (%IndexWith.type.bd2)) [from "core_wrong_arg_count.carbon"] { -// CHECK:STDOUT: %SubscriptType: type = bind_symbolic_name SubscriptType, 0 [symbolic = %SubscriptType (constants.%SubscriptType)] -// CHECK:STDOUT: %IndexWith.type: type = facet_type <@IndexWith, @IndexWith(%SubscriptType)> [symbolic = %IndexWith.type (constants.%IndexWith.type.bd2)] -// CHECK:STDOUT: %Self: @At.1.%IndexWith.type (%IndexWith.type.bd2) = bind_symbolic_name Self, 1 [symbolic = %Self (constants.%Self.30a)] -// CHECK:STDOUT: %Self.as_type: type = facet_access_type %Self [symbolic = %Self.as_type (constants.%Self.as_type)] -// CHECK:STDOUT: %pattern_type.1: type = pattern_type %Self.as_type [symbolic = %pattern_type.1 (constants.%pattern_type.e1a)] -// CHECK:STDOUT: %pattern_type.2: type = pattern_type %SubscriptType [symbolic = %pattern_type.2 (constants.%pattern_type.7dc)] -// CHECK:STDOUT: -// CHECK:STDOUT: fn; -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @At.2(%self.param: %empty_tuple.type, %subscript.param: %empty_tuple.type) -> %empty_tuple.type { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc8_13: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %empty_tuple: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc8_14: %empty_tuple.type = converted %.loc8_13, %empty_tuple [concrete = constants.%empty_tuple] -// CHECK:STDOUT: return %.loc8_14 -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: fn @F() { -// CHECK:STDOUT: !entry: -// CHECK:STDOUT: %.loc12_11.1: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %.loc12_14: %empty_tuple.type = tuple_literal () -// CHECK:STDOUT: %empty_tuple.loc12_11: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc12_11.2: %empty_tuple.type = converted %.loc12_11.1, %empty_tuple.loc12_11 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %empty_tuple.loc12_14: %empty_tuple.type = tuple_value () [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %.loc12_15: %empty_tuple.type = converted %.loc12_14, %empty_tuple.loc12_14 [concrete = constants.%empty_tuple] -// CHECK:STDOUT: %impl.elem0: %.ffc = impl_witness_access constants.%IndexWith.impl_witness, element0 [concrete = constants.%At.7c4] -// CHECK:STDOUT: %bound_method: = bound_method %.loc12_11.2, %impl.elem0 [concrete = constants.%At.bound] -// CHECK:STDOUT: %At.call: init %empty_tuple.type = call %bound_method(%.loc12_11.2, %.loc12_15) -// CHECK:STDOUT: return -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @IndexWith(constants.%SubscriptType) { -// CHECK:STDOUT: %SubscriptType => constants.%SubscriptType -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @At.1(constants.%SubscriptType, constants.%Self.30a) { -// CHECK:STDOUT: %SubscriptType => constants.%SubscriptType -// CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.bd2 -// CHECK:STDOUT: %Self => constants.%Self.30a -// CHECK:STDOUT: %Self.as_type => constants.%Self.as_type -// CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.e1a -// CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.7dc -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @IndexWith(constants.%empty_tuple.type) { -// CHECK:STDOUT: %SubscriptType => constants.%empty_tuple.type -// CHECK:STDOUT: -// CHECK:STDOUT: !definition: -// CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.a51 -// CHECK:STDOUT: %Self => constants.%Self.8f0 -// CHECK:STDOUT: %At.type => constants.%At.type.969 -// CHECK:STDOUT: %At => constants.%At.9b9 -// CHECK:STDOUT: %IndexWith.assoc_type => constants.%IndexWith.assoc_type.3d4 -// CHECK:STDOUT: %assoc0 => constants.%assoc0.21b -// CHECK:STDOUT: } -// CHECK:STDOUT: -// CHECK:STDOUT: specific @At.1(constants.%empty_tuple.type, constants.%IndexWith.facet) { -// CHECK:STDOUT: %SubscriptType => constants.%empty_tuple.type -// CHECK:STDOUT: %IndexWith.type => constants.%IndexWith.type.a51 -// CHECK:STDOUT: %Self => constants.%IndexWith.facet -// CHECK:STDOUT: %Self.as_type => constants.%empty_tuple.type -// CHECK:STDOUT: %pattern_type.1 => constants.%pattern_type.cb1 -// CHECK:STDOUT: %pattern_type.2 => constants.%pattern_type.cb1 -// CHECK:STDOUT: } -// CHECK:STDOUT: diff --git a/toolchain/check/testdata/packages/no_prelude/core_name_poisoning.carbon b/toolchain/check/testdata/packages/core_name_poisoning.carbon similarity index 79% rename from toolchain/check/testdata/packages/no_prelude/core_name_poisoning.carbon rename to toolchain/check/testdata/packages/core_name_poisoning.carbon index c27a06589f8f..1c7b3e9264b0 100644 --- a/toolchain/check/testdata/packages/no_prelude/core_name_poisoning.carbon +++ b/toolchain/check/testdata/packages/core_name_poisoning.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/core_name_poisoning.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/core_name_poisoning.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/core_name_poisoning.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/core_name_poisoning.carbon // --- fail_implicitly_poison_core.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon b/toolchain/check/testdata/packages/cross_package_export.carbon similarity index 99% rename from toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon rename to toolchain/check/testdata/packages/cross_package_export.carbon index 821ad3246736..c20b60f40dd3 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +++ b/toolchain/check/testdata/packages/cross_package_export.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/cross_package_export.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/cross_package_export.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/cross_package_export.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon b/toolchain/check/testdata/packages/cross_package_import.carbon similarity index 99% rename from toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon rename to toolchain/check/testdata/packages/cross_package_import.carbon index e9611ba52842..05e41ce85c1a 100644 --- a/toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +++ b/toolchain/check/testdata/packages/cross_package_import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/cross_package_import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/cross_package_import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/cross_package_import.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/packages/no_prelude/export_import.carbon b/toolchain/check/testdata/packages/export_import.carbon similarity index 99% rename from toolchain/check/testdata/packages/no_prelude/export_import.carbon rename to toolchain/check/testdata/packages/export_import.carbon index cb9a42648363..aba32de617f4 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_import.carbon +++ b/toolchain/check/testdata/packages/export_import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/export_import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/export_import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/export_import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/export_import.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon b/toolchain/check/testdata/packages/export_mixed.carbon similarity index 99% rename from toolchain/check/testdata/packages/no_prelude/export_mixed.carbon rename to toolchain/check/testdata/packages/export_mixed.carbon index 89a44ba7877e..ba9e828337c2 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +++ b/toolchain/check/testdata/packages/export_mixed.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/export_mixed.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/export_mixed.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/export_mixed.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/packages/no_prelude/export_name.carbon b/toolchain/check/testdata/packages/export_name.carbon similarity index 99% rename from toolchain/check/testdata/packages/no_prelude/export_name.carbon rename to toolchain/check/testdata/packages/export_name.carbon index 4b70994f0418..2eac47267050 100644 --- a/toolchain/check/testdata/packages/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/packages/export_name.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/export_name.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/export_name.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/export_name.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/export_name.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon b/toolchain/check/testdata/packages/fail_export_name_member.carbon similarity index 94% rename from toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon rename to toolchain/check/testdata/packages/fail_export_name_member.carbon index 00c230690571..1a7ee03ffaa9 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +++ b/toolchain/check/testdata/packages/fail_export_name_member.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/fail_export_name_member.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/fail_export_name_member.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/fail_export_name_member.carbon // --- a.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon b/toolchain/check/testdata/packages/fail_export_name_params.carbon similarity index 95% rename from toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon rename to toolchain/check/testdata/packages/fail_export_name_params.carbon index 7a2000e64c6b..9910426304a1 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon +++ b/toolchain/check/testdata/packages/fail_export_name_params.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/fail_export_name_params.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/fail_export_name_params.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/fail_export_name_params.carbon // --- a.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/packages/fail_modifiers.carbon similarity index 96% rename from toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon rename to toolchain/check/testdata/packages/fail_modifiers.carbon index a1a65cfaf639..ce75c8f5c433 100644 --- a/toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/packages/fail_modifiers.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/fail_modifiers.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/fail_modifiers.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/fail_modifiers.carbon // --- fail_extend_package.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_empty.carbon b/toolchain/check/testdata/packages/implicit_imports_empty.carbon similarity index 93% rename from toolchain/check/testdata/packages/no_prelude/implicit_imports_empty.carbon rename to toolchain/check/testdata/packages/implicit_imports_empty.carbon index eef11f082843..872ab87220ec 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_empty.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_empty.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/implicit_imports_empty.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/implicit_imports_empty.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/implicit_imports_empty.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/implicit_imports_empty.carbon // --- api_only.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon b/toolchain/check/testdata/packages/implicit_imports_entities.carbon similarity index 99% rename from toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon rename to toolchain/check/testdata/packages/implicit_imports_entities.carbon index ffabdce09103..2a5011fe6936 100644 --- a/toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +++ b/toolchain/check/testdata/packages/implicit_imports_entities.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/implicit_imports_entities.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/implicit_imports_entities.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/implicit_imports_entities.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon b/toolchain/check/testdata/packages/missing_prelude.carbon similarity index 98% rename from toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon rename to toolchain/check/testdata/packages/missing_prelude.carbon index 38115d630fa6..58be52c39431 100644 --- a/toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +++ b/toolchain/check/testdata/packages/missing_prelude.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/missing_prelude.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/missing_prelude.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/missing_prelude.carbon // --- fail_missing_prelude.carbon diff --git a/toolchain/check/testdata/packages/no_prelude/restricted_package_names.carbon b/toolchain/check/testdata/packages/restricted_package_names.carbon similarity index 95% rename from toolchain/check/testdata/packages/no_prelude/restricted_package_names.carbon rename to toolchain/check/testdata/packages/restricted_package_names.carbon index 6a5c34a0381c..0deef8569ada 100644 --- a/toolchain/check/testdata/packages/no_prelude/restricted_package_names.carbon +++ b/toolchain/check/testdata/packages/restricted_package_names.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/restricted_package_names.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/restricted_package_names.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/restricted_package_names.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/restricted_package_names.carbon // --- lowercase_main.carbon diff --git a/toolchain/check/testdata/struct/no_prelude/empty.carbon b/toolchain/check/testdata/struct/empty.carbon similarity index 94% rename from toolchain/check/testdata/struct/no_prelude/empty.carbon rename to toolchain/check/testdata/struct/empty.carbon index 07076f385982..f3d4f72250ce 100644 --- a/toolchain/check/testdata/struct/no_prelude/empty.carbon +++ b/toolchain/check/testdata/struct/empty.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/struct/no_prelude/empty.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/struct/empty.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/no_prelude/empty.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/empty.carbon var x: {} = {}; var y: {} = x; diff --git a/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon b/toolchain/check/testdata/struct/fail_assign_nested.carbon similarity index 92% rename from toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon rename to toolchain/check/testdata/struct/fail_assign_nested.carbon index 8393941656bb..2419bb050e6f 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon +++ b/toolchain/check/testdata/struct/fail_assign_nested.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/struct/fail_assign_nested.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/no_prelude/fail_assign_nested.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_assign_nested.carbon // CHECK:STDERR: fail_assign_nested.carbon:[[@LINE+4]]:19: error: missing value for field `a` in struct initialization [StructInitMissingFieldInLiteral] // CHECK:STDERR: var x: {.a: {}} = {.b = {}}; diff --git a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon b/toolchain/check/testdata/struct/fail_nested_incomplete.carbon similarity index 94% rename from toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon rename to toolchain/check/testdata/struct/fail_nested_incomplete.carbon index 6650572fa2dc..c6eeb4edbf4d 100644 --- a/toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon +++ b/toolchain/check/testdata/struct/fail_nested_incomplete.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/struct/fail_nested_incomplete.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/no_prelude/fail_nested_incomplete.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/struct/fail_nested_incomplete.carbon class Incomplete; diff --git a/toolchain/check/testdata/tuple/no_prelude/basics.carbon b/toolchain/check/testdata/tuple/basics.carbon similarity index 99% rename from toolchain/check/testdata/tuple/no_prelude/basics.carbon rename to toolchain/check/testdata/tuple/basics.carbon index 4a2d7bb6ecc0..00a07d43e75c 100644 --- a/toolchain/check/testdata/tuple/no_prelude/basics.carbon +++ b/toolchain/check/testdata/tuple/basics.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/tuple/no_prelude/basics.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/tuple/basics.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/no_prelude/basics.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/tuple/basics.carbon // Because tuples underly a lot of types, try to keep this file to have // minimal dependencies on other language syntax (particularly avoiding `class` diff --git a/toolchain/check/testdata/var/no_prelude/export_name.carbon b/toolchain/check/testdata/var/export_name.carbon similarity index 96% rename from toolchain/check/testdata/var/no_prelude/export_name.carbon rename to toolchain/check/testdata/var/export_name.carbon index e6faec703a84..958612dbebcb 100644 --- a/toolchain/check/testdata/var/no_prelude/export_name.carbon +++ b/toolchain/check/testdata/var/export_name.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/export_name.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/export_name.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/export_name.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/export_name.carbon // ============================================================================ // Setup files diff --git a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon b/toolchain/check/testdata/var/fail_generic.carbon similarity index 85% rename from toolchain/check/testdata/var/no_prelude/fail_generic.carbon rename to toolchain/check/testdata/var/fail_generic.carbon index 1a5a88aa1cdf..3bc2d3abe7eb 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_generic.carbon +++ b/toolchain/check/testdata/var/fail_generic.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/fail_generic.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/fail_generic.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_generic.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_generic.carbon fn Main() { // CHECK:STDERR: fail_generic.carbon:[[@LINE+8]]:7: error: semantics TODO: `handle invalid parse trees in `check`` [SemanticsTodo] diff --git a/toolchain/check/testdata/var/no_prelude/fail_in_interface.carbon b/toolchain/check/testdata/var/fail_in_interface.carbon similarity index 91% rename from toolchain/check/testdata/var/no_prelude/fail_in_interface.carbon rename to toolchain/check/testdata/var/fail_in_interface.carbon index a92cda72592d..a0aed8c6ff5a 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_in_interface.carbon +++ b/toolchain/check/testdata/var/fail_in_interface.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/fail_in_interface.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/fail_in_interface.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_in_interface.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_in_interface.carbon interface I { // CHECK:STDERR: fail_in_interface.carbon:[[@LINE+4]]:11: error: found runtime binding pattern in associated constant declaration; expected a `:!` binding [ExpectedSymbolicBindingInAssociatedConstant] diff --git a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon b/toolchain/check/testdata/var/fail_init_type_mismatch.carbon similarity index 92% rename from toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon rename to toolchain/check/testdata/var/fail_init_type_mismatch.carbon index ff976fa76bde..443295fb6e90 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon +++ b/toolchain/check/testdata/var/fail_init_type_mismatch.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/fail_init_type_mismatch.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_init_type_mismatch.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_init_type_mismatch.carbon // CHECK:STDERR: fail_init_type_mismatch.carbon:[[@LINE+4]]:1: error: `Core.ImplicitAs` implicitly referenced here, but package `Core` not found [CoreNotFound] // CHECK:STDERR: var x: {} = (); diff --git a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon b/toolchain/check/testdata/var/fail_modifiers.carbon similarity index 96% rename from toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon rename to toolchain/check/testdata/var/fail_modifiers.carbon index 1d1cb7fc117b..50e5c2ddbb41 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon +++ b/toolchain/check/testdata/var/fail_modifiers.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/fail_modifiers.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_modifiers.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_modifiers.carbon // CHECK:STDERR: fail_modifiers.carbon:[[@LINE+4]]:1: error: `protected` not allowed; requires class scope [ModifierProtectedNotAllowed] // CHECK:STDERR: protected var b: (); diff --git a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon b/toolchain/check/testdata/var/fail_namespace_conflict.carbon similarity index 94% rename from toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon rename to toolchain/check/testdata/var/fail_namespace_conflict.carbon index e52b73e553de..c187cfc5381e 100644 --- a/toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon +++ b/toolchain/check/testdata/var/fail_namespace_conflict.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/fail_namespace_conflict.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/fail_namespace_conflict.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/fail_namespace_conflict.carbon namespace A; diff --git a/toolchain/check/testdata/var/no_prelude/global_decl.carbon b/toolchain/check/testdata/var/global_decl.carbon similarity index 90% rename from toolchain/check/testdata/var/no_prelude/global_decl.carbon rename to toolchain/check/testdata/var/global_decl.carbon index 07bb542f4e88..9fce292ccf3f 100644 --- a/toolchain/check/testdata/var/no_prelude/global_decl.carbon +++ b/toolchain/check/testdata/var/global_decl.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/global_decl.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/global_decl.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/global_decl.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/global_decl.carbon var x: {.v: ()}; diff --git a/toolchain/check/testdata/var/no_prelude/global_decl_import.carbon b/toolchain/check/testdata/var/global_decl_import.carbon similarity index 96% rename from toolchain/check/testdata/var/no_prelude/global_decl_import.carbon rename to toolchain/check/testdata/var/global_decl_import.carbon index 695e8dc7b61e..b3606b06f4e6 100644 --- a/toolchain/check/testdata/var/no_prelude/global_decl_import.carbon +++ b/toolchain/check/testdata/var/global_decl_import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/global_decl_import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/global_decl_import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/global_decl_import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/global_decl_import.carbon // --- decl.carbon diff --git a/toolchain/check/testdata/var/no_prelude/global_decl_with_init.carbon b/toolchain/check/testdata/var/global_decl_with_init.carbon similarity index 97% rename from toolchain/check/testdata/var/no_prelude/global_decl_with_init.carbon rename to toolchain/check/testdata/var/global_decl_with_init.carbon index b374c3e0167d..8935145f43e3 100644 --- a/toolchain/check/testdata/var/no_prelude/global_decl_with_init.carbon +++ b/toolchain/check/testdata/var/global_decl_with_init.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/global_decl_with_init.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/global_decl_with_init.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/global_decl_with_init.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/global_decl_with_init.carbon // --- simple.carbon diff --git a/toolchain/check/testdata/var/no_prelude/global_lookup.carbon b/toolchain/check/testdata/var/global_lookup.carbon similarity index 96% rename from toolchain/check/testdata/var/no_prelude/global_lookup.carbon rename to toolchain/check/testdata/var/global_lookup.carbon index c35b802f030e..92e5b3aef563 100644 --- a/toolchain/check/testdata/var/no_prelude/global_lookup.carbon +++ b/toolchain/check/testdata/var/global_lookup.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/global_lookup.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/global_lookup.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/global_lookup.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/global_lookup.carbon var x: {.v: ()} = {.v = ()}; var y: {.v: ()} = x; diff --git a/toolchain/check/testdata/var/no_prelude/import.carbon b/toolchain/check/testdata/var/import.carbon similarity index 96% rename from toolchain/check/testdata/var/no_prelude/import.carbon rename to toolchain/check/testdata/var/import.carbon index 41ca7ba55265..08264012c67c 100644 --- a/toolchain/check/testdata/var/no_prelude/import.carbon +++ b/toolchain/check/testdata/var/import.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/import.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/import.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/import.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/import.carbon // --- implicit.carbon diff --git a/toolchain/check/testdata/var/no_prelude/import_access.carbon b/toolchain/check/testdata/var/import_access.carbon similarity index 97% rename from toolchain/check/testdata/var/no_prelude/import_access.carbon rename to toolchain/check/testdata/var/import_access.carbon index 6a0fcb982148..7107f2c7e3ad 100644 --- a/toolchain/check/testdata/var/no_prelude/import_access.carbon +++ b/toolchain/check/testdata/var/import_access.carbon @@ -3,13 +3,13 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only". -// EXTRA-ARGS: --dump-sem-ir-ranges=if-present +// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/no_prelude/import_access.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/var/import_access.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/no_prelude/import_access.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/var/import_access.carbon // ============================================================================ // Setup files diff --git a/toolchain/lower/testdata/builtins/no_prelude/bool.carbon b/toolchain/lower/testdata/builtins/bool.carbon similarity index 76% rename from toolchain/lower/testdata/builtins/no_prelude/bool.carbon rename to toolchain/lower/testdata/builtins/bool.carbon index 1b8b158f9464..0694da461468 100644 --- a/toolchain/lower/testdata/builtins/no_prelude/bool.carbon +++ b/toolchain/lower/testdata/builtins/bool.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/builtins/no_prelude/bool.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/builtins/bool.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/no_prelude/bool.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/bool.carbon fn Bool() -> type = "bool.make_type"; @@ -55,16 +57,16 @@ fn IfEq(a: Bool(), b: Bool()) -> Bool() { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "bool.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TestEq", linkageName: "_CTestEq.Main", scope: null, file: !3, line: 14, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "TestEq", linkageName: "_CTestEq.Main", scope: null, file: !3, line: 16, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 14, column: 52, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 14, column: 45, scope: !4) -// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestNeq", linkageName: "_CTestNeq.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !10 = !DILocation(line: 17, column: 53, scope: !9) -// CHECK:STDOUT: !11 = !DILocation(line: 17, column: 46, scope: !9) -// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "IfEq", linkageName: "_CIfEq.Main", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !13 = !DILocation(line: 20, column: 7, scope: !12) -// CHECK:STDOUT: !14 = !DILocation(line: 20, column: 6, scope: !12) -// CHECK:STDOUT: !15 = !DILocation(line: 20, column: 19, scope: !12) -// CHECK:STDOUT: !16 = !DILocation(line: 21, column: 3, scope: !12) +// CHECK:STDOUT: !7 = !DILocation(line: 16, column: 52, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 16, column: 45, scope: !4) +// CHECK:STDOUT: !9 = distinct !DISubprogram(name: "TestNeq", linkageName: "_CTestNeq.Main", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !10 = !DILocation(line: 19, column: 53, scope: !9) +// CHECK:STDOUT: !11 = !DILocation(line: 19, column: 46, scope: !9) +// CHECK:STDOUT: !12 = distinct !DISubprogram(name: "IfEq", linkageName: "_CIfEq.Main", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !13 = !DILocation(line: 22, column: 7, scope: !12) +// CHECK:STDOUT: !14 = !DILocation(line: 22, column: 6, scope: !12) +// CHECK:STDOUT: !15 = !DILocation(line: 22, column: 19, scope: !12) +// CHECK:STDOUT: !16 = !DILocation(line: 23, column: 3, scope: !12) diff --git a/toolchain/lower/testdata/builtins/no_prelude/no_op.carbon b/toolchain/lower/testdata/builtins/no_op.carbon similarity index 74% rename from toolchain/lower/testdata/builtins/no_prelude/no_op.carbon rename to toolchain/lower/testdata/builtins/no_op.carbon index 2cd61de0c25a..9a674abaf17f 100644 --- a/toolchain/lower/testdata/builtins/no_prelude/no_op.carbon +++ b/toolchain/lower/testdata/builtins/no_op.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/builtins/no_prelude/no_op.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/builtins/no_op.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/no_prelude/no_op.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/no_op.carbon fn NoOp() = "no_op"; @@ -48,7 +50,7 @@ fn J() { // CHECK:STDOUT: // CHECK:STDOUT: define void @_CH.Main() !dbg !11 { // CHECK:STDOUT: entry: -// CHECK:STDOUT: %.loc25_18.1.temp = alloca {}, align 8, !dbg !12 +// CHECK:STDOUT: %.loc27_18.1.temp = alloca {}, align 8, !dbg !12 // CHECK:STDOUT: ret void, !dbg !13 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -57,7 +59,7 @@ fn J() { // CHECK:STDOUT: define void @_CJ.Main() !dbg !14 { // CHECK:STDOUT: entry: // CHECK:STDOUT: call void @_CI.Main(), !dbg !15 -// CHECK:STDOUT: %.loc31_11.1.temp = alloca {}, align 8, !dbg !15 +// CHECK:STDOUT: %.loc33_11.1.temp = alloca {}, align 8, !dbg !15 // CHECK:STDOUT: ret void, !dbg !16 // CHECK:STDOUT: } // CHECK:STDOUT: @@ -73,16 +75,16 @@ fn J() { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "no_op.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 15, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 15, column: 1, scope: !4) -// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !9 = !DILocation(line: 20, column: 3, scope: !8) -// CHECK:STDOUT: !10 = !DILocation(line: 21, column: 3, scope: !8) -// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !3, line: 24, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !12 = !DILocation(line: 25, column: 10, scope: !11) -// CHECK:STDOUT: !13 = !DILocation(line: 25, column: 3, scope: !11) -// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "J", linkageName: "_CJ.Main", scope: null, file: !3, line: 30, type: !5, spFlags: DISPFlagDefinition, unit: !2) -// CHECK:STDOUT: !15 = !DILocation(line: 31, column: 9, scope: !14) -// CHECK:STDOUT: !16 = !DILocation(line: 30, column: 1, scope: !14) +// CHECK:STDOUT: !7 = !DILocation(line: 17, column: 1, scope: !4) +// CHECK:STDOUT: !8 = distinct !DISubprogram(name: "G", linkageName: "_CG.Main", scope: null, file: !3, line: 21, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !9 = !DILocation(line: 22, column: 3, scope: !8) +// CHECK:STDOUT: !10 = !DILocation(line: 23, column: 3, scope: !8) +// CHECK:STDOUT: !11 = distinct !DISubprogram(name: "H", linkageName: "_CH.Main", scope: null, file: !3, line: 26, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !12 = !DILocation(line: 27, column: 10, scope: !11) +// CHECK:STDOUT: !13 = !DILocation(line: 27, column: 3, scope: !11) +// CHECK:STDOUT: !14 = distinct !DISubprogram(name: "J", linkageName: "_CJ.Main", scope: null, file: !3, line: 32, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !15 = !DILocation(line: 33, column: 9, scope: !14) +// CHECK:STDOUT: !16 = !DILocation(line: 32, column: 1, scope: !14) diff --git a/toolchain/lower/testdata/builtins/no_prelude/types.carbon b/toolchain/lower/testdata/builtins/types.carbon similarity index 85% rename from toolchain/lower/testdata/builtins/no_prelude/types.carbon rename to toolchain/lower/testdata/builtins/types.carbon index ce16fa6bfce3..36a40d1a792d 100644 --- a/toolchain/lower/testdata/builtins/no_prelude/types.carbon +++ b/toolchain/lower/testdata/builtins/types.carbon @@ -2,11 +2,13 @@ // Exceptions. See /LICENSE for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // +// EXTRA-ARGS: --no-prelude-import +// // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/builtins/no_prelude/types.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/builtins/types.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/no_prelude/types.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/builtins/types.carbon fn IntLiteral() -> type = "int_literal.make_type"; fn Int(size: IntLiteral()) -> type = "int.make_type_signed"; @@ -52,10 +54,10 @@ fn F() { // CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3} // CHECK:STDOUT: !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug) // CHECK:STDOUT: !3 = !DIFile(filename: "types.carbon", directory: "") -// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 17, type: !5, spFlags: DISPFlagDefinition, unit: !2) +// CHECK:STDOUT: !4 = distinct !DISubprogram(name: "F", linkageName: "_CF.Main", scope: null, file: !3, line: 19, type: !5, spFlags: DISPFlagDefinition, unit: !2) // CHECK:STDOUT: !5 = !DISubroutineType(types: !6) // CHECK:STDOUT: !6 = !{} -// CHECK:STDOUT: !7 = !DILocation(line: 18, column: 3, scope: !4) -// CHECK:STDOUT: !8 = !DILocation(line: 19, column: 3, scope: !4) -// CHECK:STDOUT: !9 = !DILocation(line: 20, column: 3, scope: !4) -// CHECK:STDOUT: !10 = !DILocation(line: 17, column: 1, scope: !4) +// CHECK:STDOUT: !7 = !DILocation(line: 20, column: 3, scope: !4) +// CHECK:STDOUT: !8 = !DILocation(line: 21, column: 3, scope: !4) +// CHECK:STDOUT: !9 = !DILocation(line: 22, column: 3, scope: !4) +// CHECK:STDOUT: !10 = !DILocation(line: 19, column: 1, scope: !4) diff --git a/toolchain/testing/file_test.cpp b/toolchain/testing/file_test.cpp index a18efc49cd99..b64c44fbceb6 100644 --- a/toolchain/testing/file_test.cpp +++ b/toolchain/testing/file_test.cpp @@ -63,19 +63,14 @@ class ToolchainFileTest : public FileTestBase { } private: - // The prelude mode. For lex and parse, it's always `None`; we exclude it in - // order to focus errors. For check and lowering, it's set through - // `min_prelude` and `no_prelude` subdirectories. + // The prelude mode. For lex and parse, it's always `Default`. For check and + // lowering, it's set through `min_prelude` subdirectories. + // TODO: Remove `min_prelude` subdirectory support. enum Prelude { Default, Min, - None, }; auto prelude() const -> Prelude { - if (component_ == "lex" || component_ == "parse" || - test_name().find("/no_prelude/") != llvm::StringRef::npos) { - return Prelude::None; - } if (test_name().find("/min_prelude/") != llvm::StringRef::npos) { return Prelude::Min; } @@ -134,9 +129,11 @@ auto ToolchainFileTest::Run( llvm::IntrusiveRefCntPtr& fs, FILE* input_stream, llvm::raw_pwrite_stream& output_stream, llvm::raw_pwrite_stream& error_stream) const -> ErrorOr { - CARBON_ASSIGN_OR_RETURN(auto prelude_files, - installation_.ReadPreludeManifest()); - if (prelude() == Prelude::Default) { + llvm::SmallVector prelude_files; + // Lex and parse shouldn't ever access the prelude. + if (component_ != "lex" && component_ != "parse") { + // TODO: Try providing the prelude as an overlay. + CARBON_ASSIGN_OR_RETURN(prelude_files, installation_.ReadPreludeManifest()); for (const auto& file : prelude_files) { CARBON_RETURN_IF_ERROR(AddFile(*fs, file)); } @@ -188,9 +185,10 @@ auto ToolchainFileTest::GetDefaultArgs() const args.insert(args.end(), {"compile", "--phase=" + component_.str()}); if (component_ == "lex") { - args.insert(args.end(), {"--dump-tokens", "--omit-file-boundary-tokens"}); + args.insert(args.end(), {"--no-prelude-import", "--dump-tokens", + "--omit-file-boundary-tokens"}); } else if (component_ == "parse") { - args.push_back("--dump-parse-tree"); + args.insert(args.end(), {"--no-prelude-import", "--dump-parse-tree"}); } else if (component_ == "check") { args.insert(args.end(), {"--dump-sem-ir", "--dump-sem-ir-ranges=only"}); } else if (component_ == "lower") { @@ -214,10 +212,6 @@ auto ToolchainFileTest::GetDefaultArgs() const args.insert(args.end(), {"--custom-core", "--exclude-dump-file-prefix=include_files/"}); break; - - case Prelude::None: - args.push_back("--no-prelude-import"); - break; } args.push_back("%s");