mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-15 10:18:29 +00:00
Render diagnostics through the terminal library (#7683)
Diagnostic rendering was part of the data model: `Loc::FormatLocation` and `Loc::FormatSnippet` wrote plain text to a stream, so no capability, color, or terminal width could reach them. A diagnostic is now one message with labels, contexts, and location information attached, and `Diagnostics::Renderer` draws it into a `Terminal::Buffer`. The design is in `toolchain/docs/diagnostics_rendering.md` (#7668), authoring in `toolchain/docs/diagnostics.md`. Before: ``` example.carbon:6:3: error: 1 argument passed to function expecting 0 arguments Run0(1); ^~~~~~~ example.carbon:3:1: note: calling function declared here fn Run0() {} ^~~~~~~~~~~ ``` After: ``` error: 1 argument passed to function expecting 0 arguments ╭─┤ example.carbon:6:3 ┆ 3 │ fn Run0() {} · ─────┬───── · ╰──┤ calling function declared here ┆ -> 6 │ Run0(1); · ─────── ╰──────────── ``` `--no-diagnostic-snippets` gives a compact form, `example.carbon:6:3-9`. File tests use it; the rendering tests under `toolchain/diagnostics/testdata` ask for snippets. C++ interop diagnostics are data now rather than text Clang drew: `SemIR::ClangSourceLocId` names a `clang::SourceRange`, and a Clang location is marked as the point it names. `StreamConsumer` moves to a `:renderer` target that `:emitter` does not depend on, keeping `common/terminal` out of `consumer.h`. Capabilities come from the file behind the error stream, so tests get plain ASCII. `renderer_fuzzer` draws diagnostics built from fuzzer bytes with every capability combination, since a shape the renderer doesn't expect must never be why the compiler dies while reporting a problem. TODOs mark the follow-ups: line weights and crossing lines, wrapping that keeps a quoted type whole, and ordering diagnostics that share a byte offset. Also: `IncorrectExtension`'s hint moves into its message, since its note had no location of its own, and `strip_noise` in `check_diagnostics.py` blanks multi-line `#define`s instead of deleting them. Assisted-by: Claude Code
This commit is contained in:
1 parent
e1c8c1f855
commit
2c9739799b
1205 files changed
+20291
-24988
No files matched your search
@@ -43,33 +43,21 @@ import Cpp;
|
||||
// HLSL extension, or by mapping to a `std::array` parameter.
|
||||
|
||||
// TODO: These diagnostics are very bad.
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+8]]:1: error: semantics TODO: `by-var array parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+4]]:1-48: error: semantics TODO: `by-var array parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+4]]:1: error: semantics TODO: `failed to map C++ type to Carbon` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+2]]:1-48: error: semantics TODO: `failed to map C++ type to Carbon` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
|
||||
inline Cpp '''
|
||||
int GArrayVarParam() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+15]]:10: error: no member named 'FArrayVarParam' in namespace 'Carbon'; did you mean 'GArrayVarParam'? [CppInteropParseError]
|
||||
// CHECK:STDERR: 39 | return Carbon::FArrayVarParam({1, 2, 3, 4, 5});
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: | GArrayVarParam
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE-6]]:5: note: 'GArrayVarParam' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 22 | int GArrayVarParam() {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+7]]:10: error: no member named 'FArrayVarParam' in namespace 'Carbon'; did you mean 'GArrayVarParam'? [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+6]]:10-31: note: replace with `GArrayVarParam` [CppInteropFixItReplacement]
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE-4]]:5: note: 'GArrayVarParam' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+7]]:33: error: too many arguments to function call, expected 0, have 1 [CppInteropParseError]
|
||||
// CHECK:STDERR: 39 | return Carbon::FArrayVarParam({1, 2, 3, 4, 5});
|
||||
// CHECK:STDERR: | ~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE-13]]:5: note: 'GArrayVarParam' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 22 | int GArrayVarParam() {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+3]]:33-47: error: too many arguments to function call, expected 0, have 1 [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE-7]]:5: note: 'GArrayVarParam' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
return Carbon::FArrayVarParam({1, 2, 3, 4, 5});
|
||||
//@dump-sem-ir-end
|
||||
@@ -85,9 +73,7 @@ import Cpp;
|
||||
// types, as C++ does not have such return types.
|
||||
// TODO: Support this, perhaps by returning a `std::array`.
|
||||
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+4]]:1: error: semantics TODO: `array return type` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn FArrayReturn() -> array(i32, 5) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+2]]:1-36: error: semantics TODO: `array return type` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn FArrayReturn() -> array(i32, 5) {
|
||||
return (1, 2, 3, 4, 5);
|
||||
@@ -95,18 +81,12 @@ fn FArrayReturn() -> array(i32, 5) {
|
||||
|
||||
inline Cpp '''
|
||||
int GArrayReturn() {
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+8]]:16: error: no member named 'FArrayReturn' in namespace 'Carbon'; did you mean 'GArrayReturn'? [CppInteropParseError]
|
||||
// CHECK:STDERR: 27 | auto &&arr = Carbon::FArrayReturn();
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: | GArrayReturn
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE-5]]:5: note: 'GArrayReturn' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 18 | int GArrayReturn() {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+4]]:16: error: no member named 'FArrayReturn' in namespace 'Carbon'; did you mean 'GArrayReturn'? [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+3]]:16-35: note: replace with `GArrayReturn` [CppInteropFixItReplacement]
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE-3]]:5: note: 'GArrayReturn' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
auto &&arr = Carbon::FArrayReturn();
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+4]]:13: error: subscripted value is not an array, pointer, or vector [CppInteropParseError]
|
||||
// CHECK:STDERR: 32 | return arr[0];
|
||||
// CHECK:STDERR: | ~~~^~
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+2]]:13: error: subscripted value is not an array, pointer, or vector [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
return arr[0];
|
||||
}
|
||||
|
||||
@@ -36,18 +36,10 @@ class FactoryIsMethod {
|
||||
|
||||
inline Cpp '''
|
||||
void CallFactoryIsMethod() {
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE+13]]:27: error: no matching constructor for initialization of 'Carbon::FactoryIsMethod' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::FactoryIsMethod a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-9]]:23: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryIsMethod' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryIsMethod {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-12]]:23: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryIsMethod' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryIsMethod {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-15]]:23: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryIsMethod {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE+5]]:27: error: no matching constructor for initialization of 'Carbon::FactoryIsMethod' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-7]]:23: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryIsMethod' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-8]]:23: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryIsMethod' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-9]]:23: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::FactoryIsMethod a(42);
|
||||
}
|
||||
@@ -64,18 +56,10 @@ class FactoryDoesntReturnSelf {
|
||||
|
||||
inline Cpp '''
|
||||
void CallFactoryDoesntReturnSelf() {
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE+13]]:35: error: no matching constructor for initialization of 'Carbon::FactoryDoesntReturnSelf' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::FactoryDoesntReturnSelf a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-9]]:31: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryDoesntReturnSelf' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryDoesntReturnSelf {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-12]]:31: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryDoesntReturnSelf' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryDoesntReturnSelf {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-15]]:31: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryDoesntReturnSelf {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE+5]]:35: error: no matching constructor for initialization of 'Carbon::FactoryDoesntReturnSelf' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-7]]:31: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryDoesntReturnSelf' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-8]]:31: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryDoesntReturnSelf' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-9]]:31: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::FactoryDoesntReturnSelf a(42);
|
||||
}
|
||||
@@ -92,18 +76,10 @@ class FactoryReturnsByRef {
|
||||
|
||||
inline Cpp '''
|
||||
void CallFactoryReturnsByRef() {
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE+13]]:31: error: no matching constructor for initialization of 'Carbon::FactoryReturnsByRef' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::FactoryReturnsByRef a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-9]]:27: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryReturnsByRef' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryReturnsByRef {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-12]]:27: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryReturnsByRef' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryReturnsByRef {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-15]]:27: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class FactoryReturnsByRef {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE+5]]:31: error: no matching constructor for initialization of 'Carbon::FactoryReturnsByRef' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-7]]:27: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const FactoryReturnsByRef' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-8]]:27: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'FactoryReturnsByRef' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-9]]:27: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::FactoryReturnsByRef a(42);
|
||||
}
|
||||
@@ -115,9 +91,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
class GenericConstructor {
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE+4]]:3: error: semantics TODO: `support exporting generic member functions` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn GenericConstructor[T: type](_: T) -> Self {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE+2]]:3-48: error: semantics TODO: `support exporting generic member functions` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn GenericConstructor[T: type](_: T) -> Self {
|
||||
return {};
|
||||
@@ -126,18 +100,10 @@ class GenericConstructor {
|
||||
|
||||
inline Cpp '''
|
||||
void CallGenericConstructor() {
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE+13]]:30: error: no matching constructor for initialization of 'Carbon::GenericConstructor' [CppInteropParseError]
|
||||
// CHECK:STDERR: 30 | Carbon::GenericConstructor b(0);
|
||||
// CHECK:STDERR: | ^ ~
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-15]]:26: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const GenericConstructor' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericConstructor {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-18]]:26: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'GenericConstructor' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericConstructor {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-21]]:26: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericConstructor {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE+5]]:30: error: no matching constructor for initialization of 'Carbon::GenericConstructor' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-11]]:26: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const GenericConstructor' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-12]]:26: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'GenericConstructor' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_todo_call_generic_constructor.carbon:[[@LINE-13]]:26: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::GenericConstructor b(0);
|
||||
}
|
||||
@@ -149,9 +115,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
class GenericClass(T: type) {
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE+4]]:3: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn GenericClass(_: T) -> Self {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE+2]]:3-33: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn GenericClass(_: T) -> Self {
|
||||
return {};
|
||||
@@ -160,18 +124,10 @@ class GenericClass(T: type) {
|
||||
|
||||
inline Cpp '''
|
||||
void CallGenericClass() {
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE+13]]:29: error: no matching constructor for initialization of 'Carbon::GenericClass<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR: 30 | Carbon::GenericClass<int> c(0);
|
||||
// CHECK:STDERR: | ^ ~
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-15]]:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const GenericClass<int>' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericClass(T: type) {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-18]]:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'GenericClass<int>' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericClass(T: type) {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-21]]:29: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class GenericClass(T: type) {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE+5]]:29: error: no matching constructor for initialization of 'Carbon::GenericClass<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-11]]:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const GenericClass<int>' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-12]]:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'GenericClass<int>' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_todo_call_generic_class_constructor.carbon:[[@LINE-13]]:29: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::GenericClass<int> c(0);
|
||||
}
|
||||
|
||||
@@ -95,14 +95,9 @@ fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_generic.carbon:[[@LINE+9]]:1: in import [InImport]
|
||||
// CHECK:STDERR: other_generic.carbon:3:1: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_generic.carbon:[[@LINE+5]]:1: in import [InImport]
|
||||
// CHECK:STDERR: other_generic.carbon:3:1: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR: fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: imported from: fail_todo_generic.carbon:[[@LINE+4]]:1 [InImport]
|
||||
// CHECK:STDERR: other_generic.carbon:3:1-41: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: other_generic.carbon:3:1-41: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
import OtherGeneric;
|
||||
import Cpp inline '''
|
||||
|
||||
@@ -52,21 +52,15 @@ Carbon::B CallInterfaceF() {
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+4]]:1: error: semantics TODO: `binding maps to a non-type template parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn NonTypeF[unused N: i32]() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+2]]:1-30: error: semantics TODO: `binding maps to a non-type template parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn NonTypeF[unused N: i32]() {}
|
||||
|
||||
inline Cpp '''
|
||||
void CallNonTypeF() {
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+8]]:11: error: no member named 'NonTypeF' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::NonTypeF<3>();
|
||||
// CHECK:STDERR: | ^~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+4]]:11-18: error: no member named 'NonTypeF' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+4]]:23: error: expected expression [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::NonTypeF<3>();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+2]]:23: error: expected expression [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
Carbon::NonTypeF<3>();
|
||||
}
|
||||
@@ -91,9 +85,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
class EnclosingA(T: type) {
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+4]]:3: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn MemberF[U: type](x: T, y: U);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+2]]:3-34: error: semantics TODO: `non-class non-namespace name scope` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn MemberF[U: type](x: T, y: U);
|
||||
}
|
||||
@@ -105,9 +97,7 @@ void CallEnclosingF() {
|
||||
// is to test a generic function within an enclosing generic scope.
|
||||
//
|
||||
Carbon::EnclosingB b;
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+4]]:5: error: no member named 'MemberF' in 'Carbon::EnclosingA<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR: 23 | b.MemberF(1, 2);
|
||||
// CHECK:STDERR: | ~ ^
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+2]]:5: error: no member named 'MemberF' in 'Carbon::EnclosingA<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR:
|
||||
b.MemberF(1, 2);
|
||||
}
|
||||
@@ -117,21 +107,15 @@ void CallEnclosingF() {
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+4]]:1: error: semantics TODO: `failed to import C++ type` [SemanticsTodo]
|
||||
// CHECK:STDERR: fn UnsupportedF[T: type](unused t: T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+2]]:1-39: error: semantics TODO: `failed to import C++ type` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
fn UnsupportedF[T: type](unused t: T) {}
|
||||
|
||||
inline Cpp '''
|
||||
void CallUnsupportedF() {
|
||||
volatile int x;
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+7]]:3: error: no matching function for call to 'UnsupportedF' [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::UnsupportedF(x);
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE-8]]:39: note: candidate template ignored: substitution failure [with T = volatile int] [CppInteropParseNote]
|
||||
// CHECK:STDERR: 8 | fn UnsupportedF[T: type](unused t: T) {}
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+3]]:3-22: error: no matching function for call to 'UnsupportedF' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE-6]]:39: note: candidate template ignored: substitution failure [with T = volatile int] [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Carbon::UnsupportedF(x);
|
||||
}
|
||||
|
||||
+19
-43
@@ -123,9 +123,7 @@ import Cpp library "wchar_t_param.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_wchar_t_param.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: wchar_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo('X');
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_wchar_t_param.carbon:[[@LINE+2]]:3-14: error: semantics TODO: `Unsupported: parameter type: wchar_t` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo('X');
|
||||
//@dump-sem-ir-end
|
||||
@@ -143,10 +141,8 @@ auto foo(char8_t c) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_import_char8_t_param.carbon:[[@LINE+5]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_todo_import_char8_t_param.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./char8_t_param.h:2:10: error: unknown type name 'char8_t' [CppInteropParseError]
|
||||
// CHECK:STDERR: 2 | auto foo(char8_t c) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
import Cpp library "char8_t_param.h";
|
||||
|
||||
@@ -172,9 +168,7 @@ import Cpp library "char16_t_param.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_char16_t_param.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: char16_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo(1);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_char16_t_param.carbon:[[@LINE+2]]:3-12: error: semantics TODO: `Unsupported: parameter type: char16_t` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1);
|
||||
//@dump-sem-ir-end
|
||||
@@ -196,9 +190,7 @@ import Cpp library "char32_t_param.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_char32_t_param.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: char32_t` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo(1);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_char32_t_param.carbon:[[@LINE+2]]:3-12: error: semantics TODO: `Unsupported: parameter type: char32_t` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1);
|
||||
//@dump-sem-ir-end
|
||||
@@ -242,13 +234,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "short_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_max.carbon:[[@LINE+8]]:11: error: integer value 32768 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(0x8000);
|
||||
// CHECK:STDERR: ^~~~~~
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_max.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_max.carbon:[[@LINE+4]]:11-16: error: integer value 32768 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_short_param_overflow_max.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./short_param.h:2:16: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(short a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(0x8000);
|
||||
}
|
||||
@@ -272,13 +260,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "short_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_min.carbon:[[@LINE+8]]:11: error: integer value -32769 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(-0x8001);
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_min.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_short_param_overflow_min.carbon:[[@LINE+4]]:11-17: error: integer value -32769 too large for type `i16` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_short_param_overflow_min.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./short_param.h:2:16: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(short a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(-0x8001);
|
||||
}
|
||||
@@ -290,16 +274,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "short_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+11]]:11: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+8]]:11: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+5]]:11-18: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_import_short_param_int32_arg.carbon:[[@LINE+4]]:11-18: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_import_short_param_int32_arg.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./short_param.h:2:16: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(short a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1 as i32);
|
||||
}
|
||||
@@ -527,9 +505,7 @@ import Cpp library "bit_int_24_param.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_bit_int_24_param.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: bit_int_24` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo(1);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_bit_int_24_param.carbon:[[@LINE+2]]:3-12: error: semantics TODO: `Unsupported: parameter type: bit_int_24` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1);
|
||||
//@dump-sem-ir-end
|
||||
@@ -1168,7 +1144,7 @@ fn F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc12: Core.CharLiteral = char_value U+0058 [concrete = constants.%.d16]
|
||||
// CHECK:STDOUT: %.loc10: Core.CharLiteral = char_value U+0058 [concrete = constants.%.d16]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -1221,13 +1197,13 @@ fn F() {
|
||||
// CHECK:STDOUT: %foo.ref: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %impl.elem0: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc13_11.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc11_11.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc13_11.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc13_11.2(%int_1) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc13_11.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc13_11.2: %i32 = converted %int_1, %.loc13_11.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc13_11.2)
|
||||
// CHECK:STDOUT: %bound_method.loc11_11.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc11_11.2(%int_1) [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc11_11.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %.loc11_11.2: %i32 = converted %int_1, %.loc11_11.1 [concrete = constants.%int_1.68a]
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11_11.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+8
-24
@@ -54,13 +54,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "int_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_max.carbon:[[@LINE+8]]:11: error: integer value 2147483648 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(0x8000_0000);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_max.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_max.carbon:[[@LINE+4]]:11-21: error: integer value 2147483648 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_int_param_overflow_max.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_param.h:2:14: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(0x8000_0000);
|
||||
}
|
||||
@@ -84,13 +80,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "int_param.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_min.carbon:[[@LINE+8]]:11: error: integer value -2147483649 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(-0x8000_0001);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_min.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_int_param_overflow_min.carbon:[[@LINE+4]]:11-22: error: integer value -2147483649 too large for type `i32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_int_param_overflow_min.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_param.h:2:14: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(-0x8000_0001);
|
||||
}
|
||||
@@ -164,25 +156,17 @@ import Cpp library "unsigned_int_param.h";
|
||||
fn F() {
|
||||
Cpp.foo(0);
|
||||
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+8]]:11: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: Cpp.foo(-1);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+4]]:11-12: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: included from: fail_import_unsigned_int_param_overflow.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./unsigned_int_param.h:2:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(-1);
|
||||
|
||||
Cpp.foo(0x0_FFFF_FFFF);
|
||||
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+8]]:11: error: integer value 4294967296 too large for type `u32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(0x1_0000_0000);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE-20]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_unsigned_int_param_overflow.carbon:[[@LINE+4]]:11-23: error: integer value 4294967296 too large for type `u32` [IntTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_unsigned_int_param_overflow.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./unsigned_int_param.h:2:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(0x1_0000_0000);
|
||||
}
|
||||
|
||||
+30
-119
@@ -25,57 +25,29 @@ auto foo_decl_param2(ForwardDeclaredClass) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6: error: argument type 'ForwardDeclaredClass' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_param1(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6-20: error: argument type 'ForwardDeclaredClass' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: forward declaration of 'ForwardDeclaredClass' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_param_type.h";
|
||||
|
||||
fn F(p: Cpp.ForwardDeclaredClass*) {
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_decl_param1(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:3-25: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6: error: argument type 'ForwardDeclaredClass' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 5 | auto foo_decl_param2(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-11]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6-20: error: argument type 'ForwardDeclaredClass' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: forward declaration of 'ForwardDeclaredClass' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: | ^
|
||||
Cpp.foo_decl_param1(*p);
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+28]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_decl_param2(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3-25: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-5]]:23: error: forming value of incomplete type `Cpp.ForwardDeclaredClass` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo_decl_param1(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-23]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-3]]:23-24: error: forming value of incomplete type `Cpp.ForwardDeclaredClass` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:42: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo_decl_param1(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:23: error: forming value of incomplete type `Cpp.ForwardDeclaredClass` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo_decl_param2(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-35]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:23-24: error: forming value of incomplete type `Cpp.ForwardDeclaredClass` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-17]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class ForwardDeclaredClass;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-39]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:42: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo_decl_param2(ForwardDeclaredClass) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_decl_param2(*p);
|
||||
}
|
||||
@@ -118,25 +90,15 @@ auto foo_non_copyable_param(NonCopyableClass) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:6: error: call to deleted constructor of 'NonCopyableClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 6 | auto foo_non_copyable_param(NonCopyableClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_non_copyable_param_type.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:6-27: error: call to deleted constructor of 'NonCopyableClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:3:3: note: 'NonCopyableClass' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | NonCopyableClass(const NonCopyableClass&) = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:45: note: passing argument to parameter here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | auto foo_non_copyable_param(NonCopyableClass) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "non_copyable_param_type.h";
|
||||
|
||||
fn F(c: Cpp.NonCopyableClass) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+4]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_non_copyable_param(c);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+2]]:3-31: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_non_copyable_param(c);
|
||||
//@dump-sem-ir-end
|
||||
@@ -172,24 +134,14 @@ fn F() {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_pass_move_only_param_value.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_move_only_param_value.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_pass_move_only_param_value.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6-24: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:3:3: note: copy constructor is implicitly deleted because 'MoveOnlyClass' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | MoveOnlyClass(MoveOnlyClass&&);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_pass_move_only_param_value.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:39: note: passing argument to parameter here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "move_only_param_type.h";
|
||||
|
||||
fn F(c: Cpp.MoveOnlyClass) {
|
||||
// CHECK:STDERR: fail_pass_move_only_param_value.carbon:[[@LINE+4]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_move_only_param(c);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_move_only_param_value.carbon:[[@LINE+2]]:3-28: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_move_only_param(c);
|
||||
}
|
||||
@@ -198,24 +150,14 @@ fn F(c: Cpp.MoveOnlyClass) {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_pass_move_only_param_ref.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_move_only_param_ref.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_pass_move_only_param_ref.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6-24: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:3:3: note: copy constructor is implicitly deleted because 'MoveOnlyClass' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | MoveOnlyClass(MoveOnlyClass&&);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_pass_move_only_param_ref.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:39: note: passing argument to parameter here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "move_only_param_type.h";
|
||||
|
||||
fn F(ref c: Cpp.MoveOnlyClass) {
|
||||
// CHECK:STDERR: fail_pass_move_only_param_ref.carbon:[[@LINE+4]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_move_only_param(c);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_move_only_param_ref.carbon:[[@LINE+2]]:3-28: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_move_only_param(c);
|
||||
}
|
||||
@@ -224,24 +166,14 @@ fn F(ref c: Cpp.MoveOnlyClass) {
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_pass_move_only_param_ref_by_move.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_pass_move_only_param_ref_by_move.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_todo_pass_move_only_param_ref_by_move.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:6-24: error: call to implicitly-deleted copy constructor of 'MoveOnlyClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:3:3: note: copy constructor is implicitly deleted because 'MoveOnlyClass' has a user-declared move constructor [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | MoveOnlyClass(MoveOnlyClass&&);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_pass_move_only_param_ref_by_move.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./move_only_param_type.h:6:39: note: passing argument to parameter here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | auto foo_move_only_param(MoveOnlyClass) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "move_only_param_type.h";
|
||||
|
||||
fn F(ref c: Cpp.MoveOnlyClass) {
|
||||
// CHECK:STDERR: fail_todo_pass_move_only_param_ref_by_move.carbon:[[@LINE+4]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_move_only_param(Cpp.move_move_only(ref c));
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_pass_move_only_param_ref_by_move.carbon:[[@LINE+2]]:3-52: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_move_only_param(Cpp.move_move_only(ref c));
|
||||
}
|
||||
@@ -427,13 +359,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+8]]:3: error: member access into incomplete class `Cpp.Incomplete` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: Cpp.Incomplete.foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+4]]:3-20: error: member access into incomplete class `Cpp.Incomplete` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: included from: fail_import_incomplete.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Incomplete;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.Incomplete.foo();
|
||||
}
|
||||
@@ -496,36 +424,19 @@ auto foo_decl_value_return() -> DeclValueReturnClass;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: error: calling 'foo_decl_value_return' with incomplete return type 'DeclValueReturnClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_value_return() -> DeclValueReturnClass;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_return_type.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6-26: error: calling 'foo_decl_value_return' with incomplete return type 'DeclValueReturnClass' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: note: 'foo_decl_value_return' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_value_return() -> DeclValueReturnClass;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:7: note: forward declaration of 'DeclValueReturnClass' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | class DeclValueReturnClass;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_return_type.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+16]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+7]]:3-29: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+12]]:3: error: function returns incomplete type `Cpp.DeclValueReturnClass` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+5]]:3-29: error: function returns incomplete type `Cpp.DeclValueReturnClass` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_return_type.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class DeclValueReturnClass;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:33: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: auto foo_decl_value_return() -> DeclValueReturnClass;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_decl_value_return();
|
||||
}
|
||||
@@ -664,7 +575,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%c.param: %NonCopyableClass) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc24: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo_non_copyable_param.ref: %foo_non_copyable_param.cpp_overload_set.type = name_ref foo_non_copyable_param, imports.%foo_non_copyable_param.cpp_overload_set.value [concrete = constants.%foo_non_copyable_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %c.ref: %NonCopyableClass = name_ref c, %c
|
||||
// CHECK:STDOUT: %foo_non_copyable_param.call: init %empty_tuple.type = call imports.%foo_non_copyable_param.decl(%c.ref)
|
||||
|
||||
@@ -72,9 +72,7 @@ constexpr int invalid_const_fn(int a) {
|
||||
}
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_invalid_constant_eval.carbon:[[@LINE+4]]:19: error: array bound is not a constant [InvalidArrayExpr]
|
||||
// CHECK:STDERR: let a: array(i32, Cpp.invalid_const_fn(5)) = (1, 2, 3);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_invalid_constant_eval.carbon:[[@LINE+2]]:19-41: error: array bound is not a constant [InvalidArrayExpr]
|
||||
// CHECK:STDERR:
|
||||
let a: array(i32, Cpp.invalid_const_fn(5)) = (1, 2, 3);
|
||||
|
||||
@@ -103,28 +101,16 @@ var a: i32 = 0;
|
||||
|
||||
// TODO: This is failing when building the thunk, not when calling it.
|
||||
inline Cpp '''
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+9]]:15: error: call to consteval function 'nonconst_consteval_fn' is not a constant expression [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+6]]:15: note: function parameter 'r' with unknown value cannot be used in a constant expression [CppInteropParseNote]
|
||||
// CHECK:STDERR: 19 | consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+3]]:15: note: declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 19 | consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+3]]:15: error: call to consteval function 'nonconst_consteval_fn' is not a constant expression [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+2]]:15: note: function parameter 'r' with unknown value cannot be used in a constant expression [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+1]]:15: note: declared here [CppInteropParseNote]
|
||||
consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
''';
|
||||
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+11]]:14: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: var b: i32 = Cpp.nonconst_consteval_fn(a);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+5]]:14-41: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+7]]:14: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: var b: i32 = Cpp.nonconst_consteval_fn(a);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE-10]]:15: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR: consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE+3]]:14-41: error: non-constant call to compile-time-only function [NonConstantCallToCompTimeOnlyFunction]
|
||||
// CHECK:STDERR: fail_nonconstant_consteval_call.carbon:[[@LINE-6]]:15: note: compile-time-only function declared here [CompTimeOnlyFunctionHere]
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = Cpp.nonconst_consteval_fn(a);
|
||||
|
||||
@@ -144,17 +130,13 @@ struct ConstexprC {
|
||||
// TODO: This should probably be allowed.
|
||||
eval fn F() -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_constructor.carbon:[[@LINE+3]]:27: error: expression is runtime; expected constant [EvalRequiresConstantValue]
|
||||
// CHECK:STDERR: let c: Cpp.ConstexprC = 3;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_constructor.carbon:[[@LINE+1]]:27: error: expression is runtime; expected constant [EvalRequiresConstantValue]
|
||||
let c: Cpp.ConstexprC = 3;
|
||||
return c.a;
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// CHECK:STDERR: fail_todo_constructor.carbon:[[@LINE+4]]:19: note: in call to F here [InCallToEvalFn]
|
||||
// CHECK:STDERR: let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDERR: ^~~
|
||||
// CHECK:STDERR: fail_todo_constructor.carbon:[[@LINE+2]]:19-21: note: in call to F here [InCallToEvalFn]
|
||||
// CHECK:STDERR:
|
||||
let a: array(i32, F()) = (1, 2, 3);
|
||||
|
||||
@@ -202,9 +184,9 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: %self.patt.d4e: %pattern_type.3cc = wrapper_binding_pattern self, %self.param_patt.d94 [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor.type: type = fn_type @ConstexprC.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor: %ConstexprC.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc17 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc17 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -231,7 +213,7 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc17 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.3cc = ref_param_pattern [concrete = constants.%self.param_patt.d94]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.3cc = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.d4e]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -243,46 +225,46 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: fn @F() -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3.1ba]
|
||||
// CHECK:STDOUT: %.loc19_27.1: ref %ConstexprC = temporary_storage
|
||||
// CHECK:STDOUT: %impl.elem0.loc19: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc19_27.1: <bound method> = bound_method %int_3, %impl.elem0.loc19 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc19: <specific function> = specific_function %impl.elem0.loc19, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc19_27.2: <bound method> = bound_method %int_3, %specific_fn.loc19 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc19_27.2(%int_3) [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %.loc19_27.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %.loc19_27.3: %i32 = converted %int_3, %.loc19_27.2 [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %addr: %ptr.0b8 = addr_of %.loc19_27.1
|
||||
// CHECK:STDOUT: %ConstexprC__carbon_thunk.call: init %empty_tuple.type = call imports.%ConstexprC__carbon_thunk.decl(%.loc19_27.3, %addr)
|
||||
// CHECK:STDOUT: %.loc19_27.4: init %ConstexprC to %.loc19_27.1 = mark_in_place_init %ConstexprC__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc19_27.5: init %ConstexprC = converted %int_3, %.loc19_27.4
|
||||
// CHECK:STDOUT: %.loc19_27.6: ref %ConstexprC = temporary %.loc19_27.1, %.loc19_27.5
|
||||
// CHECK:STDOUT: %.loc19_27.7: %ConstexprC = acquire_value %.loc19_27.6
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %ConstexprC.ref [concrete = constants.%ConstexprC] {
|
||||
// CHECK:STDOUT: %.loc17_27.1: ref %ConstexprC = temporary_storage
|
||||
// CHECK:STDOUT: %impl.elem0.loc17: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc17_27.1: <bound method> = bound_method %int_3, %impl.elem0.loc17 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn.loc17: <specific function> = specific_function %impl.elem0.loc17, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc17_27.2: <bound method> = bound_method %int_3, %specific_fn.loc17 [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc17_27.2(%int_3) [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %.loc17_27.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %.loc17_27.3: %i32 = converted %int_3, %.loc17_27.2 [concrete = constants.%int_3.9f3]
|
||||
// CHECK:STDOUT: %addr: %ptr.0b8 = addr_of %.loc17_27.1
|
||||
// CHECK:STDOUT: %ConstexprC__carbon_thunk.call: init %empty_tuple.type = call imports.%ConstexprC__carbon_thunk.decl(%.loc17_27.3, %addr)
|
||||
// CHECK:STDOUT: %.loc17_27.4: init %ConstexprC to %.loc17_27.1 = mark_in_place_init %ConstexprC__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc17_27.5: init %ConstexprC = converted %int_3, %.loc17_27.4
|
||||
// CHECK:STDOUT: %.loc17_27.6: ref %ConstexprC = temporary %.loc17_27.1, %.loc17_27.5
|
||||
// CHECK:STDOUT: %.loc17_27.7: %ConstexprC = acquire_value %.loc17_27.6
|
||||
// CHECK:STDOUT: %.loc17_13: type = splice_block %ConstexprC.ref [concrete = constants.%ConstexprC] {
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ConstexprC.ref: type = name_ref ConstexprC, imports.%ConstexprC.decl [concrete = constants.%ConstexprC]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: %ConstexprC = wrapper_binding c, %.loc19_27.7
|
||||
// CHECK:STDOUT: %c: %ConstexprC = wrapper_binding c, %.loc17_27.7
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.3cc = value_binding_pattern c [concrete = constants.%c.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.ref: %ConstexprC = name_ref c, %c
|
||||
// CHECK:STDOUT: %a.ref: %ConstexprC.elem = name_ref a, @ConstexprC.%field_decl [concrete = @ConstexprC.%field_decl]
|
||||
// CHECK:STDOUT: %.loc20_11.1: ref %i32 = class_element_access %c.ref, element0
|
||||
// CHECK:STDOUT: %.loc20_11.2: %i32 = acquire_value %.loc20_11.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc20: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae]
|
||||
// CHECK:STDOUT: %bound_method.loc20_11.1: <bound method> = bound_method %.loc20_11.2, %impl.elem0.loc20
|
||||
// CHECK:STDOUT: %specific_fn.loc20: <specific function> = specific_function %impl.elem0.loc20, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc20_11.2: <bound method> = bound_method %.loc20_11.2, %specific_fn.loc20
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc20_11.2(%.loc20_11.2)
|
||||
// CHECK:STDOUT: %.loc18_11.1: ref %i32 = class_element_access %c.ref, element0
|
||||
// CHECK:STDOUT: %.loc18_11.2: %i32 = acquire_value %.loc18_11.1
|
||||
// CHECK:STDOUT: %impl.elem0.loc18: %.2b9 = impl_witness_access constants.%Copy.impl_witness.8af, element0 [concrete = constants.%Int.as.Copy.impl.Op.cae]
|
||||
// CHECK:STDOUT: %bound_method.loc18_11.1: <bound method> = bound_method %.loc18_11.2, %impl.elem0.loc18
|
||||
// CHECK:STDOUT: %specific_fn.loc18: <specific function> = specific_function %impl.elem0.loc18, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc18_11.2: <bound method> = bound_method %.loc18_11.2, %specific_fn.loc18
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.call: init %i32 = call %bound_method.loc18_11.2(%.loc18_11.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc19_27.6, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc19_27.6)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.loc17_27.6, constants.%Destroy.WithSelf.SelfDestruct.db3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%.loc17_27.6)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %ConstexprC) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc17(%self.param: ref %ConstexprC) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %ConstexprC) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc17(%self.param: ref %ConstexprC) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor.call: init %empty_tuple.type = call imports.%ConstexprC.cpp_destructor.decl(%self.param)
|
||||
|
||||
+172
-183
@@ -46,33 +46,22 @@ fn G(n: i32) -> i32;
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+4]]:21: error: call argument of type `<type of Cpp.Function>` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: Cpp.TakesFunction(Cpp.Function);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+2]]:21-32: error: call argument of type `<type of Cpp.Function>` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesFunction(Cpp.Function);
|
||||
|
||||
var n: array(i32, 42);
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+8]]:26: error: no matching function for call to 'TakesFunction' [CppInteropParseError]
|
||||
// CHECK:STDERR: 25 | Cpp.TakesFunction(&n[0]);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./params.h:3:6: note: candidate function not viable: no known conversion from 'int * _Nonnull' to 'int (*)(int)' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | void TakesFunction(int f(int));
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+5]]:3-19: error: no matching function for call to 'TakesFunction' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_todo_call_params_2.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./params.h:3:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./params.h:3:20-29: note: no known conversion from 'int * _Nonnull' to 'int (*)(int)' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesFunction(&n[0]);
|
||||
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+11]]:21: error: cannot implicitly convert expression of type `Cpp.nullptr_t` to `<C++ type int (*)(int)>` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.TakesFunction(Cpp.nullptr);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+8]]:21: note: type `Cpp.nullptr_t` does not implement interface `Core.ImplicitAs(<C++ type int (*)(int)>)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.TakesFunction(Cpp.nullptr);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE-29]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+5]]:21-31: error: cannot implicitly convert expression of type `Cpp.nullptr_t` to `<C++ type int (*)(int)>` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_call_params_2.carbon:[[@LINE+4]]:21-31: note: type `Cpp.nullptr_t` does not implement interface `Core.ImplicitAs(<C++ type int (*)(int)>)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_call_params_2.carbon:[[@LINE-20]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./params.h:3:24: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: void TakesFunction(int f(int));
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesFunction(Cpp.nullptr);
|
||||
//@dump-sem-ir-end
|
||||
@@ -737,15 +726,15 @@ fn F() {
|
||||
// CHECK:STDOUT: %TakesFunction: %TakesFunction.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.0c5: %pattern_type.d94 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.749: %pattern_type.d94 = wrapper_binding_pattern self, %self.param_patt.0c5 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc16_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc14_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_3.1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.421: %pattern_type.9c3 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.1f9: %pattern_type.9c3 = wrapper_binding_pattern self, %self.param_patt.421 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_41: Core.IntLiteral = int_value 41 [concrete]
|
||||
// CHECK:STDOUT: %int_40: Core.IntLiteral = int_value 40 [concrete]
|
||||
@@ -787,9 +776,9 @@ fn F() {
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc16_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc14_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc14_3.2 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -816,28 +805,28 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.1: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.2 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.1 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.d94 = ref_param_pattern [concrete = constants.%self.param_patt.0c5]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.d94 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.749]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc16_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc14_3.1 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.d94 = ref_param_pattern [concrete = constants.%self.param_patt.0c5]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.d94 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.749]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %i32 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %i32 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc16_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.2: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc14_3.2 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.9c3 = ref_param_pattern [concrete = constants.%self.param_patt.421]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.9c3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1f9]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %Array.3b5 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %Array.3b5 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc16_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc14_3.2 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.9c3 = ref_param_pattern [concrete = constants.%self.param_patt.421]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.9c3 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.1f9]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -848,20 +837,20 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc14: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc12: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Function.ref: %Function.cpp_overload_set.type = name_ref Function, imports.%Function.cpp_overload_set.value [concrete = constants.%Function.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %n.var: ref %Array.3b5 = var_storage %n.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet: %DefaultOrUnformed.type = facet_value constants.%Array.3b5, (constants.%DefaultOrUnformed.impl_witness.4bc) [concrete = constants.%DefaultOrUnformed.facet]
|
||||
// CHECK:STDOUT: %.loc16_24.1: %DefaultOrUnformed.type = converted constants.%Array.3b5, %DefaultOrUnformed.facet [concrete = constants.%DefaultOrUnformed.facet]
|
||||
// CHECK:STDOUT: %as_type: type = facet_access_type %.loc16_24.1 [concrete = constants.%Array.3b5]
|
||||
// CHECK:STDOUT: %.loc16_24.2: type = converted %.loc16_24.1, %as_type [concrete = constants.%Array.3b5]
|
||||
// CHECK:STDOUT: %.loc14_24.1: %DefaultOrUnformed.type = converted constants.%Array.3b5, %DefaultOrUnformed.facet [concrete = constants.%DefaultOrUnformed.facet]
|
||||
// CHECK:STDOUT: %as_type: type = facet_access_type %.loc14_24.1 [concrete = constants.%Array.3b5]
|
||||
// CHECK:STDOUT: %.loc14_24.2: type = converted %.loc14_24.1, %as_type [concrete = constants.%Array.3b5]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc16_3: ref %Array.3b5 = splice_block %n.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call: init %Array.3b5 to %.loc16_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn()
|
||||
// CHECK:STDOUT: %.loc14_3: ref %Array.3b5 = splice_block %n.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call: init %Array.3b5 to %.loc14_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn()
|
||||
// CHECK:STDOUT: assign %n.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call
|
||||
// CHECK:STDOUT: %.loc16_23: type = splice_block %Array [concrete = constants.%Array.3b5] {
|
||||
// CHECK:STDOUT: %.loc14_23: type = splice_block %Array [concrete = constants.%Array.3b5] {
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %int_42: Core.IntLiteral = int_value 42 [concrete = constants.%int_42]
|
||||
// CHECK:STDOUT: %Array: type = class_type @Array, @Array(constants.%i32, constants.%int_42) [concrete = constants.%Array.3b5]
|
||||
@@ -871,218 +860,218 @@ fn F() {
|
||||
// CHECK:STDOUT: %n.patt: %pattern_type.9c3 = ref_binding_pattern n [concrete = constants.%n.patt.368]
|
||||
// CHECK:STDOUT: %n.var_patt: %pattern_type.9c3 = var_pattern %n.patt [concrete = constants.%n.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc25: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc25: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc20: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %n.ref: ref %Array.3b5 = name_ref n, %n
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %impl.elem0: %.33a = impl_witness_access constants.%ImplicitAs.impl_witness.d73, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.f60]
|
||||
// CHECK:STDOUT: %bound_method.loc25_24.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc20_24.1: <bound method> = bound_method %int_0, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.ImplicitAs.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc25_24.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc25_24.2(%int_0) [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc25_24.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc25_24.2: %i32 = converted %int_0, %.loc25_24.1 [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc25_25: ref %i32 = array_index %n.ref, %.loc25_24.2
|
||||
// CHECK:STDOUT: %addr: %ptr.a17 = addr_of %.loc25_25
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc38: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %bound_method.loc20_24.2: <bound method> = bound_method %int_0, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc20_24.2(%int_0) [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc20_24.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc20_24.2: %i32 = converted %int_0, %.loc20_24.1 [concrete = constants.%int_0.753]
|
||||
// CHECK:STDOUT: %.loc20_25: ref %i32 = array_index %n.ref, %.loc20_24.2
|
||||
// CHECK:STDOUT: %addr: %ptr.a17 = addr_of %.loc20_25
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesFunction.ref.loc27: %TakesFunction.cpp_overload_set.type = name_ref TakesFunction, imports.%TakesFunction.cpp_overload_set.value [concrete = constants.%TakesFunction.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27_21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %nullptr.ref: %Cpp.nullptr_t = name_ref nullptr, %uninit [concrete = constants.%uninit]
|
||||
// CHECK:STDOUT: %.loc38: %.659 = converted %nullptr.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc27: %.659 = converted %nullptr.ref, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %TakesFunction.call: init %empty_tuple.type = call imports.%TakesFunction.decl(<error>)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %n.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound(%n.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.1(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.1(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.1(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.1(%self.param: ref %i32) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.1(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.1(%self.param: ref %i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.1(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc16_3.2(%self.param: ref %Array.3b5) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc14_3.2(%self.param: ref %Array.3b5) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %int_41: Core.IntLiteral = int_value 41 [concrete = constants.%int_41]
|
||||
// CHECK:STDOUT: %.loc16_3.1: ref %i32 = array_index %self.param, %int_41
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.1: <bound method> = bound_method %.loc16_3.1, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.1(%.loc16_3.1)
|
||||
// CHECK:STDOUT: %.loc14_3.1: ref %i32 = array_index %self.param, %int_41
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.1: <bound method> = bound_method %.loc14_3.1, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.1: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.1(%.loc14_3.1)
|
||||
// CHECK:STDOUT: %int_40: Core.IntLiteral = int_value 40 [concrete = constants.%int_40]
|
||||
// CHECK:STDOUT: %.loc16_3.2: ref %i32 = array_index %self.param, %int_40
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.2: <bound method> = bound_method %.loc16_3.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.2(%.loc16_3.2)
|
||||
// CHECK:STDOUT: %.loc14_3.2: ref %i32 = array_index %self.param, %int_40
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.2: <bound method> = bound_method %.loc14_3.2, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.2: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.2(%.loc14_3.2)
|
||||
// CHECK:STDOUT: %int_39: Core.IntLiteral = int_value 39 [concrete = constants.%int_39]
|
||||
// CHECK:STDOUT: %.loc16_3.3: ref %i32 = array_index %self.param, %int_39
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.3: <bound method> = bound_method %.loc16_3.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.3(%.loc16_3.3)
|
||||
// CHECK:STDOUT: %.loc14_3.3: ref %i32 = array_index %self.param, %int_39
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.3: <bound method> = bound_method %.loc14_3.3, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.3: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.3(%.loc14_3.3)
|
||||
// CHECK:STDOUT: %int_38: Core.IntLiteral = int_value 38 [concrete = constants.%int_38]
|
||||
// CHECK:STDOUT: %.loc16_3.4: ref %i32 = array_index %self.param, %int_38
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.4: <bound method> = bound_method %.loc16_3.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.4(%.loc16_3.4)
|
||||
// CHECK:STDOUT: %.loc14_3.4: ref %i32 = array_index %self.param, %int_38
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.4: <bound method> = bound_method %.loc14_3.4, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.4: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.4(%.loc14_3.4)
|
||||
// CHECK:STDOUT: %int_37: Core.IntLiteral = int_value 37 [concrete = constants.%int_37]
|
||||
// CHECK:STDOUT: %.loc16_3.5: ref %i32 = array_index %self.param, %int_37
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.5: <bound method> = bound_method %.loc16_3.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.5: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.5(%.loc16_3.5)
|
||||
// CHECK:STDOUT: %.loc14_3.5: ref %i32 = array_index %self.param, %int_37
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.5: <bound method> = bound_method %.loc14_3.5, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.5: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.5(%.loc14_3.5)
|
||||
// CHECK:STDOUT: %int_36: Core.IntLiteral = int_value 36 [concrete = constants.%int_36]
|
||||
// CHECK:STDOUT: %.loc16_3.6: ref %i32 = array_index %self.param, %int_36
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.6: <bound method> = bound_method %.loc16_3.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.6: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.6(%.loc16_3.6)
|
||||
// CHECK:STDOUT: %.loc14_3.6: ref %i32 = array_index %self.param, %int_36
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.6: <bound method> = bound_method %.loc14_3.6, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.6: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.6(%.loc14_3.6)
|
||||
// CHECK:STDOUT: %int_35: Core.IntLiteral = int_value 35 [concrete = constants.%int_35]
|
||||
// CHECK:STDOUT: %.loc16_3.7: ref %i32 = array_index %self.param, %int_35
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.7: <bound method> = bound_method %.loc16_3.7, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.7(%.loc16_3.7)
|
||||
// CHECK:STDOUT: %.loc14_3.7: ref %i32 = array_index %self.param, %int_35
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.7: <bound method> = bound_method %.loc14_3.7, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.7: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.7(%.loc14_3.7)
|
||||
// CHECK:STDOUT: %int_34: Core.IntLiteral = int_value 34 [concrete = constants.%int_34]
|
||||
// CHECK:STDOUT: %.loc16_3.8: ref %i32 = array_index %self.param, %int_34
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.8: <bound method> = bound_method %.loc16_3.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.8(%.loc16_3.8)
|
||||
// CHECK:STDOUT: %.loc14_3.8: ref %i32 = array_index %self.param, %int_34
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.8: <bound method> = bound_method %.loc14_3.8, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.8(%.loc14_3.8)
|
||||
// CHECK:STDOUT: %int_33: Core.IntLiteral = int_value 33 [concrete = constants.%int_33]
|
||||
// CHECK:STDOUT: %.loc16_3.9: ref %i32 = array_index %self.param, %int_33
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.9: <bound method> = bound_method %.loc16_3.9, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.9(%.loc16_3.9)
|
||||
// CHECK:STDOUT: %.loc14_3.9: ref %i32 = array_index %self.param, %int_33
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.9: <bound method> = bound_method %.loc14_3.9, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.9: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.9(%.loc14_3.9)
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete = constants.%int_32]
|
||||
// CHECK:STDOUT: %.loc16_3.10: ref %i32 = array_index %self.param, %int_32
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.10: <bound method> = bound_method %.loc16_3.10, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.10(%.loc16_3.10)
|
||||
// CHECK:STDOUT: %.loc14_3.10: ref %i32 = array_index %self.param, %int_32
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.10: <bound method> = bound_method %.loc14_3.10, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.10: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.10(%.loc14_3.10)
|
||||
// CHECK:STDOUT: %int_31: Core.IntLiteral = int_value 31 [concrete = constants.%int_31]
|
||||
// CHECK:STDOUT: %.loc16_3.11: ref %i32 = array_index %self.param, %int_31
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.11: <bound method> = bound_method %.loc16_3.11, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.11(%.loc16_3.11)
|
||||
// CHECK:STDOUT: %.loc14_3.11: ref %i32 = array_index %self.param, %int_31
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.11: <bound method> = bound_method %.loc14_3.11, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.11: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.11(%.loc14_3.11)
|
||||
// CHECK:STDOUT: %int_30: Core.IntLiteral = int_value 30 [concrete = constants.%int_30]
|
||||
// CHECK:STDOUT: %.loc16_3.12: ref %i32 = array_index %self.param, %int_30
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.12: <bound method> = bound_method %.loc16_3.12, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.12(%.loc16_3.12)
|
||||
// CHECK:STDOUT: %.loc14_3.12: ref %i32 = array_index %self.param, %int_30
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.12: <bound method> = bound_method %.loc14_3.12, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.12: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.12(%.loc14_3.12)
|
||||
// CHECK:STDOUT: %int_29: Core.IntLiteral = int_value 29 [concrete = constants.%int_29]
|
||||
// CHECK:STDOUT: %.loc16_3.13: ref %i32 = array_index %self.param, %int_29
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.13: <bound method> = bound_method %.loc16_3.13, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.13: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.13(%.loc16_3.13)
|
||||
// CHECK:STDOUT: %.loc14_3.13: ref %i32 = array_index %self.param, %int_29
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.13: <bound method> = bound_method %.loc14_3.13, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.13: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.13(%.loc14_3.13)
|
||||
// CHECK:STDOUT: %int_28: Core.IntLiteral = int_value 28 [concrete = constants.%int_28]
|
||||
// CHECK:STDOUT: %.loc16_3.14: ref %i32 = array_index %self.param, %int_28
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.14: <bound method> = bound_method %.loc16_3.14, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.14: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.14(%.loc16_3.14)
|
||||
// CHECK:STDOUT: %.loc14_3.14: ref %i32 = array_index %self.param, %int_28
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.14: <bound method> = bound_method %.loc14_3.14, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.14: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.14(%.loc14_3.14)
|
||||
// CHECK:STDOUT: %int_27: Core.IntLiteral = int_value 27 [concrete = constants.%int_27]
|
||||
// CHECK:STDOUT: %.loc16_3.15: ref %i32 = array_index %self.param, %int_27
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.15: <bound method> = bound_method %.loc16_3.15, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.15: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.15(%.loc16_3.15)
|
||||
// CHECK:STDOUT: %.loc14_3.15: ref %i32 = array_index %self.param, %int_27
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.15: <bound method> = bound_method %.loc14_3.15, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.15: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.15(%.loc14_3.15)
|
||||
// CHECK:STDOUT: %int_26: Core.IntLiteral = int_value 26 [concrete = constants.%int_26]
|
||||
// CHECK:STDOUT: %.loc16_3.16: ref %i32 = array_index %self.param, %int_26
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.16: <bound method> = bound_method %.loc16_3.16, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.16(%.loc16_3.16)
|
||||
// CHECK:STDOUT: %.loc14_3.16: ref %i32 = array_index %self.param, %int_26
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.16: <bound method> = bound_method %.loc14_3.16, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.16(%.loc14_3.16)
|
||||
// CHECK:STDOUT: %int_25: Core.IntLiteral = int_value 25 [concrete = constants.%int_25]
|
||||
// CHECK:STDOUT: %.loc16_3.17: ref %i32 = array_index %self.param, %int_25
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.17: <bound method> = bound_method %.loc16_3.17, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.17: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.17(%.loc16_3.17)
|
||||
// CHECK:STDOUT: %.loc14_3.17: ref %i32 = array_index %self.param, %int_25
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.17: <bound method> = bound_method %.loc14_3.17, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.17: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.17(%.loc14_3.17)
|
||||
// CHECK:STDOUT: %int_24: Core.IntLiteral = int_value 24 [concrete = constants.%int_24]
|
||||
// CHECK:STDOUT: %.loc16_3.18: ref %i32 = array_index %self.param, %int_24
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.18: <bound method> = bound_method %.loc16_3.18, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.18: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.18(%.loc16_3.18)
|
||||
// CHECK:STDOUT: %.loc14_3.18: ref %i32 = array_index %self.param, %int_24
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.18: <bound method> = bound_method %.loc14_3.18, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.18: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.18(%.loc14_3.18)
|
||||
// CHECK:STDOUT: %int_23: Core.IntLiteral = int_value 23 [concrete = constants.%int_23]
|
||||
// CHECK:STDOUT: %.loc16_3.19: ref %i32 = array_index %self.param, %int_23
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.19: <bound method> = bound_method %.loc16_3.19, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.19(%.loc16_3.19)
|
||||
// CHECK:STDOUT: %.loc14_3.19: ref %i32 = array_index %self.param, %int_23
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.19: <bound method> = bound_method %.loc14_3.19, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.19(%.loc14_3.19)
|
||||
// CHECK:STDOUT: %int_22: Core.IntLiteral = int_value 22 [concrete = constants.%int_22]
|
||||
// CHECK:STDOUT: %.loc16_3.20: ref %i32 = array_index %self.param, %int_22
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.20: <bound method> = bound_method %.loc16_3.20, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.20: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.20(%.loc16_3.20)
|
||||
// CHECK:STDOUT: %.loc14_3.20: ref %i32 = array_index %self.param, %int_22
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.20: <bound method> = bound_method %.loc14_3.20, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.20: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.20(%.loc14_3.20)
|
||||
// CHECK:STDOUT: %int_21: Core.IntLiteral = int_value 21 [concrete = constants.%int_21]
|
||||
// CHECK:STDOUT: %.loc16_3.21: ref %i32 = array_index %self.param, %int_21
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.21: <bound method> = bound_method %.loc16_3.21, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.21(%.loc16_3.21)
|
||||
// CHECK:STDOUT: %.loc14_3.21: ref %i32 = array_index %self.param, %int_21
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.21: <bound method> = bound_method %.loc14_3.21, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.21: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.21(%.loc14_3.21)
|
||||
// CHECK:STDOUT: %int_20: Core.IntLiteral = int_value 20 [concrete = constants.%int_20]
|
||||
// CHECK:STDOUT: %.loc16_3.22: ref %i32 = array_index %self.param, %int_20
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.22: <bound method> = bound_method %.loc16_3.22, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.22(%.loc16_3.22)
|
||||
// CHECK:STDOUT: %.loc14_3.22: ref %i32 = array_index %self.param, %int_20
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.22: <bound method> = bound_method %.loc14_3.22, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.22: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.22(%.loc14_3.22)
|
||||
// CHECK:STDOUT: %int_19: Core.IntLiteral = int_value 19 [concrete = constants.%int_19]
|
||||
// CHECK:STDOUT: %.loc16_3.23: ref %i32 = array_index %self.param, %int_19
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.23: <bound method> = bound_method %.loc16_3.23, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.23(%.loc16_3.23)
|
||||
// CHECK:STDOUT: %.loc14_3.23: ref %i32 = array_index %self.param, %int_19
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.23: <bound method> = bound_method %.loc14_3.23, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.23: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.23(%.loc14_3.23)
|
||||
// CHECK:STDOUT: %int_18: Core.IntLiteral = int_value 18 [concrete = constants.%int_18]
|
||||
// CHECK:STDOUT: %.loc16_3.24: ref %i32 = array_index %self.param, %int_18
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.24: <bound method> = bound_method %.loc16_3.24, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.24(%.loc16_3.24)
|
||||
// CHECK:STDOUT: %.loc14_3.24: ref %i32 = array_index %self.param, %int_18
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.24: <bound method> = bound_method %.loc14_3.24, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.24(%.loc14_3.24)
|
||||
// CHECK:STDOUT: %int_17: Core.IntLiteral = int_value 17 [concrete = constants.%int_17]
|
||||
// CHECK:STDOUT: %.loc16_3.25: ref %i32 = array_index %self.param, %int_17
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.25: <bound method> = bound_method %.loc16_3.25, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.25: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.25(%.loc16_3.25)
|
||||
// CHECK:STDOUT: %.loc14_3.25: ref %i32 = array_index %self.param, %int_17
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.25: <bound method> = bound_method %.loc14_3.25, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.25: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.25(%.loc14_3.25)
|
||||
// CHECK:STDOUT: %int_16: Core.IntLiteral = int_value 16 [concrete = constants.%int_16]
|
||||
// CHECK:STDOUT: %.loc16_3.26: ref %i32 = array_index %self.param, %int_16
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.26: <bound method> = bound_method %.loc16_3.26, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.26: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.26(%.loc16_3.26)
|
||||
// CHECK:STDOUT: %.loc14_3.26: ref %i32 = array_index %self.param, %int_16
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.26: <bound method> = bound_method %.loc14_3.26, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.26: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.26(%.loc14_3.26)
|
||||
// CHECK:STDOUT: %int_15: Core.IntLiteral = int_value 15 [concrete = constants.%int_15]
|
||||
// CHECK:STDOUT: %.loc16_3.27: ref %i32 = array_index %self.param, %int_15
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.27: <bound method> = bound_method %.loc16_3.27, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.27: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.27(%.loc16_3.27)
|
||||
// CHECK:STDOUT: %.loc14_3.27: ref %i32 = array_index %self.param, %int_15
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.27: <bound method> = bound_method %.loc14_3.27, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.27: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.27(%.loc14_3.27)
|
||||
// CHECK:STDOUT: %int_14: Core.IntLiteral = int_value 14 [concrete = constants.%int_14]
|
||||
// CHECK:STDOUT: %.loc16_3.28: ref %i32 = array_index %self.param, %int_14
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.28: <bound method> = bound_method %.loc16_3.28, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.28: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.28(%.loc16_3.28)
|
||||
// CHECK:STDOUT: %.loc14_3.28: ref %i32 = array_index %self.param, %int_14
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.28: <bound method> = bound_method %.loc14_3.28, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.28: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.28(%.loc14_3.28)
|
||||
// CHECK:STDOUT: %int_13: Core.IntLiteral = int_value 13 [concrete = constants.%int_13]
|
||||
// CHECK:STDOUT: %.loc16_3.29: ref %i32 = array_index %self.param, %int_13
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.29: <bound method> = bound_method %.loc16_3.29, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.29: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.29(%.loc16_3.29)
|
||||
// CHECK:STDOUT: %.loc14_3.29: ref %i32 = array_index %self.param, %int_13
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.29: <bound method> = bound_method %.loc14_3.29, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.29: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.29(%.loc14_3.29)
|
||||
// CHECK:STDOUT: %int_12: Core.IntLiteral = int_value 12 [concrete = constants.%int_12]
|
||||
// CHECK:STDOUT: %.loc16_3.30: ref %i32 = array_index %self.param, %int_12
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.30: <bound method> = bound_method %.loc16_3.30, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.30: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.30(%.loc16_3.30)
|
||||
// CHECK:STDOUT: %.loc14_3.30: ref %i32 = array_index %self.param, %int_12
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.30: <bound method> = bound_method %.loc14_3.30, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.30: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.30(%.loc14_3.30)
|
||||
// CHECK:STDOUT: %int_11: Core.IntLiteral = int_value 11 [concrete = constants.%int_11]
|
||||
// CHECK:STDOUT: %.loc16_3.31: ref %i32 = array_index %self.param, %int_11
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.31: <bound method> = bound_method %.loc16_3.31, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.31: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.31(%.loc16_3.31)
|
||||
// CHECK:STDOUT: %.loc14_3.31: ref %i32 = array_index %self.param, %int_11
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.31: <bound method> = bound_method %.loc14_3.31, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.31: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.31(%.loc14_3.31)
|
||||
// CHECK:STDOUT: %int_10: Core.IntLiteral = int_value 10 [concrete = constants.%int_10]
|
||||
// CHECK:STDOUT: %.loc16_3.32: ref %i32 = array_index %self.param, %int_10
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.32: <bound method> = bound_method %.loc16_3.32, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.32: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.32(%.loc16_3.32)
|
||||
// CHECK:STDOUT: %.loc14_3.32: ref %i32 = array_index %self.param, %int_10
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.32: <bound method> = bound_method %.loc14_3.32, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.32: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.32(%.loc14_3.32)
|
||||
// CHECK:STDOUT: %int_9: Core.IntLiteral = int_value 9 [concrete = constants.%int_9]
|
||||
// CHECK:STDOUT: %.loc16_3.33: ref %i32 = array_index %self.param, %int_9
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.33: <bound method> = bound_method %.loc16_3.33, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.33: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.33(%.loc16_3.33)
|
||||
// CHECK:STDOUT: %.loc14_3.33: ref %i32 = array_index %self.param, %int_9
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.33: <bound method> = bound_method %.loc14_3.33, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.33: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.33(%.loc14_3.33)
|
||||
// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8]
|
||||
// CHECK:STDOUT: %.loc16_3.34: ref %i32 = array_index %self.param, %int_8
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.34: <bound method> = bound_method %.loc16_3.34, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.34: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.34(%.loc16_3.34)
|
||||
// CHECK:STDOUT: %.loc14_3.34: ref %i32 = array_index %self.param, %int_8
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.34: <bound method> = bound_method %.loc14_3.34, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.34: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.34(%.loc14_3.34)
|
||||
// CHECK:STDOUT: %int_7: Core.IntLiteral = int_value 7 [concrete = constants.%int_7]
|
||||
// CHECK:STDOUT: %.loc16_3.35: ref %i32 = array_index %self.param, %int_7
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.35: <bound method> = bound_method %.loc16_3.35, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.35: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.35(%.loc16_3.35)
|
||||
// CHECK:STDOUT: %.loc14_3.35: ref %i32 = array_index %self.param, %int_7
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.35: <bound method> = bound_method %.loc14_3.35, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.35: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.35(%.loc14_3.35)
|
||||
// CHECK:STDOUT: %int_6: Core.IntLiteral = int_value 6 [concrete = constants.%int_6]
|
||||
// CHECK:STDOUT: %.loc16_3.36: ref %i32 = array_index %self.param, %int_6
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.36: <bound method> = bound_method %.loc16_3.36, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.36: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.36(%.loc16_3.36)
|
||||
// CHECK:STDOUT: %.loc14_3.36: ref %i32 = array_index %self.param, %int_6
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.36: <bound method> = bound_method %.loc14_3.36, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.36: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.36(%.loc14_3.36)
|
||||
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5]
|
||||
// CHECK:STDOUT: %.loc16_3.37: ref %i32 = array_index %self.param, %int_5
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.37: <bound method> = bound_method %.loc16_3.37, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.37: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.37(%.loc16_3.37)
|
||||
// CHECK:STDOUT: %.loc14_3.37: ref %i32 = array_index %self.param, %int_5
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.37: <bound method> = bound_method %.loc14_3.37, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.37: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.37(%.loc14_3.37)
|
||||
// CHECK:STDOUT: %int_4: Core.IntLiteral = int_value 4 [concrete = constants.%int_4]
|
||||
// CHECK:STDOUT: %.loc16_3.38: ref %i32 = array_index %self.param, %int_4
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.38: <bound method> = bound_method %.loc16_3.38, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.38: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.38(%.loc16_3.38)
|
||||
// CHECK:STDOUT: %.loc14_3.38: ref %i32 = array_index %self.param, %int_4
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.38: <bound method> = bound_method %.loc14_3.38, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.38: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.38(%.loc14_3.38)
|
||||
// CHECK:STDOUT: %int_3: Core.IntLiteral = int_value 3 [concrete = constants.%int_3]
|
||||
// CHECK:STDOUT: %.loc16_3.39: ref %i32 = array_index %self.param, %int_3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.39: <bound method> = bound_method %.loc16_3.39, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.39: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.39(%.loc16_3.39)
|
||||
// CHECK:STDOUT: %.loc14_3.39: ref %i32 = array_index %self.param, %int_3
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.39: <bound method> = bound_method %.loc14_3.39, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.39: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.39(%.loc14_3.39)
|
||||
// CHECK:STDOUT: %int_2: Core.IntLiteral = int_value 2 [concrete = constants.%int_2]
|
||||
// CHECK:STDOUT: %.loc16_3.40: ref %i32 = array_index %self.param, %int_2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.40: <bound method> = bound_method %.loc16_3.40, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.40: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.40(%.loc16_3.40)
|
||||
// CHECK:STDOUT: %.loc14_3.40: ref %i32 = array_index %self.param, %int_2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.40: <bound method> = bound_method %.loc14_3.40, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.40: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.40(%.loc14_3.40)
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %.loc16_3.41: ref %i32 = array_index %self.param, %int_1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.41: <bound method> = bound_method %.loc16_3.41, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.41: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.41(%.loc16_3.41)
|
||||
// CHECK:STDOUT: %.loc14_3.41: ref %i32 = array_index %self.param, %int_1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.41: <bound method> = bound_method %.loc14_3.41, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.41: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.41(%.loc14_3.41)
|
||||
// CHECK:STDOUT: %int_0: Core.IntLiteral = int_value 0 [concrete = constants.%int_0.5c6]
|
||||
// CHECK:STDOUT: %.loc16_3.42: ref %i32 = array_index %self.param, %int_0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16_3.42: <bound method> = bound_method %.loc16_3.42, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16_3.42: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16_3.42(%.loc16_3.42)
|
||||
// CHECK:STDOUT: %.loc14_3.42: ref %i32 = array_index %self.param, %int_0
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc14_3.42: <bound method> = bound_method %.loc14_3.42, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc14_3.42: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc14_3.42(%.loc14_3.42)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16_3.2(%self.param: ref %Array.3b5) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc14_3.2(%self.param: ref %Array.3b5) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16_3.2(%self.param: ref %Array.3b5) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc14_3.2(%self.param: ref %Array.3b5) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.2(%self.param)
|
||||
|
||||
@@ -63,73 +63,52 @@ import Cpp library "functions.h";
|
||||
|
||||
fn Call() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:23: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: 16 | Cpp.GlobalNoReturn(1);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable: requires at least 2 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto GlobalNoReturn(int a, int b, int c = 1, int d = 2) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-20: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:2:21-54: note: requires at least 2 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalNoReturn(1);
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:22: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: 26 | Cpp.GlobalNoReturn();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-17]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable: requires at least 2 arguments, but 0 were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto GlobalNoReturn(int a, int b, int c = 1, int d = 2) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-20: error: no matching function for call to 'GlobalNoReturn' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:2:21-54: note: requires at least 2 arguments, but 0 were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalNoReturn();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:24: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: 36 | Cpp.GlobalReturnInt(1);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable: requires at least 2 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | auto GlobalReturnInt(int a, int b, int c = 1, int d = 2) -> int;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-19]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:3:22-55: note: requires at least 2 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalReturnInt(1);
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:23: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: 46 | Cpp.GlobalReturnInt();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-37]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable: requires at least 2 arguments, but 0 were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | auto GlobalReturnInt(int a, int b, int c = 1, int d = 2) -> int;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'GlobalReturnInt' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-26]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:3:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:3:22-55: note: requires at least 2 arguments, but 0 were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.GlobalReturnInt();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:19: error: no matching function for call to 'B' [CppInteropParseError]
|
||||
// CHECK:STDERR: 56 | ({} as Cpp.X).B();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-47]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:6:8: note: candidate function not viable: requires at least argument 'a', but no arguments were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | void B(int a, int b = 1);
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'B' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-33]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:6:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:6:10-25: note: requires at least argument 'a', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
({} as Cpp.X).B();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:11: error: no matching function for call to 'C' [CppInteropParseError]
|
||||
// CHECK:STDERR: 66 | Cpp.X.C();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-57]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:7:15: note: candidate function not viable: requires at least argument 'a', but no arguments were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | static void C(int a, int b = 1);
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-9: error: no matching function for call to 'C' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-40]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:7:15: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:7:17-32: note: requires at least argument 'a', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.X.C();
|
||||
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+8]]:19: error: no matching function for call to 'D' [CppInteropParseError]
|
||||
// CHECK:STDERR: 76 | ({} as Cpp.X).D();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-67]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:8:8: note: candidate function not viable: requires at least non-object argument 'a', but no arguments were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 8 | void D(this X, int a, int b = 1);
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'D' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_too_few_args.carbon:[[@LINE-47]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./functions.h:8:8: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./functions.h:8:10-33: note: requires at least non-object argument 'a', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
({} as Cpp.X).D();
|
||||
//@dump-sem-ir-end
|
||||
@@ -937,9 +916,9 @@ fn Call() {
|
||||
// CHECK:STDOUT: %self.patt.3ab: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt.a14 [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor.type: type = fn_type @X.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %X.cpp_destructor: %X.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc56 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef0: type = fn_type @Destroy.WithSelf.Op.loc41 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403: %Destroy.WithSelf.Op.type.ef0 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc56 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbc: type = fn_type @Destroy.WithSelf.SelfDestruct.loc41 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3: %Destroy.WithSelf.SelfDestruct.type.fbc = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound: <bound method> = bound_method %.414, %Destroy.WithSelf.SelfDestruct.db3 [concrete]
|
||||
// CHECK:STDOUT: %X.C.cpp_overload_set.type: type = cpp_overload_set_type @X.C.cpp_overload_set [concrete]
|
||||
@@ -970,7 +949,7 @@ fn Call() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc56 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl: %Destroy.WithSelf.Op.type.ef0 = fn_decl @Destroy.WithSelf.Op.loc41 [concrete = constants.%Destroy.WithSelf.Op.403] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.fa7 = ref_param_pattern [concrete = constants.%self.param_patt.a14]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.fa7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.3ab]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -981,46 +960,46 @@ fn Call() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Call() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc16: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc16: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc26: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc36: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc36: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc36: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc46: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc46: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc56_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc56: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc56: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %.loc56_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc56_5.3: init %X to %.loc56_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc56_7.1: init %X = converted %.loc56_5.1, %.loc56_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc56_7.2: ref %X = temporary %.loc56_5.2, %.loc56_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc13: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc13: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc20: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalNoReturn.ref.loc20: %GlobalNoReturn.cpp_overload_set.type = name_ref GlobalNoReturn, imports.%GlobalNoReturn.cpp_overload_set.value [concrete = constants.%GlobalNoReturn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc27: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1.loc27: Core.IntLiteral = int_value 1 [concrete = constants.%int_1]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc34: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %GlobalReturnInt.ref.loc34: %GlobalReturnInt.cpp_overload_set.type = name_ref GlobalReturnInt, imports.%GlobalReturnInt.cpp_overload_set.value [concrete = constants.%GlobalReturnInt.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc41_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc41: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc41: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %.loc41_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc41_5.3: init %X to %.loc41_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc41_7.1: init %X = converted %.loc41_5.1, %.loc41_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc41_7.2: ref %X = temporary %.loc41_5.2, %.loc41_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %B.ref: %X.B.cpp_overload_set.type = name_ref B, imports.%X.B.cpp_overload_set.value [concrete = constants.%X.B.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %bound_method.loc56: <bound method> = bound_method %.loc56_7.2, %B.ref [concrete = constants.%bound_method.f8c]
|
||||
// CHECK:STDOUT: %bound_method.loc41: <bound method> = bound_method %.loc41_7.2, %B.ref [concrete = constants.%bound_method.f8c]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc56: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc66: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc66: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc41: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc48: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc48: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %C.ref: %X.C.cpp_overload_set.type = name_ref C, imports.%X.C.cpp_overload_set.value [concrete = constants.%X.C.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc76_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc76: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc76: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %.loc76_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc76_5.3: init %X to %.loc76_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc76_7.1: init %X = converted %.loc76_5.1, %.loc76_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc76_7.2: ref %X = temporary %.loc76_5.2, %.loc76_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %.loc55_5.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc55: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %X.ref.loc55: type = name_ref X, imports.%X.decl [concrete = constants.%X]
|
||||
// CHECK:STDOUT: %.loc55_5.2: ref %X = temporary_storage
|
||||
// CHECK:STDOUT: %.loc55_5.3: init %X to %.loc55_5.2 = class_init () [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc55_7.1: init %X = converted %.loc55_5.1, %.loc55_5.3 [concrete = constants.%X.val]
|
||||
// CHECK:STDOUT: %.loc55_7.2: ref %X = temporary %.loc55_5.2, %.loc55_7.1 [concrete = constants.%.414]
|
||||
// CHECK:STDOUT: %D.ref: %X.D.cpp_overload_set.type = name_ref D, imports.%X.D.cpp_overload_set.value [concrete = constants.%X.D.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %bound_method.loc76: <bound method> = bound_method %.loc76_7.2, %D.ref [concrete = constants.%bound_method.9a8]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc76: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414)
|
||||
// CHECK:STDOUT: %bound_method.loc55: <bound method> = bound_method %.loc55_7.2, %D.ref [concrete = constants.%bound_method.9a8]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc55: init %empty_tuple.type = call constants.%Destroy.WithSelf.SelfDestruct.bound(constants.%.414)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc56(%self.param: ref %X) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc41(%self.param: ref %X) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc56(%self.param: ref %X) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc41(%self.param: ref %X) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl(%self.param)
|
||||
// CHECK:STDOUT: %X.cpp_destructor.call: init %empty_tuple.type = call imports.%X.cpp_destructor.decl(%self.param)
|
||||
|
||||
@@ -37,9 +37,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "global.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_global_use_different_name.carbon:[[@LINE+4]]:3: error: member name `bar` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.bar();
|
||||
// CHECK:STDERR: ^~~~~~~
|
||||
// CHECK:STDERR: fail_import_global_use_different_name.carbon:[[@LINE+2]]:3-9: error: member name `bar` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.bar();
|
||||
}
|
||||
@@ -59,9 +57,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "special_name.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_special_name_call_unescaped.carbon:[[@LINE+4]]:3: error: member name `base` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR: Cpp.base();
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_special_name_call_unescaped.carbon:[[@LINE+2]]:3-10: error: member name `base` not found in `Cpp` [MemberNameNotFoundInInstScope]
|
||||
// CHECK:STDERR:
|
||||
Cpp.base();
|
||||
}
|
||||
@@ -85,13 +81,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "special_name.h";
|
||||
|
||||
fn MyF() {
|
||||
// CHECK:STDERR: fail_import_special_name_call_escaped_no_match.carbon:[[@LINE+8]]:15: error: no matching function for call to 'base' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | Cpp.r#base(1);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_special_name_call_escaped_no_match.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./special_name.h:2:6: note: candidate function not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto base() -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_special_name_call_escaped_no_match.carbon:[[@LINE+5]]:3-12: error: no matching function for call to 'base' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_special_name_call_escaped_no_match.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./special_name.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./special_name.h:2:10-11: note: requires 0 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.r#base(1);
|
||||
}
|
||||
@@ -133,9 +126,7 @@ import Cpp library "variadic.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_variadic.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: Variadic function` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.variadic_foo(8);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_variadic.carbon:[[@LINE+2]]:3-21: error: semantics TODO: `Unsupported: Variadic function` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.variadic_foo(8);
|
||||
//@dump-sem-ir-end
|
||||
@@ -148,9 +139,7 @@ fn F() {
|
||||
// --- static.h
|
||||
|
||||
// TODO: Promote this warning to an error by default.
|
||||
// CHECK:STDERR: ./static.h:[[@LINE+3]]:13: warning: function 'static_foo' has internal linkage but is not defined [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | static auto static_foo() -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: ./static.h:[[@LINE+1]]:13: warning: function 'static_foo' has internal linkage but is not defined [CppInteropParseWarning]
|
||||
static auto static_foo() -> void;
|
||||
|
||||
// --- todo_fail_import_static.carbon
|
||||
@@ -161,9 +150,7 @@ import Cpp library "static.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: todo_fail_import_static.carbon:[[@LINE+4]]:18: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | Cpp.static_foo();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: todo_fail_import_static.carbon:[[@LINE+2]]:18: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Cpp.static_foo();
|
||||
//@dump-sem-ir-end
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
// TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interop/cpp/function/import/function_ptr.carbon
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/import/function_ptr.carbon
|
||||
// CHECK:STDERR: error: calling function with incomplete return type 'Incomplete' [CppInteropParseError]
|
||||
|
||||
// --- simple_callback.h
|
||||
|
||||
@@ -147,24 +146,17 @@ fn F() {
|
||||
// --- fail_use_forward_decl.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: error: calling function with incomplete return type 'Incomplete' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_use_forward_decl.carbon:[[@LINE+2]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./forward_decl.h:2:7: note: forward declaration of 'Incomplete' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | class Incomplete;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "forward_decl.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE+13]]:3: note: in thunk for C++ function pointer type used here [InCppFunctionPointerThunk]
|
||||
// CHECK:STDERR: Cpp.ReturnCallback()();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE+7]]:3-24: note: in thunk for C++ function pointer type used here [InCppFunctionPointerThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE+9]]:3: error: function returns incomplete type `Cpp.Incomplete` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: Cpp.ReturnCallback()();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_use_forward_decl.carbon:[[@LINE+5]]:3-24: error: function returns incomplete type `Cpp.Incomplete` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: included from: fail_use_forward_decl.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./forward_decl.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: class Incomplete;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR:
|
||||
Cpp.ReturnCallback()();
|
||||
@@ -180,9 +172,7 @@ using MyCallbackType = void(*)(int);
|
||||
fn MyCallback(generic arg: i32);
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_convert_generic_arg.carbon:[[@LINE+4]]:43: error: semantics TODO: `binding maps to a non-type template parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR: var unused fn_ptr: Cpp.MyCallbackType = MyCallback;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_convert_generic_arg.carbon:[[@LINE+2]]:43-52: error: semantics TODO: `binding maps to a non-type template parameter` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
var unused fn_ptr: Cpp.MyCallbackType = MyCallback;
|
||||
}
|
||||
@@ -197,12 +187,8 @@ using MyCallbackType = void(*)(int);
|
||||
fn MyCallback(arg: i32) -> i32;
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_convert_type_mismatch.carbon:[[@LINE+7]]:43: error: can't convert exported function pointer to `void (*)(int)` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: var unused fn_ptr: Cpp.MyCallbackType = MyCallback;
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: fail_convert_type_mismatch.carbon:[[@LINE-6]]:1: note: function exported with pointer type `int (*)(int)` [ExportedFromFunction]
|
||||
// CHECK:STDERR: fn MyCallback(arg: i32) -> i32;
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_convert_type_mismatch.carbon:[[@LINE+3]]:43-52: error: can't convert exported function pointer to `void (*)(int)` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: fail_convert_type_mismatch.carbon:[[@LINE-4]]:1-31: note: function exported with pointer type `int (*)(int)` [ExportedFromFunction]
|
||||
// CHECK:STDERR:
|
||||
var unused fn_ptr: Cpp.MyCallbackType = MyCallback;
|
||||
}
|
||||
|
||||
@@ -37,9 +37,7 @@ fn MyF() {
|
||||
// --- without_definition.h
|
||||
|
||||
// TODO: Promote this warning to an error by default.
|
||||
// CHECK:STDERR: ./without_definition.h:[[@LINE+3]]:13: warning: inline function 'inline_without_def' is not defined [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | inline void inline_without_def();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: ./without_definition.h:[[@LINE+1]]:13: warning: inline function 'inline_without_def' is not defined [CppInteropParseWarning]
|
||||
inline void inline_without_def();
|
||||
|
||||
// --- todo_fail_import_without_definition.carbon
|
||||
@@ -50,9 +48,7 @@ import Cpp library "without_definition.h";
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: todo_fail_import_without_definition.carbon:[[@LINE+4]]:26: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | Cpp.inline_without_def();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: todo_fail_import_without_definition.carbon:[[@LINE+2]]:26: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR:
|
||||
Cpp.inline_without_def();
|
||||
|
||||
@@ -135,12 +131,12 @@ fn MyF() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @MyF() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %inline_without_def.ref.loc12: %inline_without_def.cpp_overload_set.type = name_ref inline_without_def, imports.%inline_without_def.cpp_overload_set.value [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.call.loc12: init %empty_tuple.type = call imports.%inline_without_def.decl()
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %inline_without_def.ref.loc15: %inline_without_def.cpp_overload_set.type = name_ref inline_without_def, imports.%inline_without_def.cpp_overload_set.value [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.call.loc15: init %empty_tuple.type = call imports.%inline_without_def.decl()
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %inline_without_def.ref.loc10: %inline_without_def.cpp_overload_set.type = name_ref inline_without_def, imports.%inline_without_def.cpp_overload_set.value [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.call.loc10: init %empty_tuple.type = call imports.%inline_without_def.decl()
|
||||
// CHECK:STDOUT: %Cpp.ref.loc13: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %inline_without_def.ref.loc13: %inline_without_def.cpp_overload_set.type = name_ref inline_without_def, imports.%inline_without_def.cpp_overload_set.value [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.call.loc13: init %empty_tuple.type = call imports.%inline_without_def.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -75,22 +75,14 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "method_ptr.h";
|
||||
|
||||
fn F(c: Cpp.C) {
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+18]]:3: error: member name of type `<C++ type void (C::*)(void) const>` in compound member access is not an instance member or an interface member [CompoundMemberAccessDoesNotUseBase]
|
||||
// CHECK:STDERR: c.(Cpp.GetMethodPtr())(42);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+10]]:3-24: error: member name of type `<C++ type void (C::*)(void) const>` in compound member access is not an instance member or an interface member [CompoundMemberAccessDoesNotUseBase]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+14]]:3: error: semantics TODO: `invoking a C++ member function pointer is unsupported` [SemanticsTodo]
|
||||
// CHECK:STDERR: c.(Cpp.GetMethodPtr())(42);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+8]]:3-28: error: semantics TODO: `invoking a C++ member function pointer is unsupported` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: error: called object type 'void (C::*)() const' is not a function or function pointer [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+9]]:3: note: in thunk for C++ function pointer type used here [InCppFunctionPointerThunk]
|
||||
// CHECK:STDERR: c.(Cpp.GetMethodPtr())(42);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+5]]:3-28: note: in thunk for C++ function pointer type used here [InCppFunctionPointerThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+5]]:3: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: c.(Cpp.GetMethodPtr())(42);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon:[[@LINE+3]]:3-28: error: 1 argument passed to function expecting 0 arguments [CallArgCountMismatch]
|
||||
// CHECK:STDERR: fail_todo_call_method_ptr.carbon: note: calling function declared here [InCallToEntity]
|
||||
// CHECK:STDERR:
|
||||
c.(Cpp.GetMethodPtr())(42);
|
||||
@@ -104,12 +96,8 @@ import Cpp library "method_ptr.h";
|
||||
fn F(ref c: Cpp.C);
|
||||
|
||||
fn G() {
|
||||
// CHECK:STDERR: fail_pass_function_for_method.carbon:[[@LINE+7]]:39: error: can't convert exported function pointer to `void (C::*)(void) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: var unused ptr: Cpp.MethodPtrType = F;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_pass_function_for_method.carbon:[[@LINE-6]]:1: note: function exported with pointer type `void (*)(class C &)` [ExportedFromFunction]
|
||||
// CHECK:STDERR: fn F(ref c: Cpp.C);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_pass_function_for_method.carbon:[[@LINE+3]]:39: error: can't convert exported function pointer to `void (C::*)(void) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: fail_pass_function_for_method.carbon:[[@LINE-4]]:1-19: note: function exported with pointer type `void (*)(class C &)` [ExportedFromFunction]
|
||||
// CHECK:STDERR:
|
||||
var unused ptr: Cpp.MethodPtrType = F;
|
||||
}
|
||||
@@ -124,12 +112,8 @@ class C {
|
||||
}
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_wrong_parent_type.carbon:[[@LINE+7]]:39: error: can't convert exported member function pointer to `void (C::*)(void) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: var unused ptr: Cpp.MethodPtrType = C.Method;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_parent_type.carbon:[[@LINE-7]]:3: note: function exported with pointer type `void (Carbon::C::*)(void) const` [ExportedFromFunction]
|
||||
// CHECK:STDERR: fn Method(self);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_wrong_parent_type.carbon:[[@LINE+3]]:39-46: error: can't convert exported member function pointer to `void (C::*)(void) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: fail_wrong_parent_type.carbon:[[@LINE-5]]:3-18: note: function exported with pointer type `void (Carbon::C::*)(void) const` [ExportedFromFunction]
|
||||
// CHECK:STDERR:
|
||||
var unused ptr: Cpp.MethodPtrType = C.Method;
|
||||
}
|
||||
@@ -149,12 +133,8 @@ using MethodPtrType = void(Carbon::C::*)(float) const;
|
||||
|
||||
fn G() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+7]]:39: error: can't convert exported member function pointer to `void (Carbon::C::*)(float) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: var unused ptr: Cpp.MethodPtrType = C.Method;
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE-12]]:3: note: function exported with pointer type `void (Carbon::C::*)(int) const` [ExportedFromFunction]
|
||||
// CHECK:STDERR: fn Method(self, i: i32);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE+3]]:39-46: error: can't convert exported member function pointer to `void (Carbon::C::*)(float) const` [ExportedFunctionPtrTypeMismatch]
|
||||
// CHECK:STDERR: fail_type_mismatch.carbon:[[@LINE-10]]:3-26: note: function exported with pointer type `void (Carbon::C::*)(int) const` [ExportedFromFunction]
|
||||
// CHECK:STDERR:
|
||||
var unused ptr: Cpp.MethodPtrType = C.Method;
|
||||
//@dump-sem-ir-end
|
||||
@@ -481,11 +461,11 @@ fn G() {
|
||||
// CHECK:STDOUT: %ptr.var_patt: %pattern_type.4b7 = var_pattern %ptr.patt [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.952: %pattern_type.4b7 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.a35: %pattern_type.4b7 = wrapper_binding_pattern self, %self.param_patt.952 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc22 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3: type = fn_type @Destroy.WithSelf.SubobjectDestroy.loc18 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.d01daf.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc22 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.3: type = fn_type @Destroy.WithSelf.Op.loc18 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.3: %Destroy.WithSelf.Op.type.ef016f.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc22 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3: type = fn_type @Destroy.WithSelf.SelfDestruct.loc18 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.3: %Destroy.WithSelf.SelfDestruct.type.fbceb5.3 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -497,14 +477,14 @@ fn G() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc22 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.decl.763c71.3: %Destroy.WithSelf.SubobjectDestroy.type.dfcbdb.3 = fn_decl @Destroy.WithSelf.SubobjectDestroy.loc18 [concrete = constants.%Destroy.WithSelf.SubobjectDestroy.d01daf.3] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.4b7 = ref_param_pattern [concrete = constants.%self.param_patt.952]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.4b7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a35]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %.659 = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %.659 = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc22 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.3: %Destroy.WithSelf.Op.type.ef016f.3 = fn_decl @Destroy.WithSelf.Op.loc18 [concrete = constants.%Destroy.WithSelf.Op.403171.3] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.4b7 = ref_param_pattern [concrete = constants.%self.param_patt.952]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.4b7 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a35]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -519,7 +499,7 @@ fn G() {
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %Method.ref: %C.Method.type = name_ref Method, @C.%C.Method.decl [concrete = constants.%C.Method]
|
||||
// CHECK:STDOUT: assign %ptr.var, <error>
|
||||
// CHECK:STDOUT: %.loc22: type = splice_block %MethodPtrType.ref [concrete = constants.%.659] {
|
||||
// CHECK:STDOUT: %.loc18: type = splice_block %MethodPtrType.ref [concrete = constants.%.659] {
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %MethodPtrType.ref: type = name_ref MethodPtrType, constants.%.659 [concrete = constants.%.659]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -536,16 +516,16 @@ fn G() {
|
||||
// CHECK:STDOUT: fn @C.Method__carbon_thunk(%self.param: ref %C, %_.param: ref %i32) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc22_40.1: %C = acquire_value %self.param
|
||||
// CHECK:STDOUT: %.loc22_40.2: %i32 = acquire_value %_.param
|
||||
// CHECK:STDOUT: %.loc18_40.1: %C = acquire_value %self.param
|
||||
// CHECK:STDOUT: %.loc18_40.2: %i32 = acquire_value %_.param
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc22(%self.param: ref %.659) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SubobjectDestroy.loc18(%self.param: ref %.659) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc22(%self.param: ref %.659) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc18(%self.param: ref %.659) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc22(%self.param: ref %.659) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc18(%self.param: ref %.659) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.3(%self.param)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SubobjectDestroy.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.SubobjectDestroy.decl.763c71.3(%self.param)
|
||||
|
||||
+8
-14
@@ -22,20 +22,14 @@ void F2(X x);
|
||||
|
||||
fn Call() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+7]]:10: error: no matching function for call to 'F1' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.F1();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-9]]:6: note: candidate function not viable: requires single argument 'x', but no arguments were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | void F1(X x);
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+4]]:3-8: error: no matching function for call to 'F1' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-7]]:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-8]]:9-11: note: requires single argument 'x', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.F1();
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+7]]:10: error: no matching function for call to 'F2' [CppInteropParseError]
|
||||
// CHECK:STDERR: 27 | Cpp.F2();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-16]]:6: note: candidate function not viable: requires single argument 'x', but no arguments were provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 7 | void F2(X x);
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE+4]]:3-8: error: no matching function for call to 'F2' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-11]]:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_call_too_few_args.carbon:[[@LINE-12]]:9-11: note: requires single argument 'x', but no arguments were provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.F2();
|
||||
//@dump-sem-ir-end
|
||||
@@ -63,9 +57,9 @@ fn Call() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Call() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %F1.ref: %F1.cpp_overload_set.type = name_ref F1, imports.%F1.cpp_overload_set.value [concrete = constants.%F1.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc27: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc21: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %F2.ref: %F2.cpp_overload_set.type = name_ref F2, imports.%F2.cpp_overload_set.value [concrete = constants.%F2.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
|
||||
@@ -140,13 +140,9 @@ import Cpp library "int_literal.h";
|
||||
fn F() {
|
||||
// TODO: get rid of the second error message here.
|
||||
// i128_max + 1
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+8]]:44: error: integer value 170141183460469231731687303715884105728 too large to fit in a signed C++ integer type; requires 129 bits, but max is 128 [IntTooLargeForCppType]
|
||||
// CHECK:STDERR: let unused h: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105728);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+4]]:44-82: error: integer value 170141183460469231731687303715884105728 too large to fit in a signed C++ integer type; requires 129 bits, but max is 128 [IntTooLargeForCppType]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+4]]:44: error: call argument of type `Core.IntLiteral` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: let unused h: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105728);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+2]]:44-82: error: call argument of type `Core.IntLiteral` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR:
|
||||
let unused h: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105728);
|
||||
}
|
||||
@@ -178,13 +174,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "negative_literal_passed_to_unsigned.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE+8]]:27: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: Cpp.neg_to_unsigned_foo(-1);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE+4]]:27-28: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: included from: fail_import_negative_literal_passed_to_unsigned.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./negative_literal_passed_to_unsigned.h:2:39: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto neg_to_unsigned_foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.neg_to_unsigned_foo(-1);
|
||||
}
|
||||
@@ -211,13 +203,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "floating_point_literal.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE+8]]:25: error: value 18*10^307 too large for floating-point type `f64` [FloatLiteralTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.float_literal_foo(1.8e+308);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE+4]]:25-32: error: value 18*10^307 too large for floating-point type `f64` [FloatLiteralTooLargeForType]
|
||||
// CHECK:STDERR: included from: fail_import_large_floating_point_literal.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./floating_point_literal.h:3:31: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto float_literal_foo(double a) -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.float_literal_foo(1.8e+308);
|
||||
}
|
||||
@@ -261,68 +249,38 @@ import Cpp library "struct_init.h";
|
||||
fn MakeThreeFields() -> {.a: i32, .b: i32, .c: i32};
|
||||
|
||||
fn ThreeFields(value: {.a: i32, .b: i32, .c: i32}, ref reference: {.a: i32, .b: i32, .c: i32}) {
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+8]]:23: note: type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE-11]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-46: error: cannot implicitly convert expression of type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-46: note: type `{.a: Core.IntLiteral, .b: Core.IntLiteral, .c: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3});
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+8]]:23: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE-24]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-27: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-27: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(value);
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+8]]:23: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE-37]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-31: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-31: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-21]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(reference);
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(MakeThreeFields());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+8]]:23: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(MakeThreeFields());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE-50]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-39: error: cannot implicitly convert expression of type `{.a: i32, .b: i32, .c: i32}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-39: note: type `{.a: i32, .b: i32, .c: i32}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-28]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(MakeThreeFields());
|
||||
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields({.b = 1, .c = 2, .a = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+8]]:23: note: type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields({.b = 1, .c = 2, .a = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE-63]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+5]]:23-46: error: cannot implicitly convert expression of type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_struct_init_nonempty.carbon:[[@LINE+4]]:23-46: note: type `{.b: Core.IntLiteral, .c: Core.IntLiteral, .a: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_struct_init_nonempty.carbon:[[@LINE-35]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.b = 1, .c = 2, .a = 3});
|
||||
}
|
||||
@@ -334,23 +292,17 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "struct_init.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+8]]:55: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3, .d = 4});
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:6: note: candidate function not viable: cannot convert initializer list argument to 'ThreeFields' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 10 | auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_struct_init_field_mismatch.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./struct_init.h:10:22-34: note: cannot convert initializer list argument to 'ThreeFields' [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.a = 1, .b = 2, .c = 3, .d = 4});
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+8]]:47: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: 25 | Cpp.PassThreeFields({.a = 1, .x = 2, .c = 3});
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE-16]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:6: note: candidate function not viable: cannot convert initializer list argument to 'ThreeFields' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 10 | auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_field_mismatch.carbon:[[@LINE+5]]:3-21: error: no matching function for call to 'PassThreeFields' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_struct_init_field_mismatch.carbon:[[@LINE-11]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./struct_init.h:10:22-34: note: cannot convert initializer list argument to 'ThreeFields' [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.a = 1, .x = 2, .c = 3});
|
||||
}
|
||||
@@ -362,9 +314,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "struct_init.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_struct_init_unsupported_field_name.carbon:[[@LINE+4]]:23: error: field name `base` cannot be mapped into C++ [CppCallFieldNameNotSupported]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields({.base = 1});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_unsupported_field_name.carbon:[[@LINE+2]]:23-33: error: field name `base` cannot be mapped into C++ [CppCallFieldNameNotSupported]
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields({.base = 1});
|
||||
}
|
||||
@@ -381,55 +331,31 @@ import Cpp library "struct_init.h";
|
||||
fn MakeEmpty() -> ();
|
||||
|
||||
fn Empty(value: (), ref reference: ()) {
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-21: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-21: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-10]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(());
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-24: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-24: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-17]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(value);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-40]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-28: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-28: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-24]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(reference);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:20: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(MakeEmpty());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:20: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassNoFields(MakeEmpty());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-53]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:20-30: error: cannot implicitly convert expression of type `()` to `Cpp.NoFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:20-30: note: type `()` does not implement interface `Core.ImplicitAs(Cpp.NoFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-31]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:4:28: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassNoFields(NoFields s) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassNoFields(MakeEmpty());
|
||||
}
|
||||
@@ -437,55 +363,31 @@ fn Empty(value: (), ref reference: ()) {
|
||||
fn MakeThreeFields() -> (i32, i32, i32);
|
||||
|
||||
fn ThreeFields(value: (i32, i32, i32), ref reference: (i32, i32, i32)) {
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields((1, 2, 3));
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields((1, 2, 3));
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-70]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-31: error: cannot implicitly convert expression of type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-31: note: type `(Core.IntLiteral, Core.IntLiteral, Core.IntLiteral)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-42]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields((1, 2, 3));
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(value);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-83]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-27: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-27: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-49]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(value);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(reference);
|
||||
// CHECK:STDERR: ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-96]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-31: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-31: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-56]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(reference);
|
||||
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+11]]:23: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(MakeThreeFields());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+8]]:23: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassThreeFields(MakeThreeFields());
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE-109]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+5]]:23-39: error: cannot implicitly convert expression of type `(i32, i32, i32)` to `Cpp.ThreeFields` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_struct_init_from_tuple.carbon:[[@LINE+4]]:23-39: note: type `(i32, i32, i32)` does not implement interface `Core.ImplicitAs(Cpp.ThreeFields)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_struct_init_from_tuple.carbon:[[@LINE-63]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./struct_init.h:10:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassThreeFields(ThreeFields t) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassThreeFields(MakeThreeFields());
|
||||
}
|
||||
@@ -508,29 +410,17 @@ import Cpp library "int_from_struct.h";
|
||||
fn F() {
|
||||
// C++ permits `{}` to be used to initialize an int, but Carbon does not.
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+11]]:15: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassInt({});
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+8]]:15: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassInt({});
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE-11]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+5]]:15-16: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+4]]:15-16: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_from_struct.h:2:18: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassInt(int n) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassInt({});
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+11]]:15: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassInt(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+8]]:15: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassInt(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE-24]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+5]]:15-16: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct.carbon:[[@LINE+4]]:15-16: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_from_struct.h:2:18: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassInt(int n) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassInt(());
|
||||
}
|
||||
@@ -545,29 +435,17 @@ fn F() {
|
||||
// C++ overload resolution prefers to convert `{}` to `int` rather than to an
|
||||
// empty struct. So that's the overload we pick, even though we can't call it.
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+11]]:22: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassOverloaded({});
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+8]]:22: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassOverloaded({});
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE-12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+5]]:22-23: error: cannot implicitly convert expression of type `{}` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+4]]:22-23: note: type `{}` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct_overloaded.carbon:[[@LINE-8]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_from_struct.h:6:25: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassOverloaded(int n) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassOverloaded({});
|
||||
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+11]]:22: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.PassOverloaded(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+8]]:22: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.PassOverloaded(());
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE-25]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+5]]:22-23: error: cannot implicitly convert expression of type `()` to `i32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_int_from_struct_overloaded.carbon:[[@LINE+4]]:22-23: note: type `()` does not implement interface `Core.ImplicitAs(i32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_int_from_struct_overloaded.carbon:[[@LINE-15]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./int_from_struct.h:6:25: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto PassOverloaded(int n) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.PassOverloaded(());
|
||||
}
|
||||
@@ -592,13 +470,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "nested_structs.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_pass_nested_structs_inner_field_mismatch.carbon:[[@LINE+8]]:44: error: no matching function for call to 'TakeB' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | Cpp.TakeB({.a = {.x = 1, .z = 2}, .n = 3});
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_pass_nested_structs_inner_field_mismatch.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./nested_structs.h:11:6: note: candidate function not viable: cannot convert initializer list argument to 'B' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 11 | void TakeB(B);
|
||||
// CHECK:STDERR: | ^ ~
|
||||
// CHECK:STDERR: fail_pass_nested_structs_inner_field_mismatch.carbon:[[@LINE+5]]:3-11: error: no matching function for call to 'TakeB' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_pass_nested_structs_inner_field_mismatch.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./nested_structs.h:11:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./nested_structs.h:11:12: note: cannot convert initializer list argument to 'B' [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakeB({.a = {.x = 1, .z = 2}, .n = 3});
|
||||
}
|
||||
@@ -610,16 +485,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "nested_structs.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+11]]:13: error: cannot implicitly convert expression of type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` to `Cpp.B` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.TakeB({.a = {.x = 1, .y = 2}, .n = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+8]]:13: note: type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.B)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.TakeB({.a = {.x = 1, .y = 2}, .n = 3});
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+5]]:13-43: error: cannot implicitly convert expression of type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` to `Cpp.B` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_todo_pass_nested_structs.carbon:[[@LINE+4]]:13-43: note: type `{.a: {.x: Core.IntLiteral, .y: Core.IntLiteral}, .n: Core.IntLiteral}` does not implement interface `Core.ImplicitAs(Cpp.B)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_todo_pass_nested_structs.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./nested_structs.h:11:13: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: void TakeB(B);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakeB({.a = {.x = 1, .y = 2}, .n = 3});
|
||||
}
|
||||
@@ -653,16 +522,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "signedness_change.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+11]]:22: error: cannot implicitly convert expression of type `i32` to `u32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.signedness_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+8]]:22: note: type `i32` does not implement interface `Core.ImplicitAs(u32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.signedness_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+5]]:22-29: error: cannot implicitly convert expression of type `i32` to `u32` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+4]]:22-29: note: type `i32` does not implement interface `Core.ImplicitAs(u32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_signedness_change_rejected.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./signedness_change.h:2:34: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto signedness_foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.signedness_foo(1 as i32);
|
||||
}
|
||||
@@ -678,16 +541,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "downsizing_rejected.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+11]]:22: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.downsizing_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+8]]:22: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.downsizing_foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+5]]:22-29: error: cannot implicitly convert expression of type `i32` to `i16` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.carbon:[[@LINE+4]]:22-29: note: type `i32` does not implement interface `Core.ImplicitAs(i16)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: included from: fail_import_downsizing_rejected.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./downsizing_rejected.h:2:27: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto downsizing_foo(short a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.downsizing_foo(1 as i32);
|
||||
}
|
||||
@@ -707,13 +564,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "no_viable_function.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE+8]]:29: error: no matching function for call to 'no_viable_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | Cpp.no_viable_foo(1 as i64);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./no_viable_function.h:2:6: note: candidate function not viable: requires 2 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto no_viable_foo(short a, int b) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE+5]]:3-19: error: no matching function for call to 'no_viable_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_no_viable_function.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./no_viable_function.h:2:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./no_viable_function.h:2:20-33: note: requires 2 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.no_viable_foo(1 as i64);
|
||||
}
|
||||
@@ -734,17 +588,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "ambiguous_overload.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE+12]]:29: error: call to 'ambiguous_foo' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.ambiguous_foo(1 as i64);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE+5]]:3-19: error: call to 'ambiguous_foo' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_ambiguous_overload.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./ambiguous_overload.h:2:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto ambiguous_foo(short a) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./ambiguous_overload.h:3:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | auto ambiguous_foo(int a) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.ambiguous_foo(1 as i64);
|
||||
}
|
||||
@@ -765,17 +612,10 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "deleted_function.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE+12]]:27: error: call to deleted function 'deleted_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.deleted_foo(1 as i32);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE+5]]:3-17: error: call to deleted function 'deleted_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_deleted_function.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./deleted_function.h:3:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | auto deleted_foo(int a) -> void = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./deleted_function.h:2:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto deleted_foo(short a) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.deleted_foo(1 as i32);
|
||||
}
|
||||
@@ -793,12 +633,8 @@ interface I {}
|
||||
fn EchoValue[ValueT: I](unused generic value: ValueT) {}
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_missing_impl.carbon:[[@LINE+7]]:3: error: cannot convert type `<type of Cpp.missing_impl_foo>` into type implementing `I` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EchoValue(Cpp.missing_impl_foo);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_missing_impl.carbon:[[@LINE-6]]:1: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR: fn EchoValue[ValueT: I](unused generic value: ValueT) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_missing_impl.carbon:[[@LINE+3]]:3-33: error: cannot convert type `<type of Cpp.missing_impl_foo>` into type implementing `I` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: fail_missing_impl.carbon:[[@LINE-4]]:1-55: note: while deducing parameters of generic declared here [DeductionGenericHere]
|
||||
// CHECK:STDERR:
|
||||
EchoValue(Cpp.missing_impl_foo);
|
||||
}
|
||||
+5
-15
@@ -26,9 +26,7 @@ import Cpp library "unsupported_primitive_type.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_primitive_type.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo(11);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_primitive_type.carbon:[[@LINE+2]]:3-13: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(11);
|
||||
//@dump-sem-ir-end
|
||||
@@ -50,9 +48,7 @@ import Cpp library "unsupported_primitive_type_among_params.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_primitive_type_among_params.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.foo(1, 20);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_todo_import_unsupported_primitive_type_among_params.carbon:[[@LINE+2]]:3-16: error: semantics TODO: `Unsupported: parameter type: _BitInt(23)` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1, 20);
|
||||
//@dump-sem-ir-end
|
||||
@@ -74,13 +70,9 @@ import Cpp library "int_param.h";
|
||||
|
||||
// This doesn't have a direct type mapping in `getIntTypeForBitwidth`.
|
||||
fn F(x: i512) {
|
||||
// CHECK:STDERR: fail_large_int.carbon:[[@LINE+8]]:11: error: call argument of type `i512` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: Cpp.foo(x);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_large_int.carbon:[[@LINE+4]]:11: error: call argument of type `i512` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: min_prelude/parts/int.carbon:10:1: error: semantics TODO: `interop with non-identifier package name` [SemanticsTodo]
|
||||
// CHECK:STDERR: class Int(N: IntLiteral) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: min_prelude/parts/int.carbon:10:1-26: error: semantics TODO: `interop with non-identifier package name` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(x);
|
||||
}
|
||||
@@ -93,9 +85,7 @@ import Cpp library "int_param.h";
|
||||
|
||||
// This doesn't fit as an embedded `IntId` value.
|
||||
fn F(x: i8388608) {
|
||||
// CHECK:STDERR: fail_very_large_int.carbon:[[@LINE+4]]:11: error: call argument of type `i8388608` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: Cpp.foo(x);
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_very_large_int.carbon:[[@LINE+2]]:11: error: call argument of type `i8388608` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(x);
|
||||
}
|
||||
|
||||
@@ -43,13 +43,10 @@ fn G() -> const Cpp.NonNullableParamS;
|
||||
|
||||
fn F() {
|
||||
var s: const Cpp.NonNullableParamS = G();
|
||||
// CHECK:STDERR: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE+8]]:32: error: no matching function for call to 'non_nullable_param_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 18 | Cpp.non_nullable_param_foo(&s);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./non_nullable_pointer_param.h:4:6: note: candidate function not viable: 1st argument ('const NonNullableParamS * _Nonnull') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | auto non_nullable_param_foo(NonNullableParamS* _Nonnull) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE+5]]:3-28: error: no matching function for call to 'non_nullable_param_foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./non_nullable_pointer_param.h:4:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./non_nullable_pointer_param.h:4:29-55: note: 1st argument ('const NonNullableParamS * _Nonnull') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.non_nullable_param_foo(&s);
|
||||
}
|
||||
@@ -417,12 +414,8 @@ import Cpp library "deduced_pointer_param.h";
|
||||
|
||||
fn F() {
|
||||
// This could return a null pointer, so should not be given the type `Cpp.DeducedPointerS*`.
|
||||
// CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+7]]:40: error: cannot implicitly convert expression of type `Core.Optional(Cpp.DeducedPointerS* as Core.OptionalStorage)` to `Cpp.DeducedPointerS*` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused a: Cpp.DeducedPointerS* = Cpp.Indirect({} as Cpp.DeducedPointerS);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+4]]:40: note: type `Core.Optional(Cpp.DeducedPointerS* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(Cpp.DeducedPointerS*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused a: Cpp.DeducedPointerS* = Cpp.Indirect({} as Cpp.DeducedPointerS);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+3]]:40-78: error: cannot implicitly convert expression of type `Core.Optional(Cpp.DeducedPointerS* as Core.OptionalStorage)` to `Cpp.DeducedPointerS*` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_import_deduced_pointer_param_as_optional_pointer.carbon:[[@LINE+2]]:40-78: note: type `Core.Optional(Cpp.DeducedPointerS* as Core.OptionalStorage)` does not implement interface `Core.ImplicitAs(Cpp.DeducedPointerS*)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused a: Cpp.DeducedPointerS* = Cpp.Indirect({} as Cpp.DeducedPointerS);
|
||||
}
|
||||
|
||||
+154
-195
@@ -44,45 +44,33 @@ fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var v: Cpp.S;
|
||||
let s: Cpp.S = v;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 18 | Cpp.TakesLValue(s);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-7]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesLValue(s);
|
||||
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:35: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 28 | Cpp.TakesLValue(s as const Cpp.S);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-19]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesLValue(s as const Cpp.S);
|
||||
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 39 | Cpp.TakesLValue(t);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-30]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: no known conversion from 'T' to 'S &' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-22]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: no known conversion from 'T' to 'S &' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesLValue(t);
|
||||
|
||||
var u: Cpp.S;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+8]]:35: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 50 | Cpp.TakesLValue(u as const Cpp.S);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE-41]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesLValue(S&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref.carbon:[[@LINE-30]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_lvalue_ref.h:5:18-19: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesLValue(u as const Cpp.S);
|
||||
//@dump-sem-ir-end
|
||||
@@ -135,13 +123,10 @@ import Cpp library "param_rvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
let s: Cpp.S = {};
|
||||
// CHECK:STDERR: fail_param_value_arg_for_rvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 16 | Cpp.TakesRValue(s);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_value_arg_for_rvalue_ref.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesRValue(S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_param_value_arg_for_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_value_arg_for_rvalue_ref.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesRValue(s);
|
||||
}
|
||||
@@ -155,34 +140,25 @@ import Cpp library "param_rvalue_ref.h";
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var s: Cpp.S;
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Cpp.TakesRValue(s);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable: expects an rvalue for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesRValue(S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_rvalue_ref.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: expects an rvalue for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesRValue(s);
|
||||
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+8]]:20: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 28 | Cpp.TakesRValue(t);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE-19]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable: no known conversion from 'T' to 'S' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesRValue(S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_rvalue_ref.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: no known conversion from 'T' to 'S' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesRValue(t);
|
||||
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+8]]:47: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 38 | Cpp.TakesRValue(({} as Cpp.S) as const Cpp.S);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE-29]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable: 1st argument ('const S') would lose const qualifier [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesRValue(S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~
|
||||
// CHECK:STDERR: fail_param_rvalue_ref.carbon:[[@LINE+5]]:3-17: error: no matching function for call to 'TakesRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_rvalue_ref.carbon:[[@LINE-21]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_rvalue_ref.h:5:18-20: note: 1st argument ('const S') would lose const qualifier [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesRValue(({} as Cpp.S) as const Cpp.S);
|
||||
//@dump-sem-ir-end
|
||||
@@ -237,13 +213,10 @@ import Cpp library "param_const_lvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE+8]]:25: error: no matching function for call to 'TakesConstLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 16 | Cpp.TakesConstLValue(t);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_lvalue_ref.h:5:6: note: candidate function not viable: no known conversion from 'T' to 'const S' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesConstLValue(const S&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE+5]]:3-22: error: no matching function for call to 'TakesConstLValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_call_param_const_lvalue_ref_with_wrong_type.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_lvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_const_lvalue_ref.h:5:23-30: note: no known conversion from 'T' to 'const S' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesConstLValue(t);
|
||||
}
|
||||
@@ -296,24 +269,18 @@ import Cpp library "param_const_rvalue_ref.h";
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var s: Cpp.S;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+8]]:25: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Cpp.TakesConstRValue(s);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE-8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:6: note: candidate function not viable: expects an rvalue for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesConstRValue(const S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+5]]:3-22: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:23-31: note: expects an rvalue for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesConstRValue(s);
|
||||
|
||||
var t: Cpp.T;
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+8]]:25: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: 28 | Cpp.TakesConstRValue(t);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE-19]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:6: note: candidate function not viable: no known conversion from 'T' to 'const S' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | auto TakesConstRValue(const S&&) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~
|
||||
// CHECK:STDERR: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE+5]]:3-22: error: no matching function for call to 'TakesConstRValue' [CppInteropParseError]
|
||||
// CHECK:STDERR: included from: fail_param_lvalue_ref_arg_const_rvalue_ref.carbon:[[@LINE-14]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:6: note: candidate function not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: ./param_const_rvalue_ref.h:5:23-31: note: no known conversion from 'T' to 'const S' for 1st argument [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakesConstRValue(t);
|
||||
//@dump-sem-ir-end
|
||||
@@ -392,12 +359,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "return_const_lvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+7]]:29: error: cannot implicitly convert expression of type `const Cpp.S` to `Cpp.S` [ConversionFailure]
|
||||
// CHECK:STDERR: let unused ref s: Cpp.S = Cpp.ReturnConstLValue();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+4]]:29: note: type `const Cpp.S` does not implement interface `Core.ImplicitAs(Cpp.S)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: let unused ref s: Cpp.S = Cpp.ReturnConstLValue();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+3]]:29-51: error: cannot implicitly convert expression of type `const Cpp.S` to `Cpp.S` [ConversionFailure]
|
||||
// CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+2]]:29-51: note: type `const Cpp.S` does not implement interface `Core.ImplicitAs(Cpp.S)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR:
|
||||
let unused ref s: Cpp.S = Cpp.ReturnConstLValue();
|
||||
}
|
||||
@@ -471,12 +434,8 @@ template<typename T> void TakeAnything_ExpectConstLRef_ByRef(T&&) {
|
||||
''';
|
||||
|
||||
fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE+7]]:42: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: Cpp.TakeAnything_ExpectConstLRef_ByRef(ref x);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE-9]]:65: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: template<typename T> void TakeAnything_ExpectConstLRef_ByRef(T&&) {
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE+3]]:42-46: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE-7]]:65: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR:
|
||||
Cpp.TakeAnything_ExpectConstLRef_ByRef(ref x);
|
||||
}
|
||||
@@ -613,17 +572,17 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete]
|
||||
// CHECK:STDOUT: %S.cpp_destructor.type: type = fn_type @S.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %S.cpp_destructor: %S.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc41 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc32 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc41 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc32 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.0e6: %pattern_type.5f6 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.eb3: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt.0e6 [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor.type: type = fn_type @T.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor: %T.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc30 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.2: type = fn_type @Destroy.WithSelf.Op.loc24 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.2: %Destroy.WithSelf.Op.type.ef016f.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc30 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2: type = fn_type @Destroy.WithSelf.SelfDestruct.loc24 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.2: %Destroy.WithSelf.SelfDestruct.type.fbceb5.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -652,14 +611,14 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc41 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc32 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.0f5 = ref_param_pattern [concrete = constants.%self.param_patt.63c]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.a18]
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %self.param: ref %S = ref_param call_param0
|
||||
// CHECK:STDOUT: %self: ref %S = wrapper_binding self, %self.param
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc30 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.2: %Destroy.WithSelf.Op.type.ef016f.2 = fn_decl @Destroy.WithSelf.Op.loc24 [concrete = constants.%Destroy.WithSelf.Op.403171.2] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.5f6 = ref_param_pattern [concrete = constants.%self.param_patt.0e6]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb3]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -698,28 +657,28 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.0f5 = value_binding_pattern s [concrete = constants.%s.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc18: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc18: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc28: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc28: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc28: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc28: type = const_type %S.ref.loc28 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc28_21.1: %const = as_compatible %s.ref.loc28
|
||||
// CHECK:STDOUT: %.loc28_21.2: %const = converted %s.ref.loc28, %.loc28_21.1
|
||||
// CHECK:STDOUT: %Cpp.ref.loc15: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc15: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc15: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc22: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref.loc22: %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc22: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc22: type = const_type %S.ref.loc22 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc22_21.1: %const = as_compatible %s.ref.loc22
|
||||
// CHECK:STDOUT: %.loc22_21.2: %const = converted %s.ref.loc22, %.loc22_21.1
|
||||
// CHECK:STDOUT: %t.var: ref %T.ed0 = var_storage %t.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc30: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc30_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc30 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc30: type = facet_access_type %.loc30_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc30_15.2: type = converted %.loc30_15.1, %as_type.loc30 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc24: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc24_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc24 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc24: type = facet_access_type %.loc24_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc24_15.2: type = converted %.loc24_15.1, %as_type.loc24 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc30_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc30: init %T.ed0 to %.loc30_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc30
|
||||
// CHECK:STDOUT: %.loc30_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc24_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc24: init %T.ed0 to %.loc24_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc24
|
||||
// CHECK:STDOUT: %.loc24_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc24: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, imports.%T.decl [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t: ref %T.ed0 = wrapper_binding t, %t.var
|
||||
@@ -727,56 +686,56 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %t.patt: %pattern_type.5f6 = ref_binding_pattern t [concrete = constants.%t.patt]
|
||||
// CHECK:STDOUT: %t.var_patt: %pattern_type.5f6 = var_pattern %t.patt [concrete = constants.%t.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc39: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc39: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc30: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %t.ref: ref %T.ed0 = name_ref t, %t
|
||||
// CHECK:STDOUT: %u.var: ref %S = var_storage %u.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc41: %DefaultOrUnformed.type = facet_value constants.%S, (constants.%DefaultOrUnformed.impl_witness.e4a) [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %.loc41_15.1: %DefaultOrUnformed.type = converted constants.%S, %DefaultOrUnformed.facet.loc41 [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %as_type.loc41: type = facet_access_type %.loc41_15.1 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc41_15.2: type = converted %.loc41_15.1, %as_type.loc41 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc32: %DefaultOrUnformed.type = facet_value constants.%S, (constants.%DefaultOrUnformed.impl_witness.e4a) [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %.loc32_15.1: %DefaultOrUnformed.type = converted constants.%S, %DefaultOrUnformed.facet.loc32 [concrete = constants.%DefaultOrUnformed.facet.cbb]
|
||||
// CHECK:STDOUT: %as_type.loc32: type = facet_access_type %.loc32_15.1 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc32_15.2: type = converted %.loc32_15.1, %as_type.loc32 [concrete = constants.%S]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc41_3: ref %S = splice_block %u.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc41: init %S to %.loc41_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.3()
|
||||
// CHECK:STDOUT: assign %u.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc41
|
||||
// CHECK:STDOUT: %.loc41_13: type = splice_block %S.ref.loc41 [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc41: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc41: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc32_3: ref %S = splice_block %u.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc32: init %S to %.loc32_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.3()
|
||||
// CHECK:STDOUT: assign %u.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc32
|
||||
// CHECK:STDOUT: %.loc32_13: type = splice_block %S.ref.loc32 [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc32: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc32: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %u: ref %S = wrapper_binding u, %u.var
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %u.patt: %pattern_type.0f5 = ref_binding_pattern u [concrete = constants.%u.patt]
|
||||
// CHECK:STDOUT: %u.var_patt: %pattern_type.0f5 = var_pattern %u.patt [concrete = constants.%u.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc50_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc50: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesLValue.ref.loc38: %TakesLValue.cpp_overload_set.type = name_ref TakesLValue, imports.%TakesLValue.cpp_overload_set.value [concrete = constants.%TakesLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %u.ref: ref %S = name_ref u, %u
|
||||
// CHECK:STDOUT: %Cpp.ref.loc50_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc50: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc50: type = const_type %S.ref.loc50 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc50_21.1: ref %const = as_compatible %u.ref
|
||||
// CHECK:STDOUT: %.loc50_21.2: ref %const = converted %u.ref, %.loc50_21.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc41: <bound method> = bound_method %u.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc41: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc41(%u.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc30: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc30: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc30(%t.var)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_30: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc38: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const.loc38: type = const_type %S.ref.loc38 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc38_21.1: ref %const = as_compatible %u.ref
|
||||
// CHECK:STDOUT: %.loc38_21.2: ref %const = converted %u.ref, %.loc38_21.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc32: <bound method> = bound_method %u.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc32: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc32(%u.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc24: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc24: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc24(%t.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %v.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%v.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc41(%self.param: ref %S) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc32(%self.param: ref %S) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc41(%self.param: ref %S) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc32(%self.param: ref %S) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %S.cpp_destructor.call: init %empty_tuple.type = call imports.%S.cpp_destructor.decl(%self.param)
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc30(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc24(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc30(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc24(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.2(%self.param)
|
||||
// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call imports.%T.cpp_destructor.decl(%self.param)
|
||||
@@ -871,9 +830,9 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %self.patt.eb3: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt.0e6 [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor.type: type = fn_type @T.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor: %T.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.63c: %pattern_type.0f5 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete]
|
||||
@@ -910,7 +869,7 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.5f6 = ref_param_pattern [concrete = constants.%self.param_patt.0e6]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb3]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -946,20 +905,20 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.0f5 = ref_binding_pattern s [concrete = constants.%s.patt]
|
||||
// CHECK:STDOUT: %s.var_patt: %pattern_type.0f5 = var_pattern %s.patt [concrete = constants.%s.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc17: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc14: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %t.var: ref %T.ed0 = var_storage %t.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc19: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc19_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc19 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc19: type = facet_access_type %.loc19_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc19_15.2: type = converted %.loc19_15.1, %as_type.loc19 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc16: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc16_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc16 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc16: type = facet_access_type %.loc16_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc16_15.2: type = converted %.loc16_15.1, %as_type.loc16 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc19_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc19: init %T.ed0 to %.loc19_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc19
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc16_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16: init %T.ed0 to %.loc16_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16
|
||||
// CHECK:STDOUT: %.loc16_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, imports.%T.decl [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t: ref %T.ed0 = wrapper_binding t, %t.var
|
||||
@@ -967,32 +926,32 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %t.patt: %pattern_type.5f6 = ref_binding_pattern t [concrete = constants.%t.patt]
|
||||
// CHECK:STDOUT: %t.var_patt: %pattern_type.5f6 = var_pattern %t.patt [concrete = constants.%t.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc28: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc22: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %t.ref: ref %T.ed0 = name_ref t, %t
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc38: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc38_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc38_29: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc38_21.2: ref %S = temporary_storage
|
||||
// CHECK:STDOUT: %.loc38_21.3: init %S to %.loc38_21.2 = class_init () [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %.loc38_23: init %S = converted %.loc38_21.1, %.loc38_21.3 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc38_42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc38_45: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const: type = const_type %S.ref.loc38_45 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc38_33.1: init %const = as_compatible %.loc38_23 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %.loc38_33.2: init %const = converted %.loc38_23, %.loc38_33.1 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%t.var)
|
||||
// CHECK:STDOUT: %Cpp.ref.loc29_3: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesRValue.ref.loc29: %TakesRValue.cpp_overload_set.type = name_ref TakesRValue, imports.%TakesRValue.cpp_overload_set.value [concrete = constants.%TakesRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %.loc29_21.1: %empty_struct_type = struct_literal () [concrete = constants.%empty_struct.a40]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc29_26: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc29_29: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %.loc29_21.2: ref %S = temporary_storage
|
||||
// CHECK:STDOUT: %.loc29_21.3: init %S to %.loc29_21.2 = class_init () [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %.loc29_23: init %S = converted %.loc29_21.1, %.loc29_21.3 [concrete = constants.%S.val]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc29_42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %S.ref.loc29_45: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
||||
// CHECK:STDOUT: %const: type = const_type %S.ref.loc29_45 [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %.loc29_33.1: init %const = as_compatible %.loc29_23 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %.loc29_33.2: init %const = converted %.loc29_23, %.loc29_33.1 [concrete = constants.%empty_struct.674]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%t.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%s.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call imports.%T.cpp_destructor.decl(%self.param)
|
||||
@@ -1323,9 +1282,9 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %self.patt.eb3: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt.0e6 [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor.type: type = fn_type @T.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %T.cpp_destructor: %T.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.type.ef016f.1: type = fn_type @Destroy.WithSelf.Op.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.403171.1: %Destroy.WithSelf.Op.type.ef016f.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc19 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1: type = fn_type @Destroy.WithSelf.SelfDestruct.loc16 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.db3fdb.1: %Destroy.WithSelf.SelfDestruct.type.fbceb5.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %self.param_patt.63c: %pattern_type.0f5 = ref_param_pattern [concrete]
|
||||
// CHECK:STDOUT: %self.patt.a18: %pattern_type.0f5 = wrapper_binding_pattern self, %self.param_patt.63c [concrete]
|
||||
@@ -1362,7 +1321,7 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: generated {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc19 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.decl.5f94cf.1: %Destroy.WithSelf.Op.type.ef016f.1 = fn_decl @Destroy.WithSelf.Op.loc16 [concrete = constants.%Destroy.WithSelf.Op.403171.1] {
|
||||
// CHECK:STDOUT: %self.param_patt: %pattern_type.5f6 = ref_param_pattern [concrete = constants.%self.param_patt.0e6]
|
||||
// CHECK:STDOUT: %self.patt: %pattern_type.5f6 = wrapper_binding_pattern self, %self.param_patt [concrete = constants.%self.patt.eb3]
|
||||
// CHECK:STDOUT: } {
|
||||
@@ -1398,20 +1357,20 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.0f5 = ref_binding_pattern s [concrete = constants.%s.patt]
|
||||
// CHECK:STDOUT: %s.var_patt: %pattern_type.0f5 = var_pattern %s.patt [concrete = constants.%s.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc17: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc17: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc14: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref: ref %S = name_ref s, %s
|
||||
// CHECK:STDOUT: %t.var: ref %T.ed0 = var_storage %t.var_patt
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc19: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc19_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc19 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc19: type = facet_access_type %.loc19_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc19_15.2: type = converted %.loc19_15.1, %as_type.loc19 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %DefaultOrUnformed.facet.loc16: %DefaultOrUnformed.type = facet_value constants.%T.ed0, (constants.%DefaultOrUnformed.impl_witness.307) [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %.loc16_15.1: %DefaultOrUnformed.type = converted constants.%T.ed0, %DefaultOrUnformed.facet.loc16 [concrete = constants.%DefaultOrUnformed.facet.d8b]
|
||||
// CHECK:STDOUT: %as_type.loc16: type = facet_access_type %.loc16_15.1 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: %.loc16_15.2: type = converted %.loc16_15.1, %as_type.loc16 [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc19_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc19: init %T.ed0 to %.loc19_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc19
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc16_3: ref %T.ed0 = splice_block %t.var {}
|
||||
// CHECK:STDOUT: %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16: init %T.ed0 to %.loc16_3 = call %T.as_type.as.DefaultOrUnformed.impl.Op.specific_fn.2()
|
||||
// CHECK:STDOUT: assign %t.var, %T.as_type.as.DefaultOrUnformed.impl.Op.call.loc16
|
||||
// CHECK:STDOUT: %.loc16_13: type = splice_block %T.ref [concrete = constants.%T.ed0] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %T.ref: type = name_ref T, imports.%T.decl [concrete = constants.%T.ed0]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %t: ref %T.ed0 = wrapper_binding t, %t.var
|
||||
@@ -1419,19 +1378,19 @@ fn PassConstRef(ref x: const XByRef) {
|
||||
// CHECK:STDOUT: %t.patt: %pattern_type.5f6 = ref_binding_pattern t [concrete = constants.%t.patt]
|
||||
// CHECK:STDOUT: %t.var_patt: %pattern_type.5f6 = var_pattern %t.patt [concrete = constants.%t.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc28: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc28: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %TakesConstRValue.ref.loc22: %TakesConstRValue.cpp_overload_set.type = name_ref TakesConstRValue, imports.%TakesConstRValue.cpp_overload_set.value [concrete = constants.%TakesConstRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %t.ref: ref %T.ed0 = name_ref t, %t
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc19: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc19: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc19(%t.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc16: <bound method> = bound_method %t.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.1
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc16: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc16(%t.var)
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.bound.loc8: <bound method> = bound_method %s.var, constants.%Destroy.WithSelf.SelfDestruct.db3fdb.2
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.SelfDestruct.call.loc8: init %empty_tuple.type = call %Destroy.WithSelf.SelfDestruct.bound.loc8(%s.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc19(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.Op.loc16(%self.param: ref %T.ed0) = "no_op";
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc19(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: fn @Destroy.WithSelf.SelfDestruct.loc16(%self.param: ref %T.ed0) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Destroy.WithSelf.Op.call: init %empty_tuple.type = call generated.%Destroy.WithSelf.Op.decl.5f94cf.1(%self.param)
|
||||
// CHECK:STDOUT: %T.cpp_destructor.call: init %empty_tuple.type = call imports.%T.cpp_destructor.decl(%self.param)
|
||||
|
||||
@@ -48,9 +48,7 @@ auto UndeducedReturn();
|
||||
''';
|
||||
|
||||
fn Call() {
|
||||
// CHECK:STDERR: fail_return_undeduced_auto.carbon:[[@LINE+4]]:3: error: semantics TODO: `Unsupported: return type: auto` [SemanticsTodo]
|
||||
// CHECK:STDERR: Cpp.UndeducedReturn();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_return_undeduced_auto.carbon:[[@LINE+2]]:3-23: error: semantics TODO: `Unsupported: return type: auto` [SemanticsTodo]
|
||||
// CHECK:STDERR:
|
||||
Cpp.UndeducedReturn();
|
||||
}
|
||||
|
||||
@@ -25,57 +25,29 @@ auto foo2(ForwardDeclaredStruct) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6: error: argument type 'ForwardDeclaredStruct' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo1(ForwardDeclaredStruct) -> void;
|
||||
// CHECK:STDERR: | ^~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6-9: error: argument type 'ForwardDeclaredStruct' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:8: note: forward declaration of 'ForwardDeclaredStruct' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | struct ForwardDeclaredStruct;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_param_type.h";
|
||||
|
||||
fn F(p: Cpp.ForwardDeclaredStruct*) {
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo1(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:3-14: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6: error: argument type 'ForwardDeclaredStruct' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 5 | auto foo2(ForwardDeclaredStruct) -> void;
|
||||
// CHECK:STDERR: | ^~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-11]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6-9: error: argument type 'ForwardDeclaredStruct' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:8: note: forward declaration of 'ForwardDeclaredStruct' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | struct ForwardDeclaredStruct;
|
||||
// CHECK:STDERR: | ^
|
||||
Cpp.foo1(*p);
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+28]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo2(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3-14: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-5]]:12: error: forming value of incomplete type `Cpp.ForwardDeclaredStruct` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo1(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-23]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-3]]:12-13: error: forming value of incomplete type `Cpp.ForwardDeclaredStruct` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: struct ForwardDeclaredStruct;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:32: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo1(ForwardDeclaredStruct) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:12: error: forming value of incomplete type `Cpp.ForwardDeclaredStruct` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo2(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-35]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:12-13: error: forming value of incomplete type `Cpp.ForwardDeclaredStruct` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-17]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: struct ForwardDeclaredStruct;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-39]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:32: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo2(ForwardDeclaredStruct) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo2(*p);
|
||||
}
|
||||
@@ -118,25 +90,15 @@ auto foo_non_copyable(NonCopyableStruct) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:6: error: call to deleted constructor of 'NonCopyableStruct' [CppInteropParseError]
|
||||
// CHECK:STDERR: 6 | auto foo_non_copyable(NonCopyableStruct) -> void;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_non_copyable_param_type.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:6-21: error: call to deleted constructor of 'NonCopyableStruct' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:3:3: note: 'NonCopyableStruct' has been explicitly marked deleted here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | NonCopyableStruct(const NonCopyableStruct&) = delete;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./non_copyable_param_type.h:6:40: note: passing argument to parameter here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 6 | auto foo_non_copyable(NonCopyableStruct) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "non_copyable_param_type.h";
|
||||
|
||||
fn F(s: Cpp.NonCopyableStruct) {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+4]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_non_copyable(s);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_non_copyable_param_type.carbon:[[@LINE+2]]:3-25: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_non_copyable(s);
|
||||
//@dump-sem-ir-end
|
||||
@@ -321,13 +283,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+8]]:3: error: member access into incomplete class `Cpp.IncompleteStruct` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: Cpp.IncompleteStruct.foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+4]]:3-26: error: member access into incomplete class `Cpp.IncompleteStruct` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: included from: fail_import_incomplete.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./incomplete.h:2:8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: struct IncompleteStruct;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.IncompleteStruct.foo();
|
||||
}
|
||||
@@ -391,36 +349,19 @@ auto foo_decl_value_return() -> DeclValueReturnStruct;
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// TODO: We should only produce one error here.
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: error: calling 'foo_decl_value_return' with incomplete return type 'DeclValueReturnStruct' [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_value_return() -> DeclValueReturnStruct;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_return_type.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6-26: error: calling 'foo_decl_value_return' with incomplete return type 'DeclValueReturnStruct' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: note: 'foo_decl_value_return' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_value_return() -> DeclValueReturnStruct;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:8: note: forward declaration of 'DeclValueReturnStruct' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | struct DeclValueReturnStruct;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_return_type.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+16]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+7]]:3-29: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+12]]:3: error: function returns incomplete type `Cpp.DeclValueReturnStruct` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+5]]:3-29: error: function returns incomplete type `Cpp.DeclValueReturnStruct` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_return_type.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:8: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: struct DeclValueReturnStruct;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:33: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: auto foo_decl_value_return() -> DeclValueReturnStruct;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_decl_value_return();
|
||||
}
|
||||
@@ -559,7 +500,7 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @F(%s.param: %NonCopyableStruct) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc24: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc14: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo_non_copyable.ref: %foo_non_copyable.cpp_overload_set.type = name_ref foo_non_copyable, imports.%foo_non_copyable.cpp_overload_set.value [concrete = constants.%foo_non_copyable.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %s.ref: %NonCopyableStruct = name_ref s, %s
|
||||
// CHECK:STDOUT: %foo_non_copyable.call: init %empty_tuple.type = call imports.%foo_non_copyable.decl(%s.ref)
|
||||
|
||||
@@ -87,12 +87,9 @@ template<int N> void fn_arg_not_template_arg_f();
|
||||
|
||||
fn Call() {
|
||||
// We treat this as a function argument, even though that makes the call fail.
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE+7]]:34: error: no matching function for call to 'fn_arg_not_template_arg_f' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Cpp.fn_arg_not_template_arg_f(1);
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE-8]]:22: note: candidate function template not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | template<int N> void fn_arg_not_template_arg_f();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE+4]]:3-31: error: no matching function for call to 'fn_arg_not_template_arg_f' [CppInteropParseError]
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE-6]]:22: note: candidate function template not viable [CppInteropParseNote]
|
||||
// CHECK:STDERR: fail_function_arg_not_template_arg.carbon:[[@LINE-7]]:47-48: note: requires 0 arguments, but 1 was provided [CppInteropParseNoteReason]
|
||||
// CHECK:STDERR:
|
||||
Cpp.fn_arg_not_template_arg_f(1);
|
||||
}
|
||||
|
||||
@@ -25,57 +25,29 @@ auto foo2(ForwardDeclaredUnion) -> void;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6: error: argument type 'ForwardDeclaredUnion' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo1(ForwardDeclaredUnion) -> void;
|
||||
// CHECK:STDERR: | ^~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE+3]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:6-9: error: argument type 'ForwardDeclaredUnion' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: forward declaration of 'ForwardDeclaredUnion' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | union ForwardDeclaredUnion;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_param_type.h";
|
||||
|
||||
fn F(p: Cpp.ForwardDeclaredUnion*) {
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo1(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:3-14: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-7]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6: error: argument type 'ForwardDeclaredUnion' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: 5 | auto foo2(ForwardDeclaredUnion) -> void;
|
||||
// CHECK:STDERR: | ^~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-11]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-5]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:6-9: error: argument type 'ForwardDeclaredUnion' is incomplete [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: forward declaration of 'ForwardDeclaredUnion' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | union ForwardDeclaredUnion;
|
||||
// CHECK:STDERR: | ^
|
||||
Cpp.foo1(*p);
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+28]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo2(*p);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:3-14: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-5]]:12: error: forming value of incomplete type `Cpp.ForwardDeclaredUnion` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo1(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-23]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-3]]:12-13: error: forming value of incomplete type `Cpp.ForwardDeclaredUnion` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-12]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: union ForwardDeclaredUnion;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-27]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:4:31: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo1(ForwardDeclaredUnion) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+12]]:12: error: forming value of incomplete type `Cpp.ForwardDeclaredUnion` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: Cpp.foo2(*p);
|
||||
// CHECK:STDERR: ^~
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-35]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE+5]]:12-13: error: forming value of incomplete type `Cpp.ForwardDeclaredUnion` [IncompleteTypeInValueConversion]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_param_type.carbon:[[@LINE-17]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: union ForwardDeclaredUnion;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_param_type.carbon:[[@LINE-39]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_param_type.h:5:31: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo2(ForwardDeclaredUnion) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo2(*p);
|
||||
}
|
||||
@@ -282,13 +254,9 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "incomplete.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+8]]:3: error: member access into incomplete class `Cpp.IncompleteUnion` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: Cpp.IncompleteUnion.foo();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE-6]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_incomplete.carbon:[[@LINE+4]]:3-25: error: member access into incomplete class `Cpp.IncompleteUnion` [QualifiedExprInIncompleteClassScope]
|
||||
// CHECK:STDERR: included from: fail_import_incomplete.carbon:[[@LINE-4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./incomplete.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: union IncompleteUnion;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.IncompleteUnion.foo();
|
||||
}
|
||||
@@ -351,36 +319,19 @@ auto foo_decl_value_return() -> DeclValueReturnUnion;
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+12]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: error: calling 'foo_decl_value_return' with incomplete return type 'DeclValueReturnUnion' [CppInteropParseError]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_value_return() -> DeclValueReturnUnion;
|
||||
// CHECK:STDERR: | ^~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+8]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_return_type.carbon:[[@LINE+4]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6-26: error: calling 'foo_decl_value_return' with incomplete return type 'DeclValueReturnUnion' [CppInteropParseError]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:6: note: 'foo_decl_value_return' declared here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 4 | auto foo_decl_value_return() -> DeclValueReturnUnion;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+4]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:7: note: forward declaration of 'DeclValueReturnUnion' [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | union DeclValueReturnUnion;
|
||||
// CHECK:STDERR: | ^
|
||||
import Cpp library "decl_value_return_type.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+16]]:3: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+7]]:3-29: note: in thunk for C++ function used here [InCppThunk]
|
||||
// CHECK:STDERR:
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+12]]:3: error: function returns incomplete type `Cpp.DeclValueReturnUnion` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: Cpp.foo_decl_value_return();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-10]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE+5]]:3-29: error: function returns incomplete type `Cpp.DeclValueReturnUnion` [IncompleteTypeInFunctionReturnType]
|
||||
// CHECK:STDERR: included from: fail_import_decl_value_return_type.carbon:[[@LINE-6]]:10 [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:7: note: class was forward declared here [ClassForwardDeclaredHere]
|
||||
// CHECK:STDERR: union DeclValueReturnUnion;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:33: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: auto foo_decl_value_return() -> DeclValueReturnUnion;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo_decl_value_return();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user