mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
People seemed receptive [on #toolchain](https://discord.com/channels/655572317891461132/655578254970716160/1379196447827689553), so proceeding. For the two name conflicts, I've set it up so that there's a "foo.carbon" and "foo_with_prelude.carbon", to indicate that the no-prelude approach is preferred (with a shorter name). Note min_prelude will require a little more work/thought, I want to avoid adding `--custom-core` etc.
47 lines
1.9 KiB
Plaintext
47 lines
1.9 KiB
Plaintext
// 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
|
|
//
|
|
// TODO: Add ranges and switch to "--dump-sem-ir-ranges=only".
|
|
// EXTRA-ARGS: --no-prelude-import --dump-sem-ir-ranges=if-present
|
|
//
|
|
// 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: To dump output, run:
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/file_not_found.carbon
|
|
// CHECK:STDERR: fail_cpp_file_not_found.carbon.generated.cpp_imports.h:1: error: C++:
|
|
// CHECK:STDERR: fail_cpp_file_not_found.carbon.generated.cpp_imports.h:1:10: fatal error: 'not_found.h' file not found
|
|
// CHECK:STDERR: 1 | #include "not_found.h"
|
|
// CHECK:STDERR: | ^~~~~~~~~~~~~
|
|
// CHECK:STDERR: [CppInteropParseError]
|
|
|
|
// --- fail_cpp_file_not_found.carbon
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
// CHECK:STDERR: fail_cpp_file_not_found.carbon:[[@LINE+4]]:1: note: in `Cpp` import [InCppImport]
|
|
// CHECK:STDERR: import Cpp library "not_found.h";
|
|
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
// CHECK:STDERR:
|
|
import Cpp library "not_found.h";
|
|
|
|
// CHECK:STDOUT: --- fail_cpp_file_not_found.carbon
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: imports {
|
|
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
|
// CHECK:STDOUT: import Cpp//...
|
|
// CHECK:STDOUT: has_error
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|
|
// CHECK:STDOUT: file {
|
|
// CHECK:STDOUT: package: <namespace> = namespace [concrete] {
|
|
// CHECK:STDOUT: .Cpp = imports.%Cpp
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: %Cpp.import_cpp = import_cpp {
|
|
// CHECK:STDOUT: import Cpp "not_found.h"
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT: }
|
|
// CHECK:STDOUT:
|