multiple_imports.carbon 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
  6. // EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present
  7. //
  8. // AUTOUPDATE
  9. // TIP: To test this file alone, run:
  10. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/multiple_imports.carbon
  11. // TIP: To dump output, run:
  12. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/multiple_imports.carbon
  13. // --- file1.h
  14. void foo1();
  15. // --- file2.h
  16. void foo1();
  17. // --- multiple_imports.carbon
  18. library "[[@TEST_NAME]]";
  19. import Cpp library "file1.h";
  20. import Cpp library "file2.h";
  21. // CHECK:STDOUT: --- multiple_imports.carbon
  22. // CHECK:STDOUT:
  23. // CHECK:STDOUT: imports {
  24. // CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
  25. // CHECK:STDOUT: import Cpp//...
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT: }
  28. // CHECK:STDOUT:
  29. // CHECK:STDOUT: file {
  30. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  31. // CHECK:STDOUT: .Cpp = imports.%Cpp
  32. // CHECK:STDOUT: }
  33. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  34. // CHECK:STDOUT: import Cpp "file1.h"
  35. // CHECK:STDOUT: import Cpp "file2.h"
  36. // CHECK:STDOUT: }
  37. // CHECK:STDOUT: }
  38. // CHECK:STDOUT: