forked from carbon-language/carbon-lang
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow defining .h files in tests without trying to compile them as Ca…
…rbon files (carbon-language#4667) This would be used to test interop with C++. carbon-language#4666
- Loading branch information
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
toolchain/check/testdata/interop/cpp/no_prelude/test_support.carbon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// 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 | ||
// | ||
// AUTOUPDATE | ||
// TIP: To test this file alone, run: | ||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/no_prelude/test_support.carbon | ||
// TIP: To dump output, run: | ||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/no_prelude/test_support.carbon | ||
|
||
// --- cpp_file.h | ||
|
||
void foo(); | ||
|
||
// --- carbon_file.carbon | ||
|
||
library "[[@TEST_NAME]]"; | ||
|
||
// CHECK:STDOUT: --- carbon_file.carbon | ||
// CHECK:STDOUT: | ||
// CHECK:STDOUT: file { | ||
// CHECK:STDOUT: package: <namespace> = namespace [template] {} | ||
// CHECK:STDOUT: } | ||
// CHECK:STDOUT: |