include.carbon 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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. // INCLUDE-FILE: toolchain/testing/testdata/min_prelude/none.carbon
  6. //
  7. // AUTOUPDATE
  8. // TIP: To test this file alone, run:
  9. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/basics/import/include.carbon
  10. // TIP: To dump output, run:
  11. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/basics/import/include.carbon
  12. // --- included_file.h
  13. void foo();
  14. // --- including_file.h
  15. #include "included_file.h"
  16. // --- import_function_decl.carbon
  17. library "[[@TEST_NAME]]";
  18. //@dump-sem-ir-begin
  19. import Cpp library "including_file.h";
  20. //@dump-sem-ir-end
  21. // CHECK:STDOUT: --- import_function_decl.carbon
  22. // CHECK:STDOUT:
  23. // CHECK:STDOUT: file {
  24. // CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
  25. // CHECK:STDOUT: import Cpp "including_file.h"
  26. // CHECK:STDOUT: }
  27. // CHECK:STDOUT: }
  28. // CHECK:STDOUT: