Преглед изворни кода

Add a bit more structure to interop/cpp tests. (#7085)

Add import/ and export/ under function/. Move most top-level tests to a
new basics/ with subdirectories for `import` directives and `inline
Cpp`. Add subdirectory for primitive type handling. Move all `reverse/`
tests to somewhere else, typically under an `export/` directory.

I split two test files up: constexpr.carbon got split into var/ and
function/ pieces, and reverse/simple.carbon was inlined into
namespace/export.carbon. The rest are just simple renames.
Richard Smith пре 1 недеља
родитељ
комит
335d811b9f
54 измењених фајлова са 194 додато и 193 уклоњено
  1. 2 2
      toolchain/check/testdata/interop/cpp/basics/bad_flags.carbon
  2. 2 2
      toolchain/check/testdata/interop/cpp/basics/cpp_diagnostics.carbon
  3. 2 2
      toolchain/check/testdata/interop/cpp/basics/import/bad_import.carbon
  4. 2 2
      toolchain/check/testdata/interop/cpp/basics/import/cpp_namespace.carbon
  5. 2 2
      toolchain/check/testdata/interop/cpp/basics/import/fail_fuzzing.carbon
  6. 2 2
      toolchain/check/testdata/interop/cpp/basics/import/file_not_found.carbon
  7. 2 2
      toolchain/check/testdata/interop/cpp/basics/import/import.carbon
  8. 2 2
      toolchain/check/testdata/interop/cpp/basics/import/include.carbon
  9. 2 2
      toolchain/check/testdata/interop/cpp/basics/import/include_paths.carbon
  10. 2 2
      toolchain/check/testdata/interop/cpp/basics/import/multiple_imports.carbon
  11. 2 2
      toolchain/check/testdata/interop/cpp/basics/inline/decl.carbon
  12. 2 2
      toolchain/check/testdata/interop/cpp/basics/inline/import.carbon
  13. 2 2
      toolchain/check/testdata/interop/cpp/basics/inline/modules.carbon
  14. 2 2
      toolchain/check/testdata/interop/cpp/basics/unsupported_decl_type.carbon
  15. 2 2
      toolchain/check/testdata/interop/cpp/basics/unused_internal.carbon
  16. 2 2
      toolchain/check/testdata/interop/cpp/function/export/function.carbon
  17. 2 2
      toolchain/check/testdata/interop/cpp/function/export/thunk_ast.carbon
  18. 2 2
      toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon
  19. 2 2
      toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_direct.carbon
  20. 2 2
      toolchain/check/testdata/interop/cpp/function/import/class.carbon
  21. 6 55
      toolchain/check/testdata/interop/cpp/function/import/constexpr.carbon
  22. 2 2
      toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon
  23. 2 2
      toolchain/check/testdata/interop/cpp/function/import/default_arg.carbon
  24. 2 2
      toolchain/check/testdata/interop/cpp/function/import/extern_c.carbon
  25. 2 2
      toolchain/check/testdata/interop/cpp/function/import/full_semir.carbon
  26. 2 2
      toolchain/check/testdata/interop/cpp/function/import/function.carbon
  27. 2 2
      toolchain/check/testdata/interop/cpp/function/import/in_template.carbon
  28. 2 2
      toolchain/check/testdata/interop/cpp/function/import/inline.carbon
  29. 2 2
      toolchain/check/testdata/interop/cpp/function/import/multiple_too_few_args_calls.carbon
  30. 2 2
      toolchain/check/testdata/interop/cpp/function/import/overloads.carbon
  31. 2 2
      toolchain/check/testdata/interop/cpp/function/import/param_unsupported.carbon
  32. 2 2
      toolchain/check/testdata/interop/cpp/function/import/pointer.carbon
  33. 2 2
      toolchain/check/testdata/interop/cpp/function/import/qualified_param.carbon
  34. 2 2
      toolchain/check/testdata/interop/cpp/function/import/reference.carbon
  35. 2 2
      toolchain/check/testdata/interop/cpp/function/import/return.carbon
  36. 2 2
      toolchain/check/testdata/interop/cpp/function/import/struct.carbon
  37. 2 2
      toolchain/check/testdata/interop/cpp/function/import/template.carbon
  38. 2 2
      toolchain/check/testdata/interop/cpp/function/import/thunk_ast.carbon
  39. 2 2
      toolchain/check/testdata/interop/cpp/function/import/thunk_cpp26.carbon
  40. 2 2
      toolchain/check/testdata/interop/cpp/function/import/union.carbon
  41. 2 2
      toolchain/check/testdata/interop/cpp/function/import/variadic.carbon
  42. 2 2
      toolchain/check/testdata/interop/cpp/function/import/void_pointer.carbon
  43. 2 2
      toolchain/check/testdata/interop/cpp/macros/macros.carbon
  44. 27 0
      toolchain/check/testdata/interop/cpp/namespace/export.carbon
  45. 2 2
      toolchain/check/testdata/interop/cpp/operators/deref.carbon
  46. 2 2
      toolchain/check/testdata/interop/cpp/operators/operators.carbon
  47. 2 2
      toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.carbon
  48. 2 2
      toolchain/check/testdata/interop/cpp/primitive_types/fail_todo_arithmetic_types_unmapped.carbon
  49. 2 2
      toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon
  50. 2 2
      toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon
  51. 2 2
      toolchain/check/testdata/interop/cpp/primitive_types/void.carbon
  52. 2 2
      toolchain/check/testdata/interop/cpp/primitive_types/void_pointer.carbon
  53. 0 38
      toolchain/check/testdata/interop/cpp/reverse/simple.carbon
  54. 61 0
      toolchain/check/testdata/interop/cpp/var/constexpr.carbon

+ 2 - 2
toolchain/check/testdata/interop/cpp/bad_flags.carbon → toolchain/check/testdata/interop/cpp/basics/bad_flags.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/check/testdata/interop/cpp/bad_flags.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/bad_flags.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/bad_flags.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/bad_flags.carbon
 // CHECK:STDERR: error: unable to read PCH file does_not_exist.pch: 'No such file or directory' [CppInteropParseError]
 // CHECK:STDERR:
 // CHECK:STDERR: error: PCH file 'does_not_exist.pch' not found: module file not found [CppInteropParseError]

+ 2 - 2
toolchain/check/testdata/interop/cpp/cpp_diagnostics.carbon → toolchain/check/testdata/interop/cpp/basics/cpp_diagnostics.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/cpp_diagnostics.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/cpp_diagnostics.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/cpp_diagnostics.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/cpp_diagnostics.carbon
 
 // ============================================================================
 // One error

+ 2 - 2
toolchain/check/testdata/interop/cpp/bad_import.carbon → toolchain/check/testdata/interop/cpp/basics/import/bad_import.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/bad_import.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/import/bad_import.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/bad_import.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/import/bad_import.carbon
 
 // --- fail_import_cpp_library_empty.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/cpp_namespace.carbon → toolchain/check/testdata/interop/cpp/basics/import/cpp_namespace.carbon

@@ -8,9 +8,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/cpp_namespace.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/import/cpp_namespace.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/cpp_namespace.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/import/cpp_namespace.carbon
 
 // --- header.h
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/fail_fuzzing.carbon → toolchain/check/testdata/interop/cpp/basics/import/fail_fuzzing.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/check/testdata/interop/cpp/fail_fuzzing.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/import/fail_fuzzing.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/fail_fuzzing.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/import/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";

+ 2 - 2
toolchain/check/testdata/interop/cpp/file_not_found.carbon → toolchain/check/testdata/interop/cpp/basics/import/file_not_found.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/file_not_found.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/import/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/file_not_found.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/import/file_not_found.carbon
 
 // --- fail_cpp_file_not_found.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/import.carbon → toolchain/check/testdata/interop/cpp/basics/import/import.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/import.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/import/import.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/import.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/import/import.carbon
 
 // ============================================================================
 // Import C++ namespace indirectly

+ 2 - 2
toolchain/check/testdata/interop/cpp/include.carbon → toolchain/check/testdata/interop/cpp/basics/import/include.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/include.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/import/include.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/include.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/import/include.carbon
 
 // --- included_file.h
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/include_paths.carbon → toolchain/check/testdata/interop/cpp/basics/import/include_paths.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/check/testdata/interop/cpp/include_paths.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/import/include_paths.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/include_paths.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/import/include_paths.carbon
 
 // --- include_stddef.h
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/multiple_imports.carbon → toolchain/check/testdata/interop/cpp/basics/import/multiple_imports.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/multiple_imports.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/import/multiple_imports.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/multiple_imports.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/import/multiple_imports.carbon
 
 // --- file1.h
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/inline_decl.carbon → toolchain/check/testdata/interop/cpp/basics/inline/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/check/testdata/interop/cpp/inline_decl.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/inline/decl.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/inline_decl.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/inline/decl.carbon
 
 // --- inline_decl.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/inline.carbon → toolchain/check/testdata/interop/cpp/basics/inline/import.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/inline.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/inline/import.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/inline.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/inline/import.carbon
 
 // --- use_inline_function_decl.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/modules.carbon → toolchain/check/testdata/interop/cpp/basics/inline/modules.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/check/testdata/interop/cpp/modules.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/inline/modules.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/modules.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/inline/modules.carbon
 
 // --- fail_export_module_in_inline_cpp.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/unsupported_decl_type.carbon → toolchain/check/testdata/interop/cpp/basics/unsupported_decl_type.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/unsupported_decl_type.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/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/unsupported_decl_type.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/unsupported_decl_type.carbon
 
 // --- structured_binding.h
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/unused_internal.carbon → toolchain/check/testdata/interop/cpp/basics/unused_internal.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/check/testdata/interop/cpp/unused_internal.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/unused_internal.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/unused_internal.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/unused_internal.carbon
 
 // --- unused.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/reverse/function.carbon → toolchain/check/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/check/testdata/interop/cpp/reverse/function.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/export/function.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/reverse/function.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/export/function.carbon
 
 // --- other.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/reverse/thunk_ast.carbon → toolchain/check/testdata/interop/cpp/function/export/thunk_ast.carbon

@@ -8,9 +8,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/reverse/thunk_ast.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/export/thunk_ast.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/reverse/thunk_ast.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/export/thunk_ast.carbon
 // CHECK:STDOUT: TranslationUnitDecl {{0x[a-f0-9]+}} <<invalid sloc>> <invalid sloc>
 // CHECK:STDOUT: |-NamespaceDecl {{0x[a-f0-9]+}} <<invalid sloc>> <invalid sloc> Carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon → toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.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/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/arithmetic_types_bridged.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_bridged.carbon
 
 // Tests for the case where we need a thunk when calling a C++ function from
 // Carbon, because the parameter and return types might have a non-trivial

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/arithmetic_types_direct.carbon → toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_direct.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/function/arithmetic_types_direct.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_direct.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/arithmetic_types_direct.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/arithmetic_types_direct.carbon
 
 // Tests for the case where we can directly call a C++ function from Carbon,
 // because the parameter and return types are known to have a sufficiently

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/class.carbon → toolchain/check/testdata/interop/cpp/function/import/class.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/function/class.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/class.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/class.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/class.carbon
 
 // ============================================================================
 // Forward-declared class as parameter type

+ 6 - 55
toolchain/check/testdata/interop/cpp/constexpr.carbon → toolchain/check/testdata/interop/cpp/function/import/constexpr.carbon

@@ -7,60 +7,11 @@
 //
 // AUTOUPDATE
 // TIP: To test this file alone, run:
-// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/constexpr.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/constexpr.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/constexpr.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/constexpr.carbon
 
-// --- bool.carbon
-
-library "[[@TEST_NAME]]";
-
-import Cpp inline '''
-constexpr bool b = true;
-''';
-
-class C(B:! bool) {}
-fn F() -> C(Cpp.b);
-let x: C(true) = F();
-
-// --- int.carbon
-
-library "[[@TEST_NAME]]";
-
-import Cpp inline '''
-constexpr int i = 123;
-''';
-
-class C(I:! i32) {}
-fn F() -> C(Cpp.i);
-let x: C(123) = F();
-
-// --- float.carbon
-
-library "[[@TEST_NAME]]";
-
-import Cpp inline '''
-constexpr float flt = 123.5;
-''';
-
-class C(V:! f32) {}
-fn F() -> C(Cpp.flt);
-let x: C(123.5) = F();
-
-// --- pointer.carbon
-
-library "[[@TEST_NAME]]";
-
-import Cpp inline '''
-int i = 123;
-constexpr int* _Nonnull ptr = &i;
-''';
-
-class C(V:! i32*) {}
-fn F() -> C(Cpp.ptr);
-let x: C(&Cpp.i) = F();
-
-// --- function.carbon
+// --- basic.carbon
 
 library "[[@TEST_NAME]]";
 
@@ -70,7 +21,7 @@ constexpr int f(int a, int b) { return a + b; }
 
 let a: array(i32, Cpp.f(1, 2)) = (1, 2, 3);
 
-// --- function_bool_param.carbon
+// --- bool_param.carbon
 
 library "[[@TEST_NAME]]";
 
@@ -82,7 +33,7 @@ constexpr int f(bool b) {
 
 let a: array(i32, Cpp.f(true)) = (1, 2, 3);
 
-// --- function_float_param.carbon
+// --- float_param.carbon
 
 library "[[@TEST_NAME]]";
 
@@ -94,7 +45,7 @@ constexpr int f(float b) {
 
 let a: array(i32, Cpp.f(3.0)) = (1, 2, 3);
 
-// --- function_return_bool.carbon
+// --- return_bool.carbon
 
 library "[[@TEST_NAME]]";
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/decayed_param.carbon → toolchain/check/testdata/interop/cpp/function/import/decayed_param.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/function/decayed_param.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/decayed_param.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/decayed_param.carbon
 
 // --- params.h
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/default_arg.carbon → toolchain/check/testdata/interop/cpp/function/import/default_arg.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/check/testdata/interop/cpp/function/default_arg.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/default_arg.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/default_arg.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/default_arg.carbon
 
 // --- functions.h
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/extern_c.carbon → toolchain/check/testdata/interop/cpp/function/import/extern_c.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/function/extern_c.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/extern_c.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/extern_c.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/extern_c.carbon
 
 // --- extern_c_function.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/full_semir.carbon → toolchain/check/testdata/interop/cpp/function/import/full_semir.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/check/testdata/interop/cpp/function/full_semir.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/full_semir.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/full_semir.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/full_semir.carbon
 
 // ============================================================================
 // Function with short parameter

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/function.carbon → toolchain/check/testdata/interop/cpp/function/import/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/check/testdata/interop/cpp/function/function.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/function.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/function.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/function.carbon
 
 // ============================================================================
 // Global

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/in_template.carbon → toolchain/check/testdata/interop/cpp/function/import/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/check/testdata/interop/cpp/function/in_template.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/in_template.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/in_template.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/in_template.carbon
 
 // --- class_template.h
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/inline.carbon → toolchain/check/testdata/interop/cpp/function/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/check/testdata/interop/cpp/function/inline.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/inline.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/inline.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/inline.carbon
 
 // ============================================================================
 // With definition

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/multiple_too_few_args_calls.carbon → toolchain/check/testdata/interop/cpp/function/import/multiple_too_few_args_calls.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/function/multiple_too_few_args_calls.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/multiple_too_few_args_calls.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/multiple_too_few_args_calls.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/multiple_too_few_args_calls.carbon
 
 // --- fail_call_too_few_args.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/overloads.carbon → toolchain/check/testdata/interop/cpp/function/import/overloads.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/check/testdata/interop/cpp/function/overloads.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/overloads.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/overloads.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/overloads.carbon
 
 // ============================================================================
 // Overloaded sets tests

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/param_unsupported.carbon → toolchain/check/testdata/interop/cpp/function/import/param_unsupported.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/function/param_unsupported.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/param_unsupported.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/param_unsupported.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/param_unsupported.carbon
 
 // ============================================================================
 // Unsupported primitive type

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/pointer.carbon → toolchain/check/testdata/interop/cpp/function/import/pointer.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/function/pointer.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/pointer.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/pointer.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/pointer.carbon
 
 // ============================================================================
 // Non-nullable pointer as a parameter type

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/qualified_param.carbon → toolchain/check/testdata/interop/cpp/function/import/qualified_param.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/function/qualified_param.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/qualified_param.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/qualified_param.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/qualified_param.carbon
 
 // --- qualifiers.h
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/reference.carbon → toolchain/check/testdata/interop/cpp/function/import/reference.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/function/reference.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/reference.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/reference.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/reference.carbon
 
 // ============================================================================
 // Lvalue reference as a parameter type

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/return.carbon → toolchain/check/testdata/interop/cpp/function/import/return.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/function/return.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/return.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/return.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/return.carbon
 
 // ============================================================================
 // Multiple function with a return value

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/struct.carbon → toolchain/check/testdata/interop/cpp/function/import/struct.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/function/struct.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/struct.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/struct.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/struct.carbon
 
 // ============================================================================
 // Forward-declared struct as parameter type

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/template.carbon → toolchain/check/testdata/interop/cpp/function/import/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/check/testdata/interop/cpp/function/template.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/template.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/template.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/template.carbon
 
 // --- deduced_or_explicit.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/thunk_ast.carbon → toolchain/check/testdata/interop/cpp/function/import/thunk_ast.carbon

@@ -8,9 +8,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/function/thunk_ast.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/thunk_ast.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/thunk_ast.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/thunk_ast.carbon
 // CHECK:STDOUT: TranslationUnitDecl {{0x[a-f0-9]+}} <<invalid sloc>> <invalid sloc>
 // CHECK:STDOUT: |-NamespaceDecl {{0x[a-f0-9]+}} <<invalid sloc>> <invalid sloc> Carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/thunk_cpp26.carbon → toolchain/check/testdata/interop/cpp/function/import/thunk_cpp26.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/check/testdata/interop/cpp/function/thunk_cpp26.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/thunk_cpp26.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/thunk_cpp26.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/thunk_cpp26.carbon
 
 // --- thunk_required.h
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/union.carbon → toolchain/check/testdata/interop/cpp/function/import/union.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/function/union.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/union.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/union.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/union.carbon
 
 // ============================================================================
 // Forward-declared union as parameter type

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/variadic.carbon → toolchain/check/testdata/interop/cpp/function/import/variadic.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/function/variadic.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/variadic.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/variadic.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/variadic.carbon
 
 // --- variadic.h
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/void_pointer.carbon → toolchain/check/testdata/interop/cpp/function/import/void_pointer.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/function/void_pointer.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/void_pointer.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/void_pointer.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/void_pointer.carbon
 
 // --- non_nullable_param.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/macros.carbon → toolchain/check/testdata/interop/cpp/macros/macros.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/macros.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/macros/macros.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/macros.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/macros/macros.carbon
 
 // ============================================================================
 // object-like macros

+ 27 - 0
toolchain/check/testdata/interop/cpp/namespace/export.carbon

@@ -10,6 +10,33 @@
 // TIP: To dump output, run:
 // TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/namespace/export.carbon
 
+// --- other.carbon
+package Other;
+namespace Nested;
+namespace Nested.Again;
+
+class Class1;
+// --- namespace.carbon
+
+library "[[@TEST_NAME]]";
+
+import Other;
+import Cpp inline '''
+namespace X = Carbon::Other;
+namespace Y = Carbon::Other::Nested;
+namespace Z = Carbon::Other::Nested::Again;
+Carbon::Other::Class1 *glbl;
+
+template<typename T> void f1() {
+  T* v;
+}
+
+void f2() {
+  f1<Carbon::Other::Class1>();
+}
+
+''';
+
 // --- alias_identity.carbon
 
 import Cpp;

+ 2 - 2
toolchain/check/testdata/interop/cpp/deref.carbon → toolchain/check/testdata/interop/cpp/operators/deref.carbon

@@ -8,9 +8,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/deref.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/operators/deref.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/deref.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/operators/deref.carbon
 
 // --- const_deref.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/function/operators.carbon → toolchain/check/testdata/interop/cpp/operators/operators.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/check/testdata/interop/cpp/function/operators.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/operators/operators.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/operators.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/operators/operators.carbon
 
 // ============================================================================
 // Unary operators

+ 2 - 2
toolchain/check/testdata/interop/cpp/builtins.carbon → toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.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/builtins.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/builtins.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/primitive_types/arithmetic.carbon
 
 // --- supported_types.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/fail_todo_arithmetic_types_unmapped.carbon → toolchain/check/testdata/interop/cpp/primitive_types/fail_todo_arithmetic_types_unmapped.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/check/testdata/interop/cpp/fail_todo_arithmetic_types_unmapped.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/primitive_types/fail_todo_arithmetic_types_unmapped.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/fail_todo_arithmetic_types_unmapped.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/primitive_types/fail_todo_arithmetic_types_unmapped.carbon
 
 // Ensure we get a diagnostic when using a type that doesn't yet have a mapping
 // from C++ to Carbon.

+ 2 - 2
toolchain/check/testdata/interop/cpp/builtins.llp64.carbon → toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.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/check/testdata/interop/cpp/builtins.llp64.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/builtins.llp64.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.llp64.carbon
 
 // --- long_long.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/builtins.lp64.carbon → toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.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/check/testdata/interop/cpp/builtins.lp64.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/builtins.lp64.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/primitive_types/long_and_long_long.lp64.carbon
 
 // --- long.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/void.carbon → toolchain/check/testdata/interop/cpp/primitive_types/void.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/void.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/primitive_types/void.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/void.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/primitive_types/void.carbon
 
 // --- void_not_incomplete.carbon
 

+ 2 - 2
toolchain/check/testdata/interop/cpp/void_pointer.carbon → toolchain/check/testdata/interop/cpp/primitive_types/void_pointer.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/void_pointer.carbon
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/primitive_types/void_pointer.carbon
 // TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/void_pointer.carbon
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/primitive_types/void_pointer.carbon
 
 // --- implicit_as_from_cpp_class_pointer_to_void_pointer.carbon
 

+ 0 - 38
toolchain/check/testdata/interop/cpp/reverse/simple.carbon

@@ -1,38 +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
-//
-// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
-//
-// AUTOUPDATE
-// TIP: To test this file alone, run:
-// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/reverse/simple.carbon
-// TIP: To dump output, run:
-// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/reverse/simple.carbon
-
-// --- other.carbon
-package Other;
-namespace Nested;
-namespace Nested.Again;
-
-class Class1;
-// --- namespace.carbon
-
-library "[[@TEST_NAME]]";
-
-import Other;
-import Cpp inline '''
-namespace X = Carbon::Other;
-namespace Y = Carbon::Other::Nested;
-namespace Z = Carbon::Other::Nested::Again;
-Carbon::Other::Class1 *glbl;
-
-template<typename T> void f1() {
-  T* v;
-}
-
-void f2() {
-  f1<Carbon::Other::Class1>();
-}
-
-''';

+ 61 - 0
toolchain/check/testdata/interop/cpp/var/constexpr.carbon

@@ -0,0 +1,61 @@
+// 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
+//
+// INCLUDE-FILE: toolchain/testing/testdata/min_prelude/full.carbon
+// EXTRA-ARGS: --clang-arg=--std=c++20
+//
+// AUTOUPDATE
+// TIP: To test this file alone, run:
+// TIP:   bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/var/constexpr.carbon
+// TIP: To dump output, run:
+// TIP:   bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/var/constexpr.carbon
+
+// --- bool.carbon
+
+library "[[@TEST_NAME]]";
+
+import Cpp inline '''
+constexpr bool b = true;
+''';
+
+class C(B:! bool) {}
+fn F() -> C(Cpp.b);
+let x: C(true) = F();
+
+// --- int.carbon
+
+library "[[@TEST_NAME]]";
+
+import Cpp inline '''
+constexpr int i = 123;
+''';
+
+class C(I:! i32) {}
+fn F() -> C(Cpp.i);
+let x: C(123) = F();
+
+// --- float.carbon
+
+library "[[@TEST_NAME]]";
+
+import Cpp inline '''
+constexpr float flt = 123.5;
+''';
+
+class C(V:! f32) {}
+fn F() -> C(Cpp.flt);
+let x: C(123.5) = F();
+
+// --- pointer.carbon
+
+library "[[@TEST_NAME]]";
+
+import Cpp inline '''
+int i = 123;
+constexpr int* _Nonnull ptr = &i;
+''';
+
+class C(V:! i32*) {}
+fn F() -> C(Cpp.ptr);
+let x: C(&Cpp.i) = F();