From e7ffb559f5b65cc924644f633daa96bb220c5eaf Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 9 Jun 2026 10:50:52 -0700 Subject: [PATCH] Reorganize lower interop tests. (#7327) Split existing class and function tests into `{class,function}/{import,export}` as appropriate. Remove the now-empty `reverse/` directory. --- .../interop/cpp/{reverse => class/export}/class.carbon | 4 ++-- .../mangle_type.carbon => class/export/mangle.carbon} | 4 ++-- .../interop/cpp/{reverse => class/export}/method.carbon | 4 ++-- .../lower/testdata/interop/cpp/{ => class/import}/base.carbon | 4 ++-- .../interop/cpp/{ => class/import}/constructor.carbon | 4 ++-- .../interop/cpp/{ => class/import}/copy_vs_move.carbon | 4 ++-- .../testdata/interop/cpp/{ => class/import}/field.carbon | 4 ++-- .../testdata/interop/cpp/{ => class/import}/method.carbon | 4 ++-- .../interop/cpp/{ => class/import}/virtual_base.carbon | 4 ++-- .../interop/cpp/{reverse => function/export}/function.carbon | 4 ++-- .../testdata/interop/cpp/{ => function/import}/cpp_run.carbon | 4 ++-- .../interop/cpp/{ => function/import}/function_decl.carbon | 4 ++-- .../cpp/{ => function/import}/function_in_template.carbon | 4 ++-- .../interop/cpp/{ => function/import}/import_inline.carbon | 4 ++-- .../interop/cpp/{ => function/import}/parameters.carbon | 4 ++-- .../testdata/interop/cpp/{ => function/import}/return.carbon | 4 ++-- 16 files changed, 32 insertions(+), 32 deletions(-) rename toolchain/lower/testdata/interop/cpp/{reverse => class/export}/class.carbon (99%) rename toolchain/lower/testdata/interop/cpp/{reverse/mangle_type.carbon => class/export/mangle.carbon} (95%) rename toolchain/lower/testdata/interop/cpp/{reverse => class/export}/method.carbon (99%) rename toolchain/lower/testdata/interop/cpp/{ => class/import}/base.carbon (98%) rename toolchain/lower/testdata/interop/cpp/{ => class/import}/constructor.carbon (99%) rename toolchain/lower/testdata/interop/cpp/{ => class/import}/copy_vs_move.carbon (99%) rename toolchain/lower/testdata/interop/cpp/{ => class/import}/field.carbon (99%) rename toolchain/lower/testdata/interop/cpp/{ => class/import}/method.carbon (99%) rename toolchain/lower/testdata/interop/cpp/{ => class/import}/virtual_base.carbon (98%) rename toolchain/lower/testdata/interop/cpp/{reverse => function/export}/function.carbon (99%) rename toolchain/lower/testdata/interop/cpp/{ => function/import}/cpp_run.carbon (94%) rename toolchain/lower/testdata/interop/cpp/{ => function/import}/function_decl.carbon (99%) rename toolchain/lower/testdata/interop/cpp/{ => function/import}/function_in_template.carbon (94%) rename toolchain/lower/testdata/interop/cpp/{ => function/import}/import_inline.carbon (96%) rename toolchain/lower/testdata/interop/cpp/{ => function/import}/parameters.carbon (99%) rename toolchain/lower/testdata/interop/cpp/{ => function/import}/return.carbon (99%) diff --git a/toolchain/lower/testdata/interop/cpp/reverse/class.carbon b/toolchain/lower/testdata/interop/cpp/class/export/class.carbon similarity index 99% rename from toolchain/lower/testdata/interop/cpp/reverse/class.carbon rename to toolchain/lower/testdata/interop/cpp/class/export/class.carbon index 59ce9543ffb4..af60f05668dc 100644 --- a/toolchain/lower/testdata/interop/cpp/reverse/class.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/class.carbon @@ -7,9 +7,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/reverse/class.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/class/export/class.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/reverse/class.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/class/export/class.carbon // --- pointer.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/lower/testdata/interop/cpp/reverse/mangle_type.carbon b/toolchain/lower/testdata/interop/cpp/class/export/mangle.carbon similarity index 95% rename from toolchain/lower/testdata/interop/cpp/reverse/mangle_type.carbon rename to toolchain/lower/testdata/interop/cpp/class/export/mangle.carbon index b9b77aa3bf4d..70020791bf2d 100644 --- a/toolchain/lower/testdata/interop/cpp/reverse/mangle_type.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/mangle.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/lower/testdata/interop/cpp/reverse/mangle_type.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/class/export/mangle.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/reverse/mangle_type.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/class/export/mangle.carbon // --- other.carbon package Other; diff --git a/toolchain/lower/testdata/interop/cpp/reverse/method.carbon b/toolchain/lower/testdata/interop/cpp/class/export/method.carbon similarity index 99% rename from toolchain/lower/testdata/interop/cpp/reverse/method.carbon rename to toolchain/lower/testdata/interop/cpp/class/export/method.carbon index 9c4049034abe..5fc0bdca67ef 100644 --- a/toolchain/lower/testdata/interop/cpp/reverse/method.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/export/method.carbon @@ -7,9 +7,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/reverse/method.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/class/export/method.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/reverse/method.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/class/export/method.carbon // --- method.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/lower/testdata/interop/cpp/base.carbon b/toolchain/lower/testdata/interop/cpp/class/import/base.carbon similarity index 98% rename from toolchain/lower/testdata/interop/cpp/base.carbon rename to toolchain/lower/testdata/interop/cpp/class/import/base.carbon index 00b005ba4ba6..d26cedce5643 100644 --- a/toolchain/lower/testdata/interop/cpp/base.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/base.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/lower/testdata/interop/cpp/base.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/class/import/base.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/base.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/class/import/base.carbon // --- structs.h diff --git a/toolchain/lower/testdata/interop/cpp/constructor.carbon b/toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon similarity index 99% rename from toolchain/lower/testdata/interop/cpp/constructor.carbon rename to toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon index 6ddb4b3728f5..3c2afc9b3fce 100644 --- a/toolchain/lower/testdata/interop/cpp/constructor.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/constructor.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/lower/testdata/interop/cpp/constructor.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/constructor.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/class/import/constructor.carbon // ============================================================================ // Default constructor diff --git a/toolchain/lower/testdata/interop/cpp/copy_vs_move.carbon b/toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon similarity index 99% rename from toolchain/lower/testdata/interop/cpp/copy_vs_move.carbon rename to toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon index 1c47445c2885..5866e8ee2092 100644 --- a/toolchain/lower/testdata/interop/cpp/copy_vs_move.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon @@ -7,9 +7,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/copy_vs_move.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/copy_vs_move.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/class/import/copy_vs_move.carbon // --- copyable.carbon library "[[@TEST_NAME]]"; diff --git a/toolchain/lower/testdata/interop/cpp/field.carbon b/toolchain/lower/testdata/interop/cpp/class/import/field.carbon similarity index 99% rename from toolchain/lower/testdata/interop/cpp/field.carbon rename to toolchain/lower/testdata/interop/cpp/class/import/field.carbon index f394c0ac90fd..d6d1249161df 100644 --- a/toolchain/lower/testdata/interop/cpp/field.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/field.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/lower/testdata/interop/cpp/field.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/class/import/field.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/field.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/class/import/field.carbon // --- struct.h diff --git a/toolchain/lower/testdata/interop/cpp/method.carbon b/toolchain/lower/testdata/interop/cpp/class/import/method.carbon similarity index 99% rename from toolchain/lower/testdata/interop/cpp/method.carbon rename to toolchain/lower/testdata/interop/cpp/class/import/method.carbon index 5022e9c5408e..d0b3b6ed875a 100644 --- a/toolchain/lower/testdata/interop/cpp/method.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/method.carbon @@ -7,9 +7,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/method.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/class/import/method.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/method.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/class/import/method.carbon // --- methods.h diff --git a/toolchain/lower/testdata/interop/cpp/virtual_base.carbon b/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon similarity index 98% rename from toolchain/lower/testdata/interop/cpp/virtual_base.carbon rename to toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon index 9727b60bae60..18ac2616a3a7 100644 --- a/toolchain/lower/testdata/interop/cpp/virtual_base.carbon +++ b/toolchain/lower/testdata/interop/cpp/class/import/virtual_base.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/lower/testdata/interop/cpp/virtual_base.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/virtual_base.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/class/import/virtual_base.carbon // --- diamond.h diff --git a/toolchain/lower/testdata/interop/cpp/reverse/function.carbon b/toolchain/lower/testdata/interop/cpp/function/export/function.carbon similarity index 99% rename from toolchain/lower/testdata/interop/cpp/reverse/function.carbon rename to toolchain/lower/testdata/interop/cpp/function/export/function.carbon index 7dc371ca1367..05e934f195b2 100644 --- a/toolchain/lower/testdata/interop/cpp/reverse/function.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/export/function.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/lower/testdata/interop/cpp/reverse/function.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/export/function.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/reverse/function.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/export/function.carbon // --- other.carbon package Other; diff --git a/toolchain/lower/testdata/interop/cpp/cpp_run.carbon b/toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon similarity index 94% rename from toolchain/lower/testdata/interop/cpp/cpp_run.carbon rename to toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon index 265f94fa9d5e..cf6aec02e349 100644 --- a/toolchain/lower/testdata/interop/cpp/cpp_run.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/cpp_run.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/lower/testdata/interop/cpp/cpp_run.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/cpp_run.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/cpp_run.carbon // --- carbon_run.carbon diff --git a/toolchain/lower/testdata/interop/cpp/function_decl.carbon b/toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon similarity index 99% rename from toolchain/lower/testdata/interop/cpp/function_decl.carbon rename to toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon index 3aa42285e712..276b009627af 100644 --- a/toolchain/lower/testdata/interop/cpp/function_decl.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/function_decl.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/lower/testdata/interop/cpp/function_decl.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function_decl.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/function_decl.carbon // ============================================================================ // function_decl diff --git a/toolchain/lower/testdata/interop/cpp/function_in_template.carbon b/toolchain/lower/testdata/interop/cpp/function/import/function_in_template.carbon similarity index 94% rename from toolchain/lower/testdata/interop/cpp/function_in_template.carbon rename to toolchain/lower/testdata/interop/cpp/function/import/function_in_template.carbon index 457cf90f1315..1b546ead3faa 100644 --- a/toolchain/lower/testdata/interop/cpp/function_in_template.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/function_in_template.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/lower/testdata/interop/cpp/function_in_template.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/function_in_template.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function_in_template.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/function_in_template.carbon // --- class_template.h diff --git a/toolchain/lower/testdata/interop/cpp/import_inline.carbon b/toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon similarity index 96% rename from toolchain/lower/testdata/interop/cpp/import_inline.carbon rename to toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon index 20a35ed8493e..3c01cf315903 100644 --- a/toolchain/lower/testdata/interop/cpp/import_inline.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/import_inline.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/lower/testdata/interop/cpp/import_inline.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/import_inline.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/import_inline.carbon import Cpp inline ''' diff --git a/toolchain/lower/testdata/interop/cpp/parameters.carbon b/toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon similarity index 99% rename from toolchain/lower/testdata/interop/cpp/parameters.carbon rename to toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon index 07f421b9d8d9..74bbac56c895 100644 --- a/toolchain/lower/testdata/interop/cpp/parameters.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/parameters.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/lower/testdata/interop/cpp/parameters.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/parameters.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/parameters.carbon // ============================================================================ // Parameter requires a thunk to be generated diff --git a/toolchain/lower/testdata/interop/cpp/return.carbon b/toolchain/lower/testdata/interop/cpp/function/import/return.carbon similarity index 99% rename from toolchain/lower/testdata/interop/cpp/return.carbon rename to toolchain/lower/testdata/interop/cpp/function/import/return.carbon index d142f6fa5d65..2c2079ab13ab 100644 --- a/toolchain/lower/testdata/interop/cpp/return.carbon +++ b/toolchain/lower/testdata/interop/cpp/function/import/return.carbon @@ -7,9 +7,9 @@ // // AUTOUPDATE // TIP: To test this file alone, run: -// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/return.carbon +// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/lower/testdata/interop/cpp/function/import/return.carbon // TIP: To dump output, run: -// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/return.carbon +// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/function/import/return.carbon // --- ints.h