file_not_found.carbon 1.3 KB

123456789101112131415161718192021222324252627282930
  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. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/file_not_found.carbon
  10. // --- fail_cpp_file_not_found.carbon
  11. library "[[@TEST_NAME]]";
  12. // CHECK:STDERR: fail_cpp_file_not_found.carbon:[[@LINE+8]]:1: error: 1 error and 0 warnings in 1 `Cpp` import:
  13. // CHECK:STDERR: fail_cpp_file_not_found.carbon.generated.cpp_imports.h:1:10: fatal error: 'not_found.h' file not found
  14. // CHECK:STDERR: 1 | #include "not_found.h"
  15. // CHECK:STDERR: | ^~~~~~~~~~~~~
  16. // CHECK:STDERR: [CppInteropParseError]
  17. // CHECK:STDERR: import Cpp library "not_found.h";
  18. // CHECK:STDERR: ^~~~~~
  19. // CHECK:STDERR:
  20. import Cpp library "not_found.h";
  21. // CHECK:STDOUT: --- fail_cpp_file_not_found.carbon
  22. // CHECK:STDOUT:
  23. // CHECK:STDOUT: file {
  24. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  25. // CHECK:STDOUT: }
  26. // CHECK:STDOUT: