mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-01 12:35:52 +01:00
Rename and rearrange entities in tests to avoid name reuse (#7656)
Fix a bunch of cases where we use the same external name to mean multiple different things in the same test. We've historically gotten away with this, but under `--share-cpp-ast`, it becomes an error, at least if the entity is either defined in, or used from, C++ code. Assisted-by: Gemini via Antigravity (original change) and Claude Code (suggested edits in review) --------- Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
co-authored by
Chandler Carruth
parent
6eb900dff5
commit
c588eadb57
@@ -15,19 +15,19 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
fn F(a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
fn FArrayValueParam(a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
|
||||
inline Cpp '''
|
||||
int G() {
|
||||
int GArrayValueParam() {
|
||||
int arr[5];
|
||||
//@dump-sem-ir-begin
|
||||
return Carbon::F(arr);
|
||||
return Carbon::FArrayValueParam(arr);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
int H() {
|
||||
int HArrayValueParam() {
|
||||
//@dump-sem-ir-begin
|
||||
return Carbon::F({1, 2, 3, 4, 5});
|
||||
return Carbon::FArrayValueParam({1, 2, 3, 4, 5});
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
''';
|
||||
@@ -44,23 +44,34 @@ import Cpp;
|
||||
|
||||
// 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 F(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// 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 F(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
fn FArrayVarParam(var a: array(i32, 5)) -> i32 { return a[2]; }
|
||||
|
||||
inline Cpp '''
|
||||
int G() {
|
||||
int GArrayVarParam() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_array_var_param.carbon:[[@LINE+4]]:18: error: no member named 'F' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 28 | return Carbon::F({1, 2, 3, 4, 5});
|
||||
// CHECK:STDERR: | ^
|
||||
// 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:
|
||||
return Carbon::F({1, 2, 3, 4, 5});
|
||||
// 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:
|
||||
return Carbon::FArrayVarParam({1, 2, 3, 4, 5});
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
''';
|
||||
@@ -75,20 +86,28 @@ import Cpp;
|
||||
// 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 F() -> array(i32, 5) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn FArrayReturn() -> array(i32, 5) {
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F() -> array(i32, 5) {
|
||||
fn FArrayReturn() -> array(i32, 5) {
|
||||
return (1, 2, 3, 4, 5);
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
int G() {
|
||||
// CHECK:STDERR: fail_todo_array_return.carbon:[[@LINE+4]]:24: error: no member named 'F' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 23 | auto &&arr = Carbon::F();
|
||||
// CHECK:STDERR: | ^
|
||||
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:
|
||||
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:
|
||||
auto &&arr = Carbon::F();
|
||||
return arr[0];
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -20,7 +20,7 @@ class OneArg {
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
void CallOneArg() {
|
||||
Carbon::OneArg a(42);
|
||||
}
|
||||
''';
|
||||
@@ -30,26 +30,26 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
class OneArg {
|
||||
fn OneArg(self, i: i32) -> Self;
|
||||
class FactoryIsMethod {
|
||||
fn FactoryIsMethod(self, i: i32) -> Self;
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE+13]]:18: error: no matching constructor for initialization of 'Carbon::OneArg' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::OneArg a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-9]]:14: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-12]]:14: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_is_method.carbon:[[@LINE-15]]:14: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
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:
|
||||
Carbon::OneArg a(42);
|
||||
Carbon::FactoryIsMethod a(42);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -58,26 +58,26 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
class OneArg {
|
||||
fn OneArg(i: i32) -> i32;
|
||||
class FactoryDoesntReturnSelf {
|
||||
fn FactoryDoesntReturnSelf(i: i32) -> i32;
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE+13]]:18: error: no matching constructor for initialization of 'Carbon::OneArg' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::OneArg a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-9]]:14: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-12]]:14: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_doesnt_return_self.carbon:[[@LINE-15]]:14: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
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:
|
||||
Carbon::OneArg a(42);
|
||||
Carbon::FactoryDoesntReturnSelf a(42);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -86,26 +86,26 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
class OneArg {
|
||||
fn OneArg(i: i32) -> ref Self;
|
||||
class FactoryReturnsByRef {
|
||||
fn FactoryReturnsByRef(i: i32) -> ref Self;
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE+13]]:18: error: no matching constructor for initialization of 'Carbon::OneArg' [CppInteropParseError]
|
||||
// CHECK:STDERR: 24 | Carbon::OneArg a(42);
|
||||
// CHECK:STDERR: | ^ ~~
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-9]]:14: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-12]]:14: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'OneArg' for 1st argument [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: fail_factory_returns_by_ref.carbon:[[@LINE-15]]:14: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided [CppInteropParseNote]
|
||||
// CHECK:STDERR: 5 | class OneArg {
|
||||
// CHECK:STDERR: | ^
|
||||
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:
|
||||
Carbon::OneArg a(42);
|
||||
Carbon::FactoryReturnsByRef a(42);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -125,7 +125,7 @@ class GenericConstructor {
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
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: | ^ ~
|
||||
@@ -159,7 +159,7 @@ class GenericClass(T: type) {
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
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: | ^ ~
|
||||
|
||||
@@ -10,46 +10,51 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/export/function.carbon
|
||||
|
||||
// --- other.carbon
|
||||
// --- other_function.carbon
|
||||
|
||||
package Other;
|
||||
package OtherFunction;
|
||||
fn F1() {}
|
||||
fn F2() -> i32 { return 0; }
|
||||
fn F3(_: i32) {}
|
||||
|
||||
fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
fn HasDeducedArg[T: type](a: T) { a; }
|
||||
|
||||
// --- function.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Other;
|
||||
import OtherFunction;
|
||||
import Cpp inline '''
|
||||
void G() {
|
||||
Carbon::Other::F1();
|
||||
void CallF1() {
|
||||
Carbon::OtherFunction::F1();
|
||||
}
|
||||
''';
|
||||
|
||||
// --- other_return_int.carbon
|
||||
|
||||
package OtherReturnInt;
|
||||
fn F2() -> i32 { return 0; }
|
||||
|
||||
// --- return_int.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Other;
|
||||
import OtherReturnInt;
|
||||
import Cpp inline '''
|
||||
int G() {
|
||||
return Carbon::Other::F2();
|
||||
int CallF2() {
|
||||
return Carbon::OtherReturnInt::F2();
|
||||
}
|
||||
''';
|
||||
|
||||
// --- other_args.carbon
|
||||
|
||||
package OtherArgs;
|
||||
fn F3(_: i32) {}
|
||||
|
||||
// --- args.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Other;
|
||||
import OtherArgs;
|
||||
import Cpp inline '''
|
||||
void G() {
|
||||
Carbon::Other::F3(123);
|
||||
void CallF3() {
|
||||
Carbon::OtherArgs::F3(123);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -59,12 +64,12 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
fn F(ref n: i32);
|
||||
fn RefF(ref n: i32);
|
||||
|
||||
inline Cpp '''
|
||||
void G() {
|
||||
void CallRefF() {
|
||||
int n = 0;
|
||||
Carbon::F(n);
|
||||
Carbon::RefF(n);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -74,40 +79,50 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
fn F();
|
||||
fn UsingF();
|
||||
|
||||
inline Cpp '''
|
||||
using Carbon::F;
|
||||
void G() { F(); }
|
||||
using Carbon::UsingF;
|
||||
void CallUsingF() { UsingF(); }
|
||||
''';
|
||||
|
||||
// --- other_generic.carbon
|
||||
|
||||
package OtherGeneric;
|
||||
fn HasGenericArg(generic T: type, a: T) { a; }
|
||||
|
||||
// --- fail_todo_generic.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
// CHECK:STDERR: fail_todo_generic.carbon:[[@LINE+9]]:1: in import [InImport]
|
||||
// CHECK:STDERR: other.carbon:7:1: error: 1 argument passed to function expecting 2 arguments [CallArgCountMismatch]
|
||||
// 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.carbon:7:1: note: calling function declared here [InCallToEntity]
|
||||
// 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:
|
||||
import Other;
|
||||
import OtherGeneric;
|
||||
import Cpp inline '''
|
||||
void G() {
|
||||
Carbon::Other::HasGenericArg<int>(123);
|
||||
void CallHasGenericArg() {
|
||||
Carbon::OtherGeneric::HasGenericArg<int>(123);
|
||||
}
|
||||
''';
|
||||
|
||||
// --- other_deduced.carbon
|
||||
|
||||
package OtherDeduced;
|
||||
fn HasDeducedArg[T: type](a: T) { a; }
|
||||
|
||||
// --- deduced.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Other;
|
||||
import OtherDeduced;
|
||||
import Cpp inline '''
|
||||
void G() {
|
||||
Carbon::Other::HasDeducedArg(123);
|
||||
void CallHasDeducedArg() {
|
||||
Carbon::OtherDeduced::HasDeducedArg(123);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -39,7 +39,7 @@ fn F[T: I](t: T) -> T {
|
||||
}
|
||||
|
||||
inline Cpp '''
|
||||
Carbon::B G() {
|
||||
Carbon::B CallInterfaceF() {
|
||||
Carbon::A a;
|
||||
Carbon::B b;
|
||||
Carbon::F(a);
|
||||
@@ -53,22 +53,22 @@ 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 F[unused N: i32]() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn NonTypeF[unused N: i32]() {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F[unused N: i32]() {}
|
||||
fn NonTypeF[unused N: i32]() {}
|
||||
|
||||
inline Cpp '''
|
||||
void G() {
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+8]]:11: error: no member named 'F' in namespace 'Carbon' [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::F<3>();
|
||||
// CHECK:STDERR: | ^
|
||||
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:
|
||||
// CHECK:STDERR: fail_todo_non_type_generic.carbon:[[@LINE+4]]:16: error: expected expression [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::F<3>();
|
||||
// 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:
|
||||
Carbon::F<3>();
|
||||
Carbon::NonTypeF<3>();
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -76,13 +76,13 @@ void G() {
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
fn F[T: type](unused t: T*) {}
|
||||
fn PointerF[T: type](unused t: T*) {}
|
||||
|
||||
inline Cpp '''
|
||||
void G() {
|
||||
void CallPointerF() {
|
||||
int x = 0;
|
||||
int* _Nonnull p = &x;
|
||||
Carbon::F(p);
|
||||
Carbon::PointerF(p);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -90,26 +90,26 @@ void G() {
|
||||
library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
class A(T: type) {
|
||||
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 F[U: type](x: T, y: U);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn MemberF[U: type](x: T, y: U);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F[U: type](x: T, y: U);
|
||||
fn MemberF[U: type](x: T, y: U);
|
||||
}
|
||||
alias B = A(i32);
|
||||
alias EnclosingB = EnclosingA(i32);
|
||||
|
||||
inline Cpp '''
|
||||
void f() {
|
||||
// TODO: this currently fails because `B` can't be imported, but the intent
|
||||
void CallEnclosingF() {
|
||||
// TODO: this currently fails because `EnclosingB` can't be imported, but the intent
|
||||
// is to test a generic function within an enclosing generic scope.
|
||||
//
|
||||
Carbon::B b;
|
||||
// CHECK:STDERR: fail_todo_enclosing_generic.carbon:[[@LINE+4]]:5: error: no member named 'F' in 'Carbon::A<int>' [CppInteropParseError]
|
||||
// CHECK:STDERR: 23 | b.F(1, 2);
|
||||
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:
|
||||
b.F(1, 2);
|
||||
b.MemberF(1, 2);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -118,22 +118,22 @@ 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 F[T: type](unused t: T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fn UnsupportedF[T: type](unused t: T) {}
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
fn F[T: type](unused t: T) {}
|
||||
fn UnsupportedF[T: type](unused t: T) {}
|
||||
|
||||
inline Cpp '''
|
||||
void G() {
|
||||
void CallUnsupportedF() {
|
||||
volatile int x;
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE+7]]:3: error: no matching function for call to 'F' [CppInteropParseError]
|
||||
// CHECK:STDERR: 20 | Carbon::F(x);
|
||||
// CHECK:STDERR: | ^~~~~~~~~
|
||||
// CHECK:STDERR: fail_generic_unsupported_type.carbon:[[@LINE-8]]:28: note: candidate template ignored: substitution failure [with T = volatile int] [CppInteropParseNote]
|
||||
// CHECK:STDERR: 8 | fn F[T: type](unused t: T) {}
|
||||
// CHECK:STDERR: | ^
|
||||
// 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:
|
||||
Carbon::F(x);
|
||||
Carbon::UnsupportedF(x);
|
||||
}
|
||||
''';
|
||||
|
||||
@@ -274,7 +274,7 @@ void G() {
|
||||
// CHECK:STDOUT: %.loc24_23.1: %I.type = converted %A.decl, %I.facet.loc24_23.1 [concrete = constants.%I.facet.f31]
|
||||
// CHECK:STDOUT: %I.facet.loc24_23.2: %I.type = facet_value %B.decl, (constants.%I.impl_witness.b14) [concrete = constants.%I.facet.a68]
|
||||
// CHECK:STDOUT: %.loc24_23.2: %I.type = converted %B.decl, %I.facet.loc24_23.2 [concrete = constants.%I.facet.a68]
|
||||
// CHECK:STDOUT: inline_cpp "Carbon::B G() {\n Carbon::A a;\n Carbon::B b;\n Carbon::F(a);\n return Carbon::F(b);\n}\n"
|
||||
// CHECK:STDOUT: inline_cpp "Carbon::B CallInterfaceF() {\n Carbon::A a;\n Carbon::B b;\n Carbon::F(a);\n return Carbon::F(b);\n}\n"
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: interface @I {
|
||||
|
||||
+466
-466
File diff suppressed because it is too large
Load Diff
@@ -16,41 +16,41 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
constexpr int f(int a, int b) { return a + b; }
|
||||
constexpr int add(int a, int b) { return a + b; }
|
||||
''';
|
||||
|
||||
let a: array(i32, Cpp.f(1, 2)) = (1, 2, 3);
|
||||
let a: array(i32, Cpp.add(1, 2)) = (1, 2, 3);
|
||||
|
||||
// --- bool_param.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
constexpr int f(bool b) {
|
||||
constexpr int bool_fn(bool b) {
|
||||
return b ? 3 : 0;
|
||||
}
|
||||
''';
|
||||
|
||||
let a: array(i32, Cpp.f(true)) = (1, 2, 3);
|
||||
let a: array(i32, Cpp.bool_fn(true)) = (1, 2, 3);
|
||||
|
||||
// --- float_param.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
constexpr int f(float b) {
|
||||
constexpr int float_fn(float b) {
|
||||
return static_cast<int>(b);
|
||||
}
|
||||
''';
|
||||
|
||||
let a: array(i32, Cpp.f(3.0)) = (1, 2, 3);
|
||||
let a: array(i32, Cpp.float_fn(3.0)) = (1, 2, 3);
|
||||
|
||||
// --- return_bool.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
constexpr bool f() {
|
||||
constexpr bool return_bool_fn() {
|
||||
return true;
|
||||
}
|
||||
''';
|
||||
@@ -59,7 +59,7 @@ musteval fn F(b: bool) -> i32 {
|
||||
return if b then 3 else 0;
|
||||
}
|
||||
|
||||
let a: array(i32, F(Cpp.f())) = (1, 2, 3);
|
||||
let a: array(i32, F(Cpp.return_bool_fn())) = (1, 2, 3);
|
||||
|
||||
// --- fail_invalid_constant_eval.carbon
|
||||
|
||||
@@ -67,16 +67,16 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
constexpr int arr[1] = {0};
|
||||
constexpr int f(int a) {
|
||||
constexpr int invalid_const_fn(int a) {
|
||||
return arr[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.f(5)) = (1, 2, 3);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: let a: array(i32, Cpp.invalid_const_fn(5)) = (1, 2, 3);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
let a: array(i32, Cpp.f(5)) = (1, 2, 3);
|
||||
let a: array(i32, Cpp.invalid_const_fn(5)) = (1, 2, 3);
|
||||
|
||||
// --- nonconstant_constexpr_call.carbon
|
||||
|
||||
@@ -87,11 +87,11 @@ import Cpp;
|
||||
var a: i32 = 0;
|
||||
|
||||
inline Cpp '''
|
||||
constexpr int f(const int &r) { return r; }
|
||||
constexpr int nonconst_constexpr_fn(const int &r) { return r; }
|
||||
''';
|
||||
|
||||
// OK, runtime call.
|
||||
var b: i32 = Cpp.f(a);
|
||||
var b: i32 = Cpp.nonconst_constexpr_fn(a);
|
||||
|
||||
// --- fail_nonconstant_consteval_call.carbon
|
||||
|
||||
@@ -103,30 +103,30 @@ 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 'f' is not a constant expression [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | consteval int f(const int &r) { return r; }
|
||||
// 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 f(const int &r) { return r; }
|
||||
// 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 f(const int &r) { return r; }
|
||||
// CHECK:STDERR: 19 | consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: | ^
|
||||
consteval int f(const int &r) { return r; }
|
||||
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.f(a);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: var b: i32 = Cpp.nonconst_consteval_fn(a);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// 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.f(a);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// 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 f(const int &r) { return r; }
|
||||
// CHECK:STDERR: consteval int nonconst_consteval_fn(const int &r) { return r; }
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
var b: i32 = Cpp.f(a);
|
||||
var b: i32 = Cpp.nonconst_consteval_fn(a);
|
||||
|
||||
// --- fail_todo_constructor.carbon
|
||||
|
||||
@@ -135,8 +135,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp;
|
||||
|
||||
inline Cpp '''
|
||||
struct C {
|
||||
constexpr C(int a) : a(a) {}
|
||||
struct ConstexprC {
|
||||
constexpr ConstexprC(int a) : a(a) {}
|
||||
int a;
|
||||
};
|
||||
''';
|
||||
@@ -144,10 +144,10 @@ struct C {
|
||||
// TODO: This should probably be allowed.
|
||||
eval fn F() -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_constructor.carbon:[[@LINE+3]]:18: error: expression is runtime; expected constant [EvalRequiresConstantValue]
|
||||
// CHECK:STDERR: let c: Cpp.C = 3;
|
||||
// CHECK:STDERR: ^
|
||||
let c: Cpp.C = 3;
|
||||
// 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: ^
|
||||
let c: Cpp.ConstexprC = 3;
|
||||
return c.a;
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
@@ -165,14 +165,14 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %C: type = class_type @C [concrete]
|
||||
// CHECK:STDOUT: %C.elem: type = unbound_element_type %C, %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.bbc: type = pattern_type %C [concrete]
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.bbc = value_binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC: type = class_type @ConstexprC [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC.elem: type = unbound_element_type %ConstexprC, %i32 [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.3cc: type = pattern_type %ConstexprC [concrete]
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.3cc = value_binding_pattern c [concrete]
|
||||
// CHECK:STDOUT: %int_3.1ba: Core.IntLiteral = int_value 3 [concrete]
|
||||
// CHECK:STDOUT: %ptr.0a2: type = ptr_type %C [concrete]
|
||||
// CHECK:STDOUT: %C__carbon_thunk.type: type = fn_type @C__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %C__carbon_thunk: %C__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.0b8: type = ptr_type %ConstexprC [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC__carbon_thunk.type: type = fn_type @ConstexprC__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC__carbon_thunk: %ConstexprC__carbon_thunk.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.914: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl.0e9(%To) [symbolic]
|
||||
@@ -197,19 +197,19 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: %Copy.WithSelf.Op.type.381: type = fn_type @Copy.WithSelf.Op, @Copy.WithSelf(%Copy.facet) [concrete]
|
||||
// CHECK:STDOUT: %.737: type = fn_type_with_self_type %Copy.WithSelf.Op.type.381, %Copy.facet [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.specific_fn: <specific function> = specific_function %Int.as.Copy.impl.Op.4f6, @Int.as.Copy.impl.Op(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %C.cpp_destructor.type: type = fn_type @C.cpp_destructor [concrete]
|
||||
// CHECK:STDOUT: %C.cpp_destructor: %C.cpp_destructor.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %C.Op.type: type = fn_type @C.Op [concrete]
|
||||
// CHECK:STDOUT: %C.Op: %C.Op.type = struct_value () [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: %ConstexprC.Op.type: type = fn_type @ConstexprC.Op [concrete]
|
||||
// CHECK:STDOUT: %ConstexprC.Op: %ConstexprC.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .C = %C.decl
|
||||
// CHECK:STDOUT: .ConstexprC = %ConstexprC.decl
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
|
||||
// CHECK:STDOUT: %C__carbon_thunk.decl: %C__carbon_thunk.type = fn_decl @C__carbon_thunk [concrete = constants.%C__carbon_thunk] {
|
||||
// CHECK:STDOUT: %ConstexprC.decl: type = class_decl @ConstexprC [concrete = constants.%ConstexprC] {} {}
|
||||
// CHECK:STDOUT: %ConstexprC__carbon_thunk.decl: %ConstexprC__carbon_thunk.type = fn_decl @ConstexprC__carbon_thunk [concrete = constants.%ConstexprC__carbon_thunk] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -218,7 +218,7 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// CHECK:STDOUT: %ImplicitAs.impl_witness_table.1aa = impl_witness_table (%Core.import_ref.edf), @Core.IntLiteral.as.ImplicitAs.impl.0e9 [concrete]
|
||||
// CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/types/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)]
|
||||
// CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete]
|
||||
// CHECK:STDOUT: %C.cpp_destructor.decl: %C.cpp_destructor.type = fn_decl @C.cpp_destructor [concrete = constants.%C.cpp_destructor] {
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor.decl: %ConstexprC.cpp_destructor.type = fn_decl @ConstexprC.cpp_destructor [concrete = constants.%ConstexprC.cpp_destructor] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -228,30 +228,30 @@ 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_18.1: ref %C = temporary_storage
|
||||
// CHECK:STDOUT: %.loc19_27.1: ref %ConstexprC = temporary_storage
|
||||
// CHECK:STDOUT: %impl.elem0.loc19: %.b7a = impl_witness_access constants.%ImplicitAs.impl_witness.a2a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e39]
|
||||
// CHECK:STDOUT: %bound_method.loc19_18.1: <bound method> = bound_method %int_3, %impl.elem0.loc19 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// 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_18.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_18.2(%int_3) [concrete = constants.%int_3.410]
|
||||
// CHECK:STDOUT: %.loc19_18.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_3.410]
|
||||
// CHECK:STDOUT: %.loc19_18.3: %i32 = converted %int_3, %.loc19_18.2 [concrete = constants.%int_3.410]
|
||||
// CHECK:STDOUT: %addr: %ptr.0a2 = addr_of %.loc19_18.1
|
||||
// CHECK:STDOUT: %C__carbon_thunk.call: init %empty_tuple.type = call imports.%C__carbon_thunk.decl(%.loc19_18.3, %addr)
|
||||
// CHECK:STDOUT: %.loc19_18.4: init %C to %.loc19_18.1 = mark_in_place_init %C__carbon_thunk.call
|
||||
// CHECK:STDOUT: %.loc19_18.5: init %C = converted %int_3, %.loc19_18.4
|
||||
// CHECK:STDOUT: %.loc19_18.6: ref %C = temporary %.loc19_18.1, %.loc19_18.5
|
||||
// CHECK:STDOUT: %.loc19_18.7: %C = acquire_value %.loc19_18.6
|
||||
// CHECK:STDOUT: %.loc19_13: type = splice_block %C.ref [concrete = constants.%C] {
|
||||
// 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.410]
|
||||
// CHECK:STDOUT: %.loc19_27.2: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_3.410]
|
||||
// CHECK:STDOUT: %.loc19_27.3: %i32 = converted %int_3, %.loc19_27.2 [concrete = constants.%int_3.410]
|
||||
// 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: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %C.ref: type = name_ref C, imports.%C.decl [concrete = constants.%C]
|
||||
// CHECK:STDOUT: %ConstexprC.ref: type = name_ref ConstexprC, imports.%ConstexprC.decl [concrete = constants.%ConstexprC]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c: %C = wrapper_binding c, %.loc19_18.7
|
||||
// CHECK:STDOUT: %c: %ConstexprC = wrapper_binding c, %.loc19_27.7
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.bbc = value_binding_pattern c [concrete = constants.%c.patt]
|
||||
// CHECK:STDOUT: %c.patt: %pattern_type.3cc = value_binding_pattern c [concrete = constants.%c.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %c.ref: %C = name_ref c, %c
|
||||
// CHECK:STDOUT: %a.ref: %C.elem = name_ref a, @C.%.1 [concrete = @C.%.1]
|
||||
// CHECK:STDOUT: %c.ref: %ConstexprC = name_ref c, %c
|
||||
// CHECK:STDOUT: %a.ref: %ConstexprC.elem = name_ref a, @ConstexprC.%.1 [concrete = @ConstexprC.%.1]
|
||||
// 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: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
|
||||
@@ -260,10 +260,10 @@ let a: array(i32, F()) = (1, 2, 3);
|
||||
// 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: <elided>
|
||||
// CHECK:STDOUT: %C.Op.bound: <bound method> = bound_method %.loc19_18.6, constants.%C.Op
|
||||
// CHECK:STDOUT: %Op.ref: %C.cpp_destructor.type = name_ref Op, imports.%C.cpp_destructor.decl [concrete = constants.%C.cpp_destructor]
|
||||
// CHECK:STDOUT: %C.cpp_destructor.bound: <bound method> = bound_method %.loc19_18.6, %Op.ref
|
||||
// CHECK:STDOUT: %C.cpp_destructor.call: init %empty_tuple.type = call %C.cpp_destructor.bound(%.loc19_18.6)
|
||||
// CHECK:STDOUT: %ConstexprC.Op.bound: <bound method> = bound_method %.loc19_27.6, constants.%ConstexprC.Op
|
||||
// CHECK:STDOUT: %Op.ref: %ConstexprC.cpp_destructor.type = name_ref Op, imports.%ConstexprC.cpp_destructor.decl [concrete = constants.%ConstexprC.cpp_destructor]
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor.bound: <bound method> = bound_method %.loc19_27.6, %Op.ref
|
||||
// CHECK:STDOUT: %ConstexprC.cpp_destructor.call: init %empty_tuple.type = call %ConstexprC.cpp_destructor.bound(%.loc19_27.6)
|
||||
// CHECK:STDOUT: return %Int.as.Copy.impl.Op.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
extern "C" void foo();
|
||||
extern "C" void foo_c_fn();
|
||||
''';
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo();
|
||||
Cpp.foo_c_fn();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -29,14 +29,14 @@ fn MyF() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
extern "C" void foo();
|
||||
void foo(int x);
|
||||
extern "C" void foo_c_overloaded();
|
||||
void foo_c_overloaded(int x);
|
||||
''';
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo();
|
||||
Cpp.foo(5);
|
||||
Cpp.foo_c_overloaded();
|
||||
Cpp.foo_c_overloaded(5);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -45,12 +45,12 @@ fn MyF() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
extern "C" int foo;
|
||||
extern "C" int foo_c_var;
|
||||
''';
|
||||
|
||||
fn MyF() -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
return Cpp.foo;
|
||||
return Cpp.foo_c_var;
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -73,26 +73,26 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_c_fn.cpp_overload_set.type: type = cpp_overload_set_type @foo_c_fn.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_c_fn.cpp_overload_set.value: %foo_c_fn.cpp_overload_set.type = cpp_overload_set_value @foo_c_fn.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_c_fn.type: type = fn_type @foo_c_fn [concrete]
|
||||
// CHECK:STDOUT: %foo_c_fn: %foo_c_fn.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_c_fn = %foo_c_fn.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %foo_c_fn.cpp_overload_set.value: %foo_c_fn.cpp_overload_set.type = cpp_overload_set_value @foo_c_fn.cpp_overload_set [concrete = constants.%foo_c_fn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_c_fn.decl: %foo_c_fn.type = fn_decl @foo_c_fn [concrete = constants.%foo_c_fn] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @MyF() {
|
||||
// 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: %foo.call: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %foo_c_fn.ref: %foo_c_fn.cpp_overload_set.type = name_ref foo_c_fn, imports.%foo_c_fn.cpp_overload_set.value [concrete = constants.%foo_c_fn.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_c_fn.call: init %empty_tuple.type = call imports.%foo_c_fn.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -100,15 +100,15 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type.6d9caa.1: type = fn_type @foo.1 [concrete]
|
||||
// CHECK:STDOUT: %foo.627376.1: %foo.type.6d9caa.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.cpp_overload_set.type: type = cpp_overload_set_type @foo_c_overloaded.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.cpp_overload_set.value: %foo_c_overloaded.cpp_overload_set.type = cpp_overload_set_value @foo_c_overloaded.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.type.7eb664.1: type = fn_type @foo_c_overloaded.1 [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.fee3ce.1: %foo_c_overloaded.type.7eb664.1 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %int_5.64b: Core.IntLiteral = int_value 5 [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %foo.type.6d9caa.2: type = fn_type @foo.2 [concrete]
|
||||
// CHECK:STDOUT: %foo.627376.2: %foo.type.6d9caa.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.type.7eb664.2: type = fn_type @foo_c_overloaded.2 [concrete]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.fee3ce.2: %foo_c_overloaded.type.7eb664.2 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.914: type = facet_type <@ImplicitAs, @ImplicitAs(%i32)> [concrete]
|
||||
// CHECK:STDOUT: %To: Core.IntLiteral = symbolic_binding To, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.type.e74: type = fn_type @Core.IntLiteral.as.ImplicitAs.impl.Convert, @Core.IntLiteral.as.ImplicitAs.impl(%To) [symbolic]
|
||||
@@ -127,12 +127,12 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_c_overloaded = %foo_c_overloaded.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl.6431a3.1: %foo.type.6d9caa.1 = fn_decl @foo.1 [concrete = constants.%foo.627376.1] {} {}
|
||||
// CHECK:STDOUT: %foo.decl.6431a3.2: %foo.type.6d9caa.2 = fn_decl @foo.2 [concrete = constants.%foo.627376.2] {
|
||||
// CHECK:STDOUT: %foo_c_overloaded.cpp_overload_set.value: %foo_c_overloaded.cpp_overload_set.type = cpp_overload_set_value @foo_c_overloaded.cpp_overload_set [concrete = constants.%foo_c_overloaded.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.decl.9ccf4c.1: %foo_c_overloaded.type.7eb664.1 = fn_decl @foo_c_overloaded.1 [concrete = constants.%foo_c_overloaded.fee3ce.1] {} {}
|
||||
// CHECK:STDOUT: %foo_c_overloaded.decl.9ccf4c.2: %foo_c_overloaded.type.7eb664.2 = fn_decl @foo_c_overloaded.2 [concrete = constants.%foo_c_overloaded.fee3ce.2] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -144,19 +144,19 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT: fn @MyF() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref.loc11: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call.loc11: init %empty_tuple.type = call imports.%foo.decl.6431a3.1()
|
||||
// CHECK:STDOUT: %foo_c_overloaded.ref.loc11: %foo_c_overloaded.cpp_overload_set.type = name_ref foo_c_overloaded, imports.%foo_c_overloaded.cpp_overload_set.value [concrete = constants.%foo_c_overloaded.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.call.loc11: init %empty_tuple.type = call imports.%foo_c_overloaded.decl.9ccf4c.1()
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %foo.ref.loc12: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.ref.loc12: %foo_c_overloaded.cpp_overload_set.type = name_ref foo_c_overloaded, imports.%foo_c_overloaded.cpp_overload_set.value [concrete = constants.%foo_c_overloaded.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_5: Core.IntLiteral = int_value 5 [concrete = constants.%int_5.64b]
|
||||
// CHECK:STDOUT: %impl.elem0: %.b7a = impl_witness_access constants.%ImplicitAs.impl_witness.a2a, element0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.e39]
|
||||
// CHECK:STDOUT: %bound_method.loc12_11.1: <bound method> = bound_method %int_5, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.ImplicitAs.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc12_24.1: <bound method> = bound_method %int_5, %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.loc12_11.2: <bound method> = bound_method %int_5, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc12_11.2(%int_5) [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %.loc12_11.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %.loc12_11.2: %i32 = converted %int_5, %.loc12_11.1 [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %foo.call.loc12: init %empty_tuple.type = call imports.%foo.decl.6431a3.2(%.loc12_11.2)
|
||||
// CHECK:STDOUT: %bound_method.loc12_24.2: <bound method> = bound_method %int_5, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.ImplicitAs.impl.Convert.call: init %i32 = call %bound_method.loc12_24.2(%int_5) [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %.loc12_24.1: %i32 = value_of_initializer %Core.IntLiteral.as.ImplicitAs.impl.Convert.call [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %.loc12_24.2: %i32 = converted %int_5, %.loc12_24.1 [concrete = constants.%int_5.eef]
|
||||
// CHECK:STDOUT: %foo_c_overloaded.call.loc12: init %empty_tuple.type = call imports.%foo_c_overloaded.decl.9ccf4c.2(%.loc12_24.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -167,8 +167,8 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT: %N: Core.IntLiteral = symbolic_binding N, 0 [symbolic]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.6b6: type = pattern_type %i32 [concrete]
|
||||
// CHECK:STDOUT: %foo.patt: %pattern_type.6b6 = ref_binding_pattern foo [concrete]
|
||||
// CHECK:STDOUT: %foo.var_patt: %pattern_type.6b6 = var_pattern %foo.patt [concrete]
|
||||
// CHECK:STDOUT: %foo_c_var.patt: %pattern_type.6b6 = ref_binding_pattern foo_c_var [concrete]
|
||||
// CHECK:STDOUT: %foo_c_var.var_patt: %pattern_type.6b6 = var_pattern %foo_c_var.patt [concrete]
|
||||
// CHECK:STDOUT: %Copy.type: type = facet_type <@Copy> [concrete]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.type.ac8: type = fn_type @Int.as.Copy.impl.Op, @Int.as.Copy.impl(%N) [symbolic]
|
||||
// CHECK:STDOUT: %Int.as.Copy.impl.Op.5e0: %Int.as.Copy.impl.Op.type.ac8 = struct_value () [symbolic]
|
||||
@@ -183,12 +183,12 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.var
|
||||
// CHECK:STDOUT: .foo_c_var = %foo_c_var.var
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.patt: %pattern_type.6b6 = ref_binding_pattern foo [concrete = constants.%foo.patt]
|
||||
// CHECK:STDOUT: %foo.var_patt: %pattern_type.6b6 = var_pattern %foo.patt [concrete = constants.%foo.var_patt]
|
||||
// CHECK:STDOUT: %foo.var: ref %i32 = var_storage %foo.var_patt [concrete]
|
||||
// CHECK:STDOUT: %foo_c_var.patt: %pattern_type.6b6 = ref_binding_pattern foo_c_var [concrete = constants.%foo_c_var.patt]
|
||||
// CHECK:STDOUT: %foo_c_var.var_patt: %pattern_type.6b6 = var_pattern %foo_c_var.patt [concrete = constants.%foo_c_var.var_patt]
|
||||
// CHECK:STDOUT: %foo_c_var.var: ref %i32 = var_storage %foo_c_var.var_patt [concrete]
|
||||
// CHECK:STDOUT: %Core.import_ref.cd6: @Int.as.Copy.impl.%Int.as.Copy.impl.Op.type (%Int.as.Copy.impl.Op.type.ac8) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Int.as.Copy.impl.%Int.as.Copy.impl.Op (constants.%Int.as.Copy.impl.Op.5e0)]
|
||||
// CHECK:STDOUT: %Copy.impl_witness_table.8d2 = impl_witness_table (%Core.import_ref.cd6), @Int.as.Copy.impl [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -197,8 +197,8 @@ fn MyF(a: Cpp.X, b: Cpp.X) -> Cpp.X {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %foo.ref: ref %i32 = name_ref foo, imports.%foo.var [concrete = imports.%foo.var]
|
||||
// CHECK:STDOUT: %.loc10: %i32 = acquire_value %foo.ref
|
||||
// CHECK:STDOUT: %foo_c_var.ref: ref %i32 = name_ref foo_c_var, imports.%foo_c_var.var [concrete = imports.%foo_c_var.var]
|
||||
// CHECK:STDOUT: %.loc10: %i32 = acquire_value %foo_c_var.ref
|
||||
// CHECK:STDOUT: %impl.elem0: %.737 = impl_witness_access constants.%Copy.impl_witness.b51, element0 [concrete = constants.%Int.as.Copy.impl.Op.4f6]
|
||||
// CHECK:STDOUT: %bound_method.loc10_13.1: <bound method> = bound_method %.loc10, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Int.as.Copy.impl.Op(constants.%int_32) [concrete = constants.%Int.as.Copy.impl.Op.specific_fn]
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// --- global.h
|
||||
|
||||
auto foo() -> void;
|
||||
auto global_foo() -> void;
|
||||
|
||||
// --- import_global.carbon
|
||||
|
||||
@@ -26,7 +26,7 @@ import Cpp library "global.h";
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo();
|
||||
Cpp.global_foo();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -84,8 +84,8 @@ fn MyF() {
|
||||
|
||||
// --- overloaded.h
|
||||
|
||||
auto foo() -> void;
|
||||
auto foo(int value) -> void;
|
||||
auto overloaded_foo() -> void;
|
||||
auto overloaded_foo(int value) -> void;
|
||||
|
||||
// --- import_overloaded.carbon
|
||||
|
||||
@@ -95,7 +95,7 @@ import Cpp library "overloaded.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo();
|
||||
Cpp.overloaded_foo();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ fn F() {
|
||||
|
||||
// --- variadic.h
|
||||
|
||||
auto foo(int x, ...) -> void;
|
||||
auto variadic_foo(int x, ...) -> void;
|
||||
|
||||
// --- fail_todo_import_variadic.carbon
|
||||
|
||||
@@ -116,10 +116,10 @@ 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.foo(8);
|
||||
// CHECK:STDERR: ^~~~~~~~~~
|
||||
// CHECK:STDERR: Cpp.variadic_foo(8);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(8);
|
||||
Cpp.variadic_foo(8);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -130,10 +130,10 @@ fn F() {
|
||||
// --- static.h
|
||||
|
||||
// TODO: Promote this warning to an error by default.
|
||||
// CHECK:STDERR: ./static.h:[[@LINE+3]]:13: warning: function 'foo' has internal linkage but is not defined [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | static auto foo() -> void;
|
||||
// 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: | ^
|
||||
static auto foo() -> void;
|
||||
static auto static_foo() -> void;
|
||||
|
||||
// --- todo_fail_import_static.carbon
|
||||
|
||||
@@ -143,21 +143,21 @@ import Cpp library "static.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: todo_fail_import_static.carbon:[[@LINE+4]]:11: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | Cpp.foo();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR: todo_fail_import_static.carbon:[[@LINE+4]]:18: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | Cpp.static_foo();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo();
|
||||
Cpp.static_foo();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// --- template_function.h
|
||||
|
||||
template<typename T>
|
||||
auto foo(T a) -> void;
|
||||
auto template_foo(T a) -> void;
|
||||
|
||||
template<typename T>
|
||||
auto bar(T a) -> T;
|
||||
auto template_bar(T a) -> T;
|
||||
|
||||
// --- import_template_function.carbon
|
||||
|
||||
@@ -167,13 +167,13 @@ import Cpp library "template_function.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.template_foo(1 as i32);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
fn G() -> i32 {
|
||||
//@dump-sem-ir-begin
|
||||
return Cpp.bar(1 as i32);
|
||||
return Cpp.template_bar(1 as i32);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -185,26 +185,26 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %global_foo.cpp_overload_set.type: type = cpp_overload_set_type @global_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %global_foo.cpp_overload_set.value: %global_foo.cpp_overload_set.type = cpp_overload_set_value @global_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %global_foo.type: type = fn_type @global_foo [concrete]
|
||||
// CHECK:STDOUT: %global_foo: %global_foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .global_foo = %global_foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %global_foo.cpp_overload_set.value: %global_foo.cpp_overload_set.type = cpp_overload_set_value @global_foo.cpp_overload_set [concrete = constants.%global_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %global_foo.decl: %global_foo.type = fn_decl @global_foo [concrete = constants.%global_foo] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @MyF() {
|
||||
// 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: %foo.call: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %global_foo.ref: %global_foo.cpp_overload_set.type = name_ref global_foo, imports.%global_foo.cpp_overload_set.value [concrete = constants.%global_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %global_foo.call: init %empty_tuple.type = call imports.%global_foo.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -239,49 +239,49 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %overloaded_foo.cpp_overload_set.type: type = cpp_overload_set_type @overloaded_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %overloaded_foo.cpp_overload_set.value: %overloaded_foo.cpp_overload_set.type = cpp_overload_set_value @overloaded_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %overloaded_foo.type: type = fn_type @overloaded_foo [concrete]
|
||||
// CHECK:STDOUT: %overloaded_foo: %overloaded_foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .overloaded_foo = %overloaded_foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %overloaded_foo.cpp_overload_set.value: %overloaded_foo.cpp_overload_set.type = cpp_overload_set_value @overloaded_foo.cpp_overload_set [concrete = constants.%overloaded_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %overloaded_foo.decl: %overloaded_foo.type = fn_decl @overloaded_foo [concrete = constants.%overloaded_foo] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: 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: %foo.call: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %overloaded_foo.ref: %overloaded_foo.cpp_overload_set.type = name_ref overloaded_foo, imports.%overloaded_foo.cpp_overload_set.value [concrete = constants.%overloaded_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %overloaded_foo.call: init %empty_tuple.type = call imports.%overloaded_foo.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_todo_import_variadic.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %variadic_foo.cpp_overload_set.type: type = cpp_overload_set_type @variadic_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %variadic_foo.cpp_overload_set.value: %variadic_foo.cpp_overload_set.type = cpp_overload_set_value @variadic_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .variadic_foo = %variadic_foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %variadic_foo.cpp_overload_set.value: %variadic_foo.cpp_overload_set.type = cpp_overload_set_value @variadic_foo.cpp_overload_set [concrete = constants.%variadic_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: 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: %variadic_foo.ref: %variadic_foo.cpp_overload_set.type = name_ref variadic_foo, imports.%variadic_foo.cpp_overload_set.value [concrete = constants.%variadic_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_8: Core.IntLiteral = int_value 8 [concrete = constants.%int_8]
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
@@ -290,26 +290,26 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %static_foo.cpp_overload_set.type: type = cpp_overload_set_type @static_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %static_foo.cpp_overload_set.value: %static_foo.cpp_overload_set.type = cpp_overload_set_value @static_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %static_foo.type: type = fn_type @static_foo [concrete]
|
||||
// CHECK:STDOUT: %static_foo: %static_foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .static_foo = %static_foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %static_foo.cpp_overload_set.value: %static_foo.cpp_overload_set.type = cpp_overload_set_value @static_foo.cpp_overload_set [concrete = constants.%static_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %static_foo.decl: %static_foo.type = fn_decl @static_foo [concrete = constants.%static_foo] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: 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: %foo.call: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %static_foo.ref: %static_foo.cpp_overload_set.type = name_ref static_foo, imports.%static_foo.cpp_overload_set.value [concrete = constants.%static_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %static_foo.call: init %empty_tuple.type = call imports.%static_foo.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -317,8 +317,8 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %template_foo.cpp_overload_set.type: type = cpp_overload_set_type @template_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %template_foo.cpp_overload_set.value: %template_foo.cpp_overload_set.type = cpp_overload_set_value @template_foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %int_1.5b8: Core.IntLiteral = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %int_32: Core.IntLiteral = int_value 32 [concrete]
|
||||
// CHECK:STDOUT: %i32: type = class_type @Int, @Int(%int_32) [concrete]
|
||||
@@ -336,30 +336,30 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.specific_fn: <specific function> = specific_function %Core.IntLiteral.as.As.impl.Convert.8a4, @Core.IntLiteral.as.As.impl.Convert(%int_32) [concrete]
|
||||
// CHECK:STDOUT: %bound_method: <bound method> = bound_method %int_1.5b8, %Core.IntLiteral.as.As.impl.Convert.specific_fn [concrete]
|
||||
// CHECK:STDOUT: %int_1.0c6: %i32 = int_value 1 [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %bar.cpp_overload_set.type: type = cpp_overload_set_type @bar.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %bar.cpp_overload_set.value: %bar.cpp_overload_set.type = cpp_overload_set_value @bar.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %bar.type: type = fn_type @bar [concrete]
|
||||
// CHECK:STDOUT: %bar: %bar.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %template_foo.type: type = fn_type @template_foo [concrete]
|
||||
// CHECK:STDOUT: %template_foo: %template_foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %template_bar.cpp_overload_set.type: type = cpp_overload_set_type @template_bar.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %template_bar.cpp_overload_set.value: %template_bar.cpp_overload_set.type = cpp_overload_set_value @template_bar.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %template_bar.type: type = fn_type @template_bar [concrete]
|
||||
// CHECK:STDOUT: %template_bar: %template_bar.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .bar = %bar.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .template_foo = %template_foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .template_bar = %template_bar.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %template_foo.cpp_overload_set.value: %template_foo.cpp_overload_set.type = cpp_overload_set_value @template_foo.cpp_overload_set [concrete = constants.%template_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Core.import_ref.64b: @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert.type (%Core.IntLiteral.as.As.impl.Convert.type.c5d) = import_ref Core//prelude/parts/int, loc{{\d+_\d+}}, loaded [symbolic = @Core.IntLiteral.as.As.impl.%Core.IntLiteral.as.As.impl.Convert (constants.%Core.IntLiteral.as.As.impl.Convert.6ee)]
|
||||
// CHECK:STDOUT: %As.impl_witness_table.d22 = impl_witness_table (%Core.import_ref.64b), @Core.IntLiteral.as.As.impl [concrete]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %template_foo.decl: %template_foo.type = fn_decl @template_foo [concrete = constants.%template_foo] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %bar.cpp_overload_set.value: %bar.cpp_overload_set.type = cpp_overload_set_value @bar.cpp_overload_set [concrete = constants.%bar.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %bar.decl: %bar.type = fn_decl @bar [concrete = constants.%bar] {
|
||||
// CHECK:STDOUT: %template_bar.cpp_overload_set.value: %template_bar.cpp_overload_set.type = cpp_overload_set_value @template_bar.cpp_overload_set [concrete = constants.%template_bar.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %template_bar.decl: %template_bar.type = fn_decl @template_bar [concrete = constants.%template_bar] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -369,34 +369,34 @@ fn G() -> i32 {
|
||||
// CHECK:STDOUT: 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: %template_foo.ref: %template_foo.cpp_overload_set.type = name_ref template_foo, imports.%template_foo.cpp_overload_set.value [concrete = constants.%template_foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %i32: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %impl.elem0: %.453 = impl_witness_access constants.%As.impl_witness.e7f, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.8a4]
|
||||
// CHECK:STDOUT: %bound_method.loc8_13.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc8_22.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc8_13.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc8_13.2(%int_1) [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc8_13.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc8_13.2: %i32 = converted %int_1, %.loc8_13.1 [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc8_13.2)
|
||||
// CHECK:STDOUT: %bound_method.loc8_22.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc8_22.2(%int_1) [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc8_22.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc8_22.2: %i32 = converted %int_1, %.loc8_22.1 [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %template_foo.call: init %empty_tuple.type = call imports.%template_foo.decl(%.loc8_22.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @G() -> out %return.param: %i32 {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %bar.ref: %bar.cpp_overload_set.type = name_ref bar, imports.%bar.cpp_overload_set.value [concrete = constants.%bar.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %template_bar.ref: %template_bar.cpp_overload_set.type = name_ref template_bar, imports.%template_bar.cpp_overload_set.value [concrete = constants.%template_bar.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %int_1: Core.IntLiteral = int_value 1 [concrete = constants.%int_1.5b8]
|
||||
// CHECK:STDOUT: %i32.loc14: type = type_literal constants.%i32 [concrete = constants.%i32]
|
||||
// CHECK:STDOUT: %impl.elem0: %.453 = impl_witness_access constants.%As.impl_witness.e7f, element0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.8a4]
|
||||
// CHECK:STDOUT: %bound_method.loc14_20.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %bound_method.loc14_29.1: <bound method> = bound_method %int_1, %impl.elem0 [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.bound]
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @Core.IntLiteral.as.As.impl.Convert(constants.%int_32) [concrete = constants.%Core.IntLiteral.as.As.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc14_20.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc14_20.2(%int_1) [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc14_20.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc14_20.2: %i32 = converted %int_1, %.loc14_20.1 [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %bar.call: init %i32 = call imports.%bar.decl(%.loc14_20.2)
|
||||
// CHECK:STDOUT: return %bar.call
|
||||
// CHECK:STDOUT: %bound_method.loc14_29.2: <bound method> = bound_method %int_1, %specific_fn [concrete = constants.%bound_method]
|
||||
// CHECK:STDOUT: %Core.IntLiteral.as.As.impl.Convert.call: init %i32 = call %bound_method.loc14_29.2(%int_1) [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc14_29.1: %i32 = value_of_initializer %Core.IntLiteral.as.As.impl.Convert.call [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %.loc14_29.2: %i32 = converted %int_1, %.loc14_29.1 [concrete = constants.%int_1.0c6]
|
||||
// CHECK:STDOUT: %template_bar.call: init %i32 = call imports.%template_bar.decl(%.loc14_29.2)
|
||||
// CHECK:STDOUT: return %template_bar.call
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// --- with_definition.h
|
||||
|
||||
inline void foo() {}
|
||||
inline void inline_with_def() {}
|
||||
|
||||
// --- import_with_definition.carbon
|
||||
|
||||
@@ -26,7 +26,7 @@ import Cpp library "with_definition.h";
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo();
|
||||
Cpp.inline_with_def();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -37,10 +37,10 @@ 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 'foo' is not defined [CppInteropParseWarning]
|
||||
// CHECK:STDERR: 6 | inline void foo();
|
||||
// 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: | ^
|
||||
inline void foo();
|
||||
inline void inline_without_def();
|
||||
|
||||
// --- todo_fail_import_without_definition.carbon
|
||||
|
||||
@@ -50,14 +50,14 @@ import Cpp library "without_definition.h";
|
||||
|
||||
fn MyF() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: todo_fail_import_without_definition.carbon:[[@LINE+4]]:11: note: used here [CppInteropParseNote]
|
||||
// CHECK:STDERR: 12 | Cpp.foo();
|
||||
// CHECK:STDERR: | ^
|
||||
// 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:
|
||||
Cpp.foo();
|
||||
Cpp.inline_without_def();
|
||||
|
||||
// Don't error on repeated calls.
|
||||
Cpp.foo();
|
||||
Cpp.inline_without_def();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -89,26 +89,26 @@ fn MyF() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %inline_with_def.cpp_overload_set.type: type = cpp_overload_set_type @inline_with_def.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %inline_with_def.cpp_overload_set.value: %inline_with_def.cpp_overload_set.type = cpp_overload_set_value @inline_with_def.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %inline_with_def.type: type = fn_type @inline_with_def [concrete]
|
||||
// CHECK:STDOUT: %inline_with_def: %inline_with_def.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .inline_with_def = %inline_with_def.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %inline_with_def.cpp_overload_set.value: %inline_with_def.cpp_overload_set.type = cpp_overload_set_value @inline_with_def.cpp_overload_set [concrete = constants.%inline_with_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_with_def.decl: %inline_with_def.type = fn_decl @inline_with_def [concrete = constants.%inline_with_def] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @MyF() {
|
||||
// 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: %foo.call: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %inline_with_def.ref: %inline_with_def.cpp_overload_set.type = name_ref inline_with_def, imports.%inline_with_def.cpp_overload_set.value [concrete = constants.%inline_with_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_with_def.call: init %empty_tuple.type = call imports.%inline_with_def.decl()
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -116,29 +116,29 @@ fn MyF() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %inline_without_def.cpp_overload_set.type: type = cpp_overload_set_type @inline_without_def.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %inline_without_def.cpp_overload_set.value: %inline_without_def.cpp_overload_set.type = cpp_overload_set_value @inline_without_def.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %inline_without_def.type: type = fn_type @inline_without_def [concrete]
|
||||
// CHECK:STDOUT: %inline_without_def: %inline_without_def.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .inline_without_def = %inline_without_def.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {} {}
|
||||
// CHECK:STDOUT: %inline_without_def.cpp_overload_set.value: %inline_without_def.cpp_overload_set.type = cpp_overload_set_value @inline_without_def.cpp_overload_set [concrete = constants.%inline_without_def.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %inline_without_def.decl: %inline_without_def.type = fn_decl @inline_without_def [concrete = constants.%inline_without_def] {} {}
|
||||
// CHECK:STDOUT: }
|
||||
// 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: %foo.ref.loc12: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call.loc12: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// 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: %foo.ref.loc15: %foo.cpp_overload_set.type = name_ref foo, imports.%foo.cpp_overload_set.value [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.call.loc15: init %empty_tuple.type = call imports.%foo.decl()
|
||||
// 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: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
|
||||
+115
-115
@@ -16,8 +16,8 @@
|
||||
|
||||
// --- multiple_functions_no_overloads.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto bar(short a) -> void;
|
||||
auto no_overloads_foo(short a) -> void;
|
||||
auto no_overloads_bar(short a) -> void;
|
||||
|
||||
// --- import_multiple_functions_no_overloads.carbon
|
||||
|
||||
@@ -26,13 +26,13 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "multiple_functions_no_overloads.h";
|
||||
|
||||
fn F() {
|
||||
Cpp.bar(1 as i16);
|
||||
Cpp.no_overloads_bar(1 as i16);
|
||||
}
|
||||
|
||||
// --- overloaded_functions.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto foo(int a) -> void;
|
||||
auto overloaded_foo(short a) -> void;
|
||||
auto overloaded_foo(int a) -> void;
|
||||
|
||||
// --- import_overloaded_functions.carbon
|
||||
|
||||
@@ -41,13 +41,13 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "overloaded_functions.h";
|
||||
|
||||
fn F() {
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.overloaded_foo(1 as i32);
|
||||
}
|
||||
|
||||
// --- both_overloaded_functions_called.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto foo(int a) -> void;
|
||||
auto both_called_foo(short a) -> void;
|
||||
auto both_called_foo(int a) -> void;
|
||||
|
||||
// --- import_both_overloaded_functions_called.carbon
|
||||
|
||||
@@ -56,17 +56,17 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "both_overloaded_functions_called.h";
|
||||
|
||||
fn F() {
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.foo(1 as i16);
|
||||
Cpp.both_called_foo(1 as i32);
|
||||
Cpp.both_called_foo(1 as i16);
|
||||
}
|
||||
|
||||
// --- multiple_overloaded_sets.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto foo(int a) -> void;
|
||||
auto multi_set_foo(short a) -> void;
|
||||
auto multi_set_foo(int a) -> void;
|
||||
|
||||
auto bar(long a) -> void;
|
||||
auto bar(int a) -> void;
|
||||
auto multi_set_bar(long a) -> void;
|
||||
auto multi_set_bar(int a) -> void;
|
||||
|
||||
// --- import_multiple_overloaded_sets.carbon
|
||||
|
||||
@@ -75,8 +75,8 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "multiple_overloaded_sets.h";
|
||||
|
||||
fn F() {
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.bar(1 as i32);
|
||||
Cpp.multi_set_foo(1 as i32);
|
||||
Cpp.multi_set_bar(1 as i32);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -85,17 +85,17 @@ fn F() {
|
||||
|
||||
// --- int_literal.h
|
||||
|
||||
auto foo(int a) -> int;
|
||||
auto foo(unsigned int a) -> unsigned int;
|
||||
auto int_literal_foo(int a) -> int;
|
||||
auto int_literal_foo(unsigned int a) -> unsigned int;
|
||||
|
||||
auto foo(long a) -> long;
|
||||
auto foo(unsigned long a) -> unsigned long;
|
||||
auto int_literal_foo(long a) -> long;
|
||||
auto int_literal_foo(unsigned long a) -> unsigned long;
|
||||
|
||||
auto foo(long long a) -> long long;
|
||||
auto foo(unsigned long long a) -> unsigned long long;
|
||||
auto int_literal_foo(long long a) -> long long;
|
||||
auto int_literal_foo(unsigned long long a) -> unsigned long long;
|
||||
|
||||
auto foo(__int128 a) -> __int128;
|
||||
auto foo(unsigned __int128 a) -> unsigned __int128;
|
||||
auto int_literal_foo(__int128 a) -> __int128;
|
||||
auto int_literal_foo(unsigned __int128 a) -> unsigned __int128;
|
||||
|
||||
// --- import_int_literal.carbon
|
||||
|
||||
@@ -105,30 +105,30 @@ import Cpp library "int_literal.h";
|
||||
|
||||
fn F() {
|
||||
// i32_max
|
||||
let unused a: i32 = Cpp.foo(2147483647);
|
||||
let unused a: i32 = Cpp.int_literal_foo(2147483647);
|
||||
|
||||
// i32_max + 1
|
||||
// It could fit to unsigned int, but only signed integers are considered, so assigned to long.
|
||||
// Decimal, hexadecimal and binary integer literals are treated the same when assigning a C++ type.
|
||||
let unused b: i64 = Cpp.foo(2147483648);
|
||||
let unused b_hexa: i64 = Cpp.foo(0x8000_0000);
|
||||
let unused b_binary: i64 = Cpp.foo(0b1000_0000_0000_0000_0000_0000_0000_0000);
|
||||
let unused b: i64 = Cpp.int_literal_foo(2147483648);
|
||||
let unused b_hexa: i64 = Cpp.int_literal_foo(0x8000_0000);
|
||||
let unused b_binary: i64 = Cpp.int_literal_foo(0b1000_0000_0000_0000_0000_0000_0000_0000);
|
||||
|
||||
// i64_max
|
||||
let unused c: i64 = Cpp.foo(9223372036854775807);
|
||||
let unused c: i64 = Cpp.int_literal_foo(9223372036854775807);
|
||||
|
||||
// i64_max + 1
|
||||
// Could fit to unsigned long, but only signed integers are considered, so fitted to _int128.
|
||||
let unused d: i128 = Cpp.foo(9223372036854775808);
|
||||
let unused d: i128 = Cpp.int_literal_foo(9223372036854775808);
|
||||
|
||||
// u64_max
|
||||
let unused e: i128 = Cpp.foo(18446744073709551615);
|
||||
let unused e: i128 = Cpp.int_literal_foo(18446744073709551615);
|
||||
|
||||
// u64_max + 1
|
||||
let unused f: i128 = Cpp.foo(18446744073709551616);
|
||||
let unused f: i128 = Cpp.int_literal_foo(18446744073709551616);
|
||||
|
||||
// i128_max
|
||||
let unused g: i128 = Cpp.foo(170141183460469231731687303715884105727);
|
||||
let unused g: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105727);
|
||||
}
|
||||
|
||||
// --- fail_import_large_int_literal.carbon
|
||||
@@ -140,21 +140,21 @@ 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]]:32: 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.foo(170141183460469231731687303715884105728);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// 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:
|
||||
// CHECK:STDERR: fail_import_large_int_literal.carbon:[[@LINE+4]]:32: error: call argument of type `Core.IntLiteral` is not supported [CppCallArgTypeNotSupported]
|
||||
// CHECK:STDERR: let unused h: i128 = Cpp.foo(170141183460469231731687303715884105728);
|
||||
// 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:
|
||||
let unused h: i128 = Cpp.foo(170141183460469231731687303715884105728);
|
||||
let unused h: i128 = Cpp.int_literal_foo(170141183460469231731687303715884105728);
|
||||
}
|
||||
|
||||
// --- negative_int_literal.h
|
||||
|
||||
auto foo(long a) -> void;
|
||||
auto foo(int a) -> void;
|
||||
auto neg_literal_foo(long a) -> void;
|
||||
auto neg_literal_foo(int a) -> void;
|
||||
|
||||
// --- import_negative_int_literal.carbon
|
||||
|
||||
@@ -163,13 +163,13 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "negative_int_literal.h";
|
||||
|
||||
fn F() {
|
||||
// selects `auto foo(int a) -> void;`
|
||||
Cpp.foo(-1);
|
||||
// selects `auto neg_literal_foo(int a) -> void;`
|
||||
Cpp.neg_literal_foo(-1);
|
||||
}
|
||||
|
||||
// --- negative_literal_passed_to_unsigned.h
|
||||
|
||||
auto foo(unsigned int a) -> void;
|
||||
auto neg_to_unsigned_foo(unsigned int a) -> void;
|
||||
|
||||
// --- fail_import_negative_literal_passed_to_unsigned.carbon
|
||||
|
||||
@@ -178,21 +178,21 @@ 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]]:11: error: negative integer value -1 converted to unsigned type `u32` [NegativeIntInUnsignedType]
|
||||
// CHECK:STDERR: Cpp.foo(-1);
|
||||
// CHECK:STDERR: ^~
|
||||
// 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: ./negative_literal_passed_to_unsigned.h:2:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// 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.foo(-1);
|
||||
Cpp.neg_to_unsigned_foo(-1);
|
||||
}
|
||||
|
||||
// --- floating_point_literal.h
|
||||
|
||||
auto foo(float a) -> float;
|
||||
auto foo(double a) -> double;
|
||||
auto float_literal_foo(float a) -> float;
|
||||
auto float_literal_foo(double a) -> double;
|
||||
|
||||
// --- import_floating_point_literal.carbon
|
||||
|
||||
@@ -201,7 +201,7 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "floating_point_literal.h";
|
||||
|
||||
fn F() {
|
||||
let unused d: f64 = Cpp.foo(1.0);
|
||||
let unused d: f64 = Cpp.float_literal_foo(1.0);
|
||||
}
|
||||
|
||||
// --- fail_import_large_floating_point_literal.carbon
|
||||
@@ -211,15 +211,15 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "floating_point_literal.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_large_floating_point_literal.carbon:[[@LINE+8]]:11: error: value 18*10^307 too large for floating-point type `f64` [FloatLiteralTooLargeForType]
|
||||
// CHECK:STDERR: Cpp.foo(1.8e+308);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// 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: ./floating_point_literal.h:3:17: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(double a) -> double;
|
||||
// CHECK:STDERR: ^
|
||||
// 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.foo(1.8e+308);
|
||||
Cpp.float_literal_foo(1.8e+308);
|
||||
}
|
||||
|
||||
// --- struct_init.h
|
||||
@@ -630,7 +630,7 @@ fn F() {
|
||||
|
||||
// --- upsizing.h
|
||||
|
||||
auto foo(int a) -> void;
|
||||
auto upsizing_foo(int a) -> void;
|
||||
|
||||
// --- upsizing.carbon
|
||||
|
||||
@@ -639,12 +639,12 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "upsizing.h";
|
||||
|
||||
fn F() {
|
||||
Cpp.foo(1 as i16);
|
||||
Cpp.upsizing_foo(1 as i16);
|
||||
}
|
||||
|
||||
// --- signedness_change.h
|
||||
|
||||
auto foo(unsigned int a) -> void;
|
||||
auto signedness_foo(unsigned int a) -> void;
|
||||
|
||||
// --- fail_signedness_change_rejected.carbon
|
||||
|
||||
@@ -653,23 +653,23 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "signedness_change.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+11]]:11: error: cannot implicitly convert expression of type `i32` to `u32` [ConversionFailure]
|
||||
// CHECK:STDERR: Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// CHECK:STDERR: fail_signedness_change_rejected.carbon:[[@LINE+8]]:11: note: type `i32` does not implement interface `Core.ImplicitAs(u32)` [MissingImplInMemberAccessInContext]
|
||||
// CHECK:STDERR: Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: ^~~~~~~~
|
||||
// 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: ./signedness_change.h:2:23: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(unsigned int a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// 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.foo(1 as i32);
|
||||
Cpp.signedness_foo(1 as i32);
|
||||
}
|
||||
|
||||
// --- downsizing_rejected.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto downsizing_foo(short a) -> void;
|
||||
|
||||
// --- fail_import_downsizing_rejected.carbon
|
||||
|
||||
@@ -678,18 +678,18 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "downsizing_rejected.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_downsizing_rejected.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_downsizing_rejected.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_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: ./downsizing_rejected.h:2:16: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: auto foo(short a) -> void;
|
||||
// CHECK:STDERR: ^
|
||||
// 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.foo(1 as i32);
|
||||
Cpp.downsizing_foo(1 as i32);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -698,7 +698,7 @@ fn F() {
|
||||
|
||||
// --- no_viable_function.h
|
||||
|
||||
auto foo(short a, int b) -> void;
|
||||
auto no_viable_foo(short a, int b) -> void;
|
||||
|
||||
// --- fail_import_no_viable_function.carbon
|
||||
|
||||
@@ -707,15 +707,15 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "no_viable_function.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_no_viable_function.carbon:[[@LINE+8]]:19: error: no matching function for call to 'foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 15 | Cpp.foo(1 as i64);
|
||||
// CHECK:STDERR: | ^
|
||||
// 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 foo(short a, int b) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR: 2 | auto no_viable_foo(short a, int b) -> void;
|
||||
// CHECK:STDERR: | ^ ~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1 as i64);
|
||||
Cpp.no_viable_foo(1 as i64);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -724,8 +724,8 @@ fn F() {
|
||||
|
||||
// --- ambiguous_overload.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto foo(int a) -> void;
|
||||
auto ambiguous_foo(short a) -> void;
|
||||
auto ambiguous_foo(int a) -> void;
|
||||
|
||||
// --- fail_import_ambiguous_overload.carbon
|
||||
|
||||
@@ -734,19 +734,19 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "ambiguous_overload.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_ambiguous_overload.carbon:[[@LINE+12]]:19: error: call to 'foo' is ambiguous [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.foo(1 as i64);
|
||||
// CHECK:STDERR: | ^
|
||||
// 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: ./ambiguous_overload.h:2:6: note: candidate function [CppInteropParseNote]
|
||||
// CHECK:STDERR: 2 | auto foo(short a) -> void;
|
||||
// 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 foo(int a) -> void;
|
||||
// CHECK:STDERR: 3 | auto ambiguous_foo(int a) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1 as i64);
|
||||
Cpp.ambiguous_foo(1 as i64);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -755,8 +755,8 @@ fn F() {
|
||||
|
||||
// --- deleted_function.h
|
||||
|
||||
auto foo(short a) -> void;
|
||||
auto foo(int a) -> void = delete;
|
||||
auto deleted_foo(short a) -> void;
|
||||
auto deleted_foo(int a) -> void = delete;
|
||||
|
||||
// --- fail_import_deleted_function.carbon
|
||||
|
||||
@@ -765,27 +765,27 @@ library "[[@TEST_NAME]]";
|
||||
import Cpp library "deleted_function.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_import_deleted_function.carbon:[[@LINE+12]]:19: error: call to deleted function 'foo' [CppInteropParseError]
|
||||
// CHECK:STDERR: 19 | Cpp.foo(1 as i32);
|
||||
// CHECK:STDERR: | ^
|
||||
// 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: ./deleted_function.h:3:6: note: candidate function has been explicitly deleted [CppInteropParseNote]
|
||||
// CHECK:STDERR: 3 | auto foo(int a) -> void = delete;
|
||||
// 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 foo(short a) -> void;
|
||||
// CHECK:STDERR: 2 | auto deleted_foo(short a) -> void;
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo(1 as i32);
|
||||
Cpp.deleted_foo(1 as i32);
|
||||
}
|
||||
|
||||
// --- fail_missing_impl.carbon
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
void foo();
|
||||
void foo(int);
|
||||
void missing_impl_foo();
|
||||
void missing_impl_foo(int);
|
||||
''';
|
||||
|
||||
interface I {}
|
||||
@@ -793,12 +793,12 @@ 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.foo>` into type implementing `I` [ConversionFailureTypeToFacet]
|
||||
// CHECK:STDERR: EchoValue(Cpp.foo);
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~
|
||||
// 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:
|
||||
EchoValue(Cpp.foo);
|
||||
EchoValue(Cpp.missing_impl_foo);
|
||||
}
|
||||
|
||||
+836
-836
File diff suppressed because it is too large
Load Diff
@@ -462,23 +462,23 @@ library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp;
|
||||
|
||||
class X {}
|
||||
class XByRef {}
|
||||
|
||||
inline Cpp '''c++
|
||||
template<typename T> void TakeAnything_ExpectConstLRef(T&&) {
|
||||
static_assert(__is_same(T, const Carbon::X&));
|
||||
template<typename T> void TakeAnything_ExpectConstLRef_ByRef(T&&) {
|
||||
static_assert(__is_same(T, const Carbon::XByRef&));
|
||||
}
|
||||
''';
|
||||
|
||||
fn PassConstRef(ref x: const X) {
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE+7]]:36: error: `ref` tag is not an argument to a `ref` parameter [RefTagNoRefParam]
|
||||
// CHECK:STDERR: Cpp.TakeAnything_ExpectConstLRef(ref x);
|
||||
// CHECK:STDERR: ^~~~~
|
||||
// CHECK:STDERR: fail_todo_forwarding_reference_by_ref.carbon:[[@LINE-9]]:59: note: initializing function parameter [InCallToFunctionParam]
|
||||
// CHECK:STDERR: template<typename T> void TakeAnything_ExpectConstLRef(T&&) {
|
||||
// CHECK:STDERR: ^
|
||||
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:
|
||||
Cpp.TakeAnything_ExpectConstLRef(ref x);
|
||||
Cpp.TakeAnything_ExpectConstLRef_ByRef(ref x);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+394
-394
File diff suppressed because it is too large
Load Diff
@@ -29,9 +29,9 @@ let min_explicit_literal: i32 = Cpp.min(i32, 1, 2);
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<typename> struct X;
|
||||
template<typename> struct Y;
|
||||
template<template<typename> typename... TT, typename... T> void f(T ...a) {}
|
||||
template<typename> struct TemplateTemplateX;
|
||||
template<typename> struct TemplateTemplateY;
|
||||
template<template<typename> typename... TT, typename... T> void template_template_fn(T ...a) {}
|
||||
''';
|
||||
|
||||
fn Call() {
|
||||
@@ -40,15 +40,15 @@ fn Call() {
|
||||
|
||||
// `a` and `b` are not classified as template arguments, so are passed as the
|
||||
// function parameter pack `a...`.
|
||||
Cpp.f(a, b);
|
||||
Cpp.template_template_fn(a, b);
|
||||
|
||||
// `Cpp.X` and `Cpp.Y` are classified as template template arguments, so they
|
||||
// `Cpp.TemplateTemplateX` and `Cpp.TemplateTemplateY` are classified as template template arguments, so they
|
||||
// are passed as the template parameter pack `TT...`.
|
||||
Cpp.f(Cpp.X, Cpp.Y);
|
||||
Cpp.template_template_fn(Cpp.TemplateTemplateX, Cpp.TemplateTemplateY);
|
||||
|
||||
// Pass some template arguments followed by some function arguments.
|
||||
Cpp.f(Cpp.X, Cpp.Y, a, b);
|
||||
Cpp.f(Cpp.X, a, b, a);
|
||||
Cpp.template_template_fn(Cpp.TemplateTemplateX, Cpp.TemplateTemplateY, a, b);
|
||||
Cpp.template_template_fn(Cpp.TemplateTemplateX, a, b, a);
|
||||
}
|
||||
|
||||
// --- nontype_template_arg.carbon
|
||||
@@ -56,25 +56,25 @@ fn Call() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<int... I, typename... T> void f(T ...a) {}
|
||||
template<int I = 0, int J = 0, typename = void, typename... T> void g(T ...a) {}
|
||||
template<int... I, typename... T> void nontype_f(T ...a) {}
|
||||
template<int I = 0, int J = 0, typename = void, typename... T> void nontype_g(T ...a) {}
|
||||
''';
|
||||
|
||||
fn Call() {
|
||||
let a: i32 = 0;
|
||||
let b: i32 = 0;
|
||||
|
||||
Cpp.f(a, b);
|
||||
Cpp.nontype_f(a, b);
|
||||
// TODO: There should be a way to indicate that the arguments are template
|
||||
// arguments, not function arguments, when calling `f`.
|
||||
Cpp.f(1, 2);
|
||||
// arguments, not function arguments, when calling `nontype_f`.
|
||||
Cpp.nontype_f(1, 2);
|
||||
|
||||
// Two function arguments.
|
||||
Cpp.g(1, 2);
|
||||
Cpp.nontype_g(1, 2);
|
||||
// Three template arguments.
|
||||
Cpp.g(1, 2, i32);
|
||||
Cpp.nontype_g(1, 2, i32);
|
||||
// Three template arguments and two function arguments.
|
||||
Cpp.g(1, 2, i32, 3, 4);
|
||||
Cpp.nontype_g(1, 2, i32, 3, 4);
|
||||
}
|
||||
|
||||
// --- fail_function_arg_not_template_arg.carbon
|
||||
@@ -82,19 +82,19 @@ fn Call() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<int N> void f();
|
||||
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]]:10: error: no matching function for call to 'f' [CppInteropParseError]
|
||||
// CHECK:STDERR: 17 | Cpp.f(1);
|
||||
// CHECK:STDERR: | ^
|
||||
// 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 f();
|
||||
// CHECK:STDERR: 5 | template<int N> void fn_arg_not_template_arg_f();
|
||||
// CHECK:STDERR: | ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.f(1);
|
||||
Cpp.fn_arg_not_template_arg_f(1);
|
||||
}
|
||||
|
||||
// --- function_arg_not_template_arg_overloaded.carbon
|
||||
@@ -102,12 +102,12 @@ fn Call() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<int N> void f();
|
||||
void f(int n);
|
||||
template<int N> void overloaded_f();
|
||||
void overloaded_f(int n);
|
||||
''';
|
||||
|
||||
fn Call() {
|
||||
Cpp.f(1);
|
||||
Cpp.overloaded_f(1);
|
||||
}
|
||||
|
||||
// --- overloaded_with_different_template_params.carbon
|
||||
@@ -115,18 +115,18 @@ fn Call() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
template<typename T> struct X;
|
||||
struct Y;
|
||||
template<typename T> struct OverloadedTemplateX;
|
||||
struct OverloadedNonTemplateY;
|
||||
|
||||
template<int N, typename T> void f();
|
||||
template<typename T> void f();
|
||||
template<template<typename> typename T> void f();
|
||||
template<int N, typename T> void different_template_params_f();
|
||||
template<typename T> void different_template_params_f();
|
||||
template<template<typename> typename T> void different_template_params_f();
|
||||
''';
|
||||
|
||||
fn Call() {
|
||||
Cpp.f(1, i32);
|
||||
Cpp.f(Cpp.X);
|
||||
Cpp.f(Cpp.Y);
|
||||
Cpp.different_template_params_f(1, i32);
|
||||
Cpp.different_template_params_f(Cpp.OverloadedTemplateX);
|
||||
Cpp.different_template_params_f(Cpp.OverloadedNonTemplateY);
|
||||
}
|
||||
|
||||
// --- only_call_templates_when_given_template_args.carbon
|
||||
@@ -137,13 +137,13 @@ import Cpp inline '''
|
||||
struct NonTemplate {};
|
||||
struct Template {};
|
||||
|
||||
NonTemplate f(unsigned char, unsigned char);
|
||||
template<typename = void> Template f(unsigned char, int = 0);
|
||||
NonTemplate only_call_templates_f(unsigned char, unsigned char);
|
||||
template<typename = void> Template only_call_templates_f(unsigned char, int = 0);
|
||||
''';
|
||||
|
||||
// Prefers the non-template because it has a better match for the second parameter.
|
||||
let x: Cpp.NonTemplate = Cpp.f(1 as u8, 2 as u8);
|
||||
let x: Cpp.NonTemplate = Cpp.only_call_templates_f(1 as u8, 2 as u8);
|
||||
|
||||
// Calls the template; the non-template is not considered due to the template
|
||||
// argument `i32`.
|
||||
let y: Cpp.Template = Cpp.f(i32, 1 as u8);
|
||||
let y: Cpp.Template = Cpp.only_call_templates_f(i32, 1 as u8);
|
||||
|
||||
+365
-365
File diff suppressed because it is too large
Load Diff
+144
-144
@@ -15,12 +15,12 @@
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto foo(void* _Nonnull x) -> void;
|
||||
auto foo_non_nullable_param(void* _Nonnull x) -> void;
|
||||
''';
|
||||
|
||||
fn F(input: Cpp.void*) {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo(input);
|
||||
Cpp.foo_non_nullable_param(input);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -29,12 +29,12 @@ fn F(input: Cpp.void*) {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto foo() -> void* _Nonnull;
|
||||
auto foo_non_nullable_return() -> void* _Nonnull;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
let unused output: Cpp.void* = Cpp.foo();
|
||||
let unused output: Cpp.void* = Cpp.foo_non_nullable_return();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -43,12 +43,12 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto foo(void* x) -> void;
|
||||
auto foo_nullable_param(void* x) -> void;
|
||||
''';
|
||||
|
||||
fn F(input: Cpp.void*) {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo(input);
|
||||
Cpp.foo_nullable_param(input);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -57,12 +57,12 @@ fn F(input: Cpp.void*) {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto foo(void* x) -> void;
|
||||
auto foo_null_param(void* x) -> void;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
Cpp.foo(Core.Optional(Cpp.void*).None());
|
||||
Cpp.foo_null_param(Core.Optional(Cpp.void*).None());
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -71,12 +71,12 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto foo() -> void*;
|
||||
auto foo_nullable_return() -> void*;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
let unused output: Core.Optional(Cpp.void*) = Cpp.foo();
|
||||
let unused output: Core.Optional(Cpp.void*) = Cpp.foo_nullable_return();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -85,14 +85,14 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto Return() -> void* _Nonnull* _Nonnull;
|
||||
auto Invoke(void* _Nonnull* _Nonnull) -> void;
|
||||
auto Return_pointer() -> void* _Nonnull* _Nonnull;
|
||||
auto Invoke_pointer(void* _Nonnull* _Nonnull) -> void;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var non_nullable_pointer: Cpp.void** = Cpp.Return();
|
||||
Cpp.Invoke(non_nullable_pointer);
|
||||
var non_nullable_pointer: Cpp.void** = Cpp.Return_pointer();
|
||||
Cpp.Invoke_pointer(non_nullable_pointer);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -101,14 +101,14 @@ fn F() {
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
auto Return() -> const void* _Nonnull;
|
||||
auto Invoke(const void* _Nonnull) -> void;
|
||||
auto Return_const() -> const void* _Nonnull;
|
||||
auto Invoke_const(const void* _Nonnull) -> void;
|
||||
''';
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
var const_void_pointer: const Cpp.void* = Cpp.Return();
|
||||
Cpp.Invoke(const_void_pointer);
|
||||
var const_void_pointer: const Cpp.void* = Cpp.Return_const();
|
||||
Cpp.Invoke_const(const_void_pointer);
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
@@ -118,20 +118,20 @@ fn F() {
|
||||
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Cpp.void [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.cpp_overload_set.type: type = cpp_overload_set_type @foo_non_nullable_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.cpp_overload_set.value: %foo_non_nullable_param.cpp_overload_set.type = cpp_overload_set_value @foo_non_nullable_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.type: type = fn_type @foo_non_nullable_param [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_param: %foo_non_nullable_param.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_non_nullable_param = %foo_non_nullable_param.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.cpp_overload_set.value: %foo_non_nullable_param.cpp_overload_set.type = cpp_overload_set_value @foo_non_nullable_param.cpp_overload_set [concrete = constants.%foo_non_nullable_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.decl: %foo_non_nullable_param.type = fn_decl @foo_non_nullable_param [concrete = constants.%foo_non_nullable_param] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -141,9 +141,9 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F(%input.param: %ptr) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10: <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: %foo_non_nullable_param.ref: %foo_non_nullable_param.cpp_overload_set.type = name_ref foo_non_nullable_param, imports.%foo_non_nullable_param.cpp_overload_set.value [concrete = constants.%foo_non_nullable_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %input.ref: %ptr = name_ref input, %input
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%input.ref)
|
||||
// CHECK:STDOUT: %foo_non_nullable_param.call: init %empty_tuple.type = call imports.%foo_non_nullable_param.decl(%input.ref)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -154,20 +154,20 @@ fn F() {
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %Cpp.void [concrete]
|
||||
// CHECK:STDOUT: %pattern_type: type = pattern_type %ptr [concrete]
|
||||
// CHECK:STDOUT: %output.patt: %pattern_type = value_binding_pattern output [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.cpp_overload_set.type: type = cpp_overload_set_type @foo_non_nullable_return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.cpp_overload_set.value: %foo_non_nullable_return.cpp_overload_set.type = cpp_overload_set_value @foo_non_nullable_return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.type: type = fn_type @foo_non_nullable_return [concrete]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return: %foo_non_nullable_return.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_non_nullable_return = %foo_non_nullable_return.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.cpp_overload_set.value: %foo_non_nullable_return.cpp_overload_set.type = cpp_overload_set_value @foo_non_nullable_return.cpp_overload_set [concrete = constants.%foo_non_nullable_return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.decl: %foo_non_nullable_return.type = fn_decl @foo_non_nullable_return [concrete = constants.%foo_non_nullable_return] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -177,16 +177,16 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_34: <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: %foo.call: init %ptr = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %.loc10_42.1: %ptr = value_of_initializer %foo.call
|
||||
// CHECK:STDOUT: %.loc10_42.2: %ptr = converted %foo.call, %.loc10_42.1
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.ref: %foo_non_nullable_return.cpp_overload_set.type = name_ref foo_non_nullable_return, imports.%foo_non_nullable_return.cpp_overload_set.value [concrete = constants.%foo_non_nullable_return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_non_nullable_return.call: init %ptr = call imports.%foo_non_nullable_return.decl()
|
||||
// CHECK:STDOUT: %.loc10_62.1: %ptr = value_of_initializer %foo_non_nullable_return.call
|
||||
// CHECK:STDOUT: %.loc10_62.2: %ptr = converted %foo_non_nullable_return.call, %.loc10_62.1
|
||||
// CHECK:STDOUT: %.loc10_30: type = splice_block %ptr [concrete = constants.%ptr] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_22: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %void.ref [concrete = constants.%ptr]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %output: %ptr = wrapper_binding output, %.loc10_42.2
|
||||
// CHECK:STDOUT: %output: %ptr = wrapper_binding output, %.loc10_62.2
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %output.patt: %pattern_type = value_binding_pattern output [concrete = constants.%output.patt]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -199,8 +199,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %Cpp.void: type = class_type @VoidBase [concrete]
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %ptr.00a: type = ptr_type %Cpp.void [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_param.cpp_overload_set.type: type = cpp_overload_set_type @foo_nullable_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_param.cpp_overload_set.value: %foo_nullable_param.cpp_overload_set.type = cpp_overload_set_value @foo_nullable_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete]
|
||||
// CHECK:STDOUT: %T.220: %OptionalStorage.type = symbolic_binding T, 0 [symbolic]
|
||||
// CHECK:STDOUT: %Destroy.type: type = facet_type <@Destroy> [concrete]
|
||||
@@ -220,8 +220,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %.a7d: type = maybe_unformed_type %ptr.00a [concrete]
|
||||
// CHECK:STDOUT: %OptionalStorage.facet.427: %OptionalStorage.type = facet_value %ptr.00a, (%OptionalStorage.impl_witness.d51) [concrete]
|
||||
// CHECK:STDOUT: %Optional.14b: type = class_type @Optional, @Optional(%OptionalStorage.facet.427) [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_param.type: type = fn_type @foo_nullable_param [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_param: %foo_nullable_param.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ImplicitAs.type.8e0: type = facet_type <@ImplicitAs, @ImplicitAs(%Optional.14b)> [concrete]
|
||||
// CHECK:STDOUT: %OptionalAs.type.3b8: type = facet_type <@OptionalAs, @OptionalAs(%T.220)> [symbolic]
|
||||
// CHECK:STDOUT: %U.042: %OptionalAs.type.3b8 = symbolic_binding U, 1 [symbolic]
|
||||
@@ -239,17 +239,17 @@ fn F() {
|
||||
// CHECK:STDOUT: %ImplicitAs.WithSelf.Convert.type.002: type = fn_type @ImplicitAs.WithSelf.Convert, @ImplicitAs.WithSelf(%Optional.14b, %ImplicitAs.facet.3be) [concrete]
|
||||
// CHECK:STDOUT: %.fde: type = fn_type_with_self_type %ImplicitAs.WithSelf.Convert.type.002, %ImplicitAs.facet.3be [concrete]
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %U.as_type.as.ImplicitAs.impl.Convert.f63, @U.as_type.as.ImplicitAs.impl.Convert.2(%OptionalStorage.facet.427, %OptionalAs.facet) [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_11.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_26.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_nullable_param = %foo_nullable_param.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_nullable_param.cpp_overload_set.value: %foo_nullable_param.cpp_overload_set.type = cpp_overload_set_value @foo_nullable_param.cpp_overload_set [concrete = constants.%foo_nullable_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Core.import_ref.509: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.ddb)]
|
||||
// CHECK:STDOUT: %Core.import_ref.105 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.fa7: @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.Some.type (%ptr.as.OptionalStorage.impl.Some.type.71e) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.Some (constants.%ptr.as.OptionalStorage.impl.Some.caa)]
|
||||
@@ -257,13 +257,13 @@ fn F() {
|
||||
// CHECK:STDOUT: %Core.import_ref.306 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.3e3 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %OptionalStorage.impl_witness_table.110 = impl_witness_table (%Core.import_ref.509, %Core.import_ref.105, %Core.import_ref.fa7, %Core.import_ref.a90, %Core.import_ref.306, %Core.import_ref.3e3), @ptr.as.OptionalStorage.impl [concrete]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %foo_nullable_param.decl: %foo_nullable_param.type = fn_decl @foo_nullable_param [concrete = constants.%foo_nullable_param] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc10_16.1: type = splice_block %Optional [concrete = constants.%Optional.14b] {
|
||||
// CHECK:STDOUT: %.loc10_31.1: type = splice_block %Optional [concrete = constants.%Optional.14b] {
|
||||
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value constants.%ptr.00a, (constants.%OptionalStorage.impl_witness.d51) [concrete = constants.%OptionalStorage.facet.427]
|
||||
// CHECK:STDOUT: %.loc10_16.2: %OptionalStorage.type = converted constants.%ptr.00a, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet.427]
|
||||
// CHECK:STDOUT: %.loc10_31.2: %OptionalStorage.type = converted constants.%ptr.00a, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet.427]
|
||||
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet.427) [concrete = constants.%Optional.14b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -277,34 +277,34 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F(%input.param: %ptr.00a) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10: <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: %foo_nullable_param.ref: %foo_nullable_param.cpp_overload_set.type = name_ref foo_nullable_param, imports.%foo_nullable_param.cpp_overload_set.value [concrete = constants.%foo_nullable_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %input.ref: %ptr.00a = name_ref input, %input
|
||||
// CHECK:STDOUT: %impl.elem0: %.fde = impl_witness_access constants.%ImplicitAs.impl_witness.50c, element0 [concrete = constants.%U.as_type.as.ImplicitAs.impl.Convert.f63]
|
||||
// CHECK:STDOUT: %bound_method.loc10_11.1: <bound method> = bound_method %input.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %bound_method.loc10_26.1: <bound method> = bound_method %input.ref, %impl.elem0
|
||||
// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @U.as_type.as.ImplicitAs.impl.Convert.2(constants.%OptionalStorage.facet.427, constants.%OptionalAs.facet) [concrete = constants.%U.as_type.as.ImplicitAs.impl.Convert.specific_fn]
|
||||
// CHECK:STDOUT: %bound_method.loc10_11.2: <bound method> = bound_method %input.ref, %specific_fn
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call: init %Optional.14b = call %bound_method.loc10_11.2(%input.ref)
|
||||
// CHECK:STDOUT: %.loc10_11.1: init %Optional.14b = converted %input.ref, %U.as_type.as.ImplicitAs.impl.Convert.call
|
||||
// CHECK:STDOUT: %.loc10_11.2: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_11.3: ref %Optional.14b = temporary %.loc10_11.2, %.loc10_11.1
|
||||
// CHECK:STDOUT: %.loc10_11.4: %Optional.14b = acquire_value %.loc10_11.3
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc10_11.4)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_11.3, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_11.3)
|
||||
// CHECK:STDOUT: %bound_method.loc10_26.2: <bound method> = bound_method %input.ref, %specific_fn
|
||||
// CHECK:STDOUT: %U.as_type.as.ImplicitAs.impl.Convert.call: init %Optional.14b = call %bound_method.loc10_26.2(%input.ref)
|
||||
// CHECK:STDOUT: %.loc10_26.1: init %Optional.14b = converted %input.ref, %U.as_type.as.ImplicitAs.impl.Convert.call
|
||||
// CHECK:STDOUT: %.loc10_26.2: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_26.3: ref %Optional.14b = temporary %.loc10_26.2, %.loc10_26.1
|
||||
// CHECK:STDOUT: %.loc10_26.4: %Optional.14b = acquire_value %.loc10_26.3
|
||||
// CHECK:STDOUT: %foo_nullable_param.call: init %empty_tuple.type = call imports.%foo_nullable_param.decl(%.loc10_26.4)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_26.3, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_26.3)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_11.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_26.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_11.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_26.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_11.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_26.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -313,8 +313,8 @@ fn F() {
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_null_param.cpp_overload_set.type: type = cpp_overload_set_type @foo_null_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_null_param.cpp_overload_set.value: %foo_null_param.cpp_overload_set.type = cpp_overload_set_value @foo_null_param.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Optional.type: type = generic_class_type @Optional [concrete]
|
||||
// CHECK:STDOUT: %Optional.generic: %Optional.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete]
|
||||
@@ -343,9 +343,9 @@ fn F() {
|
||||
// CHECK:STDOUT: %Optional.None.type.18e: type = fn_type @Optional.None, @Optional(%OptionalStorage.facet) [concrete]
|
||||
// CHECK:STDOUT: %Optional.None.aa9: %Optional.None.type.18e = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Optional.None.specific_fn: <specific function> = specific_function %Optional.None.aa9, @Optional.None(%OptionalStorage.facet) [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_41.3 [concrete]
|
||||
// CHECK:STDOUT: %foo_null_param.type: type = fn_type @foo_null_param [concrete]
|
||||
// CHECK:STDOUT: %foo_null_param: %foo_null_param.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_52.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -358,11 +358,11 @@ fn F() {
|
||||
// CHECK:STDOUT: import Core//prelude/...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_null_param = %foo_null_param.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_null_param.cpp_overload_set.value: %foo_null_param.cpp_overload_set.type = cpp_overload_set_value @foo_null_param.cpp_overload_set [concrete = constants.%foo_null_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Core.Optional: %Optional.type = import_ref Core//prelude/types/optional, Optional, loaded [concrete = constants.%Optional.generic]
|
||||
// CHECK:STDOUT: %Core.import_ref.e9f: @Optional.%Optional.None.type (%Optional.None.type.bdc) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @Optional.%Optional.None (constants.%Optional.None.01e)]
|
||||
// CHECK:STDOUT: %Core.CppCompat: <namespace> = import_ref Core//prelude, CppCompat, loaded
|
||||
@@ -379,13 +379,13 @@ fn F() {
|
||||
// CHECK:STDOUT: %Core.import_ref.306 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.3e3 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %OptionalStorage.impl_witness_table.110 = impl_witness_table (%Core.import_ref.509, %Core.import_ref.307, %Core.import_ref.c9a, %Core.import_ref.a90, %Core.import_ref.306, %Core.import_ref.3e3), @ptr.as.OptionalStorage.impl [concrete]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %foo_null_param.decl: %foo_null_param.type = fn_decl @foo_null_param [concrete = constants.%foo_null_param] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: %.loc10_42.1: type = splice_block %Optional [concrete = constants.%Optional.14b] {
|
||||
// CHECK:STDOUT: %.loc10_53.1: type = splice_block %Optional [concrete = constants.%Optional.14b] {
|
||||
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value constants.%ptr.00a, (constants.%OptionalStorage.impl_witness.d51) [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %.loc10_42.2: %OptionalStorage.type = converted constants.%ptr.00a, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %.loc10_53.2: %OptionalStorage.type = converted constants.%ptr.00a, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.14b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -396,39 +396,39 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_3: <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: %foo_null_param.ref: %foo_null_param.cpp_overload_set.type = name_ref foo_null_param, imports.%foo_null_param.cpp_overload_set.value [concrete = constants.%foo_null_param.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %Optional.ref: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_25: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_36: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %void.ref [concrete = constants.%ptr.00a]
|
||||
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr, (constants.%OptionalStorage.impl_witness.d51) [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %.loc10_34: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %.loc10_45: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.14b]
|
||||
// CHECK:STDOUT: %.loc10_35: %Optional.None.type.18e = specific_constant imports.%Core.import_ref.e9f, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.None.aa9]
|
||||
// CHECK:STDOUT: %None.ref: %Optional.None.type.18e = name_ref None, %.loc10_35 [concrete = constants.%Optional.None.aa9]
|
||||
// CHECK:STDOUT: %.loc10_46: %Optional.None.type.18e = specific_constant imports.%Core.import_ref.e9f, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.None.aa9]
|
||||
// CHECK:STDOUT: %None.ref: %Optional.None.type.18e = name_ref None, %.loc10_46 [concrete = constants.%Optional.None.aa9]
|
||||
// CHECK:STDOUT: %Optional.None.specific_fn: <specific function> = specific_function %None.ref, @Optional.None(constants.%OptionalStorage.facet) [concrete = constants.%Optional.None.specific_fn]
|
||||
// CHECK:STDOUT: %Optional.None.call: init %Optional.14b = call %Optional.None.specific_fn()
|
||||
// CHECK:STDOUT: %.loc10_41.1: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_41.2: ref %Optional.14b = temporary %.loc10_41.1, %Optional.None.call
|
||||
// CHECK:STDOUT: %.loc10_41.3: %Optional.14b = acquire_value %.loc10_41.2
|
||||
// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc10_41.3)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_41.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_41.2)
|
||||
// CHECK:STDOUT: %.loc10_52.1: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_52.2: ref %Optional.14b = temporary %.loc10_52.1, %Optional.None.call
|
||||
// CHECK:STDOUT: %.loc10_52.3: %Optional.14b = acquire_value %.loc10_52.2
|
||||
// CHECK:STDOUT: %foo_null_param.call: init %empty_tuple.type = call imports.%foo_null_param.decl(%.loc10_52.3)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_52.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_52.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_41.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_52.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_41.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_52.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_41.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_52.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -459,11 +459,11 @@ fn F() {
|
||||
// CHECK:STDOUT: %Optional.14b: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.65e: type = pattern_type %Optional.14b [concrete]
|
||||
// CHECK:STDOUT: %output.patt: %pattern_type.65e = value_binding_pattern output [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.type: type = cpp_overload_set_type @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
||||
// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_57.3 [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_return.cpp_overload_set.type: type = cpp_overload_set_type @foo_nullable_return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_return.cpp_overload_set.value: %foo_nullable_return.cpp_overload_set.type = cpp_overload_set_value @foo_nullable_return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_return.type: type = fn_type @foo_nullable_return [concrete]
|
||||
// CHECK:STDOUT: %foo_nullable_return: %foo_nullable_return.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type.1d8f74.4: type = fn_type @Destroy.Op.loc10_73.3 [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.1a2547.4: %Destroy.Op.type.1d8f74.4 = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
@@ -477,7 +477,7 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .foo_nullable_return = %foo_nullable_return.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Core.Optional: %Optional.type = import_ref Core//prelude/types/optional, Optional, loaded [concrete = constants.%Optional.generic]
|
||||
@@ -495,8 +495,8 @@ fn F() {
|
||||
// CHECK:STDOUT: %Core.import_ref.306 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %Core.import_ref.3e3 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
||||
// CHECK:STDOUT: %OptionalStorage.impl_witness_table.110 = impl_witness_table (%Core.import_ref.509, %Core.import_ref.105, %Core.import_ref.c9a, %Core.import_ref.a90, %Core.import_ref.306, %Core.import_ref.3e3), @ptr.as.OptionalStorage.impl [concrete]
|
||||
// CHECK:STDOUT: %foo.cpp_overload_set.value: %foo.cpp_overload_set.type = cpp_overload_set_value @foo.cpp_overload_set [concrete = constants.%foo.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
||||
// CHECK:STDOUT: %foo_nullable_return.cpp_overload_set.value: %foo_nullable_return.cpp_overload_set.type = cpp_overload_set_value @foo_nullable_return.cpp_overload_set [concrete = constants.%foo_nullable_return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_nullable_return.decl: %foo_nullable_return.type = fn_decl @foo_nullable_return [concrete = constants.%foo_nullable_return] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value constants.%ptr.00a, (constants.%OptionalStorage.impl_witness.d51) [concrete = constants.%OptionalStorage.facet]
|
||||
@@ -510,11 +510,11 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %Cpp.ref.loc10_49: <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: %foo.call: init %Optional.14b = call imports.%foo.decl()
|
||||
// CHECK:STDOUT: %.loc10_57.1: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_57.2: ref %Optional.14b = temporary %.loc10_57.1, %foo.call
|
||||
// CHECK:STDOUT: %.loc10_57.3: %Optional.14b = acquire_value %.loc10_57.2
|
||||
// CHECK:STDOUT: %foo_nullable_return.ref: %foo_nullable_return.cpp_overload_set.type = name_ref foo_nullable_return, imports.%foo_nullable_return.cpp_overload_set.value [concrete = constants.%foo_nullable_return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %foo_nullable_return.call: init %Optional.14b = call imports.%foo_nullable_return.decl()
|
||||
// CHECK:STDOUT: %.loc10_73.1: ref %Optional.14b = temporary_storage
|
||||
// CHECK:STDOUT: %.loc10_73.2: ref %Optional.14b = temporary %.loc10_73.1, %foo_nullable_return.call
|
||||
// CHECK:STDOUT: %.loc10_73.3: %Optional.14b = acquire_value %.loc10_73.2
|
||||
// CHECK:STDOUT: %.loc10_45.1: type = splice_block %Optional [concrete = constants.%Optional.14b] {
|
||||
// CHECK:STDOUT: %Core.ref: <namespace> = name_ref Core, imports.%Core [concrete = imports.%Core]
|
||||
// CHECK:STDOUT: %Optional.ref: %Optional.type = name_ref Optional, imports.%Core.Optional [concrete = constants.%Optional.generic]
|
||||
@@ -525,26 +525,26 @@ fn F() {
|
||||
// CHECK:STDOUT: %.loc10_45.2: %OptionalStorage.type = converted %ptr, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
|
||||
// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.14b]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %output: %Optional.14b = wrapper_binding output, %.loc10_57.3
|
||||
// CHECK:STDOUT: %output: %Optional.14b = wrapper_binding output, %.loc10_73.3
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %output.patt: %pattern_type.65e = value_binding_pattern output [concrete = constants.%output.patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_57.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_57.2)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %.loc10_73.2, constants.%Destroy.Op.1a2547.4
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%.loc10_73.2)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_57.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_73.1(%self.param: ref %.a7d) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_57.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_73.2(%self.param: ref %MaybeUnformed.399) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_57.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: fn @Destroy.Op.loc10_73.3(%self.param: ref %Optional.14b) {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: return
|
||||
// CHECK:STDOUT: }
|
||||
@@ -559,14 +559,14 @@ fn F() {
|
||||
// CHECK:STDOUT: %pattern_type.c1e: type = pattern_type %ptr.6f9 [concrete]
|
||||
// CHECK:STDOUT: %non_nullable_pointer.patt: %pattern_type.c1e = ref_binding_pattern non_nullable_pointer [concrete]
|
||||
// CHECK:STDOUT: %non_nullable_pointer.var_patt: %pattern_type.c1e = var_pattern %non_nullable_pointer.patt [concrete]
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.type: type = cpp_overload_set_type @Return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.value: %Return.cpp_overload_set.type = cpp_overload_set_value @Return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return.type: type = fn_type @Return [concrete]
|
||||
// CHECK:STDOUT: %Return: %Return.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.type: type = cpp_overload_set_type @Invoke.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.value: %Invoke.cpp_overload_set.type = cpp_overload_set_value @Invoke.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke.type: type = fn_type @Invoke [concrete]
|
||||
// CHECK:STDOUT: %Invoke: %Invoke.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Return_pointer.cpp_overload_set.type: type = cpp_overload_set_type @Return_pointer.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return_pointer.cpp_overload_set.value: %Return_pointer.cpp_overload_set.type = cpp_overload_set_value @Return_pointer.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return_pointer.type: type = fn_type @Return_pointer [concrete]
|
||||
// CHECK:STDOUT: %Return_pointer: %Return_pointer.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Invoke_pointer.cpp_overload_set.type: type = cpp_overload_set_type @Invoke_pointer.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke_pointer.cpp_overload_set.value: %Invoke_pointer.cpp_overload_set.type = cpp_overload_set_value @Invoke_pointer.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke_pointer.type: type = fn_type @Invoke_pointer [concrete]
|
||||
// CHECK:STDOUT: %Invoke_pointer: %Invoke_pointer.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -574,18 +574,18 @@ fn F() {
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .Return = %Return.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Invoke = %Invoke.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Return_pointer = %Return_pointer.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Invoke_pointer = %Invoke_pointer.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.value: %Return.cpp_overload_set.type = cpp_overload_set_value @Return.cpp_overload_set [concrete = constants.%Return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return.decl: %Return.type = fn_decl @Return [concrete = constants.%Return] {
|
||||
// CHECK:STDOUT: %Return_pointer.cpp_overload_set.value: %Return_pointer.cpp_overload_set.type = cpp_overload_set_value @Return_pointer.cpp_overload_set [concrete = constants.%Return_pointer.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return_pointer.decl: %Return_pointer.type = fn_decl @Return_pointer [concrete = constants.%Return_pointer] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.value: %Invoke.cpp_overload_set.type = cpp_overload_set_value @Invoke.cpp_overload_set [concrete = constants.%Invoke.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke.decl: %Invoke.type = fn_decl @Invoke [concrete = constants.%Invoke] {
|
||||
// CHECK:STDOUT: %Invoke_pointer.cpp_overload_set.value: %Invoke_pointer.cpp_overload_set.type = cpp_overload_set_value @Invoke_pointer.cpp_overload_set [concrete = constants.%Invoke_pointer.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke_pointer.decl: %Invoke_pointer.type = fn_decl @Invoke_pointer [concrete = constants.%Invoke_pointer] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -596,9 +596,9 @@ fn F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %non_nullable_pointer.var: ref %ptr.6f9 = var_storage %non_nullable_pointer.var_patt
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11_42: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Return.ref: %Return.cpp_overload_set.type = name_ref Return, imports.%Return.cpp_overload_set.value [concrete = constants.%Return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return.call: init %ptr.6f9 = call imports.%Return.decl()
|
||||
// CHECK:STDOUT: assign %non_nullable_pointer.var, %Return.call
|
||||
// CHECK:STDOUT: %Return_pointer.ref: %Return_pointer.cpp_overload_set.type = name_ref Return_pointer, imports.%Return_pointer.cpp_overload_set.value [concrete = constants.%Return_pointer.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return_pointer.call: init %ptr.6f9 = call imports.%Return_pointer.decl()
|
||||
// CHECK:STDOUT: assign %non_nullable_pointer.var, %Return_pointer.call
|
||||
// CHECK:STDOUT: %.loc11: type = splice_block %ptr.loc11_38 [concrete = constants.%ptr.6f9] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11_29: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
|
||||
@@ -611,10 +611,10 @@ fn F() {
|
||||
// CHECK:STDOUT: %non_nullable_pointer.var_patt: %pattern_type.c1e = var_pattern %non_nullable_pointer.patt [concrete = constants.%non_nullable_pointer.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Invoke.ref: %Invoke.cpp_overload_set.type = name_ref Invoke, imports.%Invoke.cpp_overload_set.value [concrete = constants.%Invoke.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke_pointer.ref: %Invoke_pointer.cpp_overload_set.type = name_ref Invoke_pointer, imports.%Invoke_pointer.cpp_overload_set.value [concrete = constants.%Invoke_pointer.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %non_nullable_pointer.ref: ref %ptr.6f9 = name_ref non_nullable_pointer, %non_nullable_pointer
|
||||
// CHECK:STDOUT: %.loc12: %ptr.6f9 = acquire_value %non_nullable_pointer.ref
|
||||
// CHECK:STDOUT: %Invoke.call: init %empty_tuple.type = call imports.%Invoke.decl(%.loc12)
|
||||
// CHECK:STDOUT: %Invoke_pointer.call: init %empty_tuple.type = call imports.%Invoke_pointer.decl(%.loc12)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %non_nullable_pointer.var, constants.%Destroy.Op
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%non_nullable_pointer.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -632,14 +632,14 @@ fn F() {
|
||||
// CHECK:STDOUT: %pattern_type.c83: type = pattern_type %ptr [concrete]
|
||||
// CHECK:STDOUT: %const_void_pointer.patt: %pattern_type.c83 = ref_binding_pattern const_void_pointer [concrete]
|
||||
// CHECK:STDOUT: %const_void_pointer.var_patt: %pattern_type.c83 = var_pattern %const_void_pointer.patt [concrete]
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.type: type = cpp_overload_set_type @Return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.value: %Return.cpp_overload_set.type = cpp_overload_set_value @Return.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return.type: type = fn_type @Return [concrete]
|
||||
// CHECK:STDOUT: %Return: %Return.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.type: type = cpp_overload_set_type @Invoke.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.value: %Invoke.cpp_overload_set.type = cpp_overload_set_value @Invoke.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke.type: type = fn_type @Invoke [concrete]
|
||||
// CHECK:STDOUT: %Invoke: %Invoke.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Return_const.cpp_overload_set.type: type = cpp_overload_set_type @Return_const.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return_const.cpp_overload_set.value: %Return_const.cpp_overload_set.type = cpp_overload_set_value @Return_const.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Return_const.type: type = fn_type @Return_const [concrete]
|
||||
// CHECK:STDOUT: %Return_const: %Return_const.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Invoke_const.cpp_overload_set.type: type = cpp_overload_set_type @Invoke_const.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke_const.cpp_overload_set.value: %Invoke_const.cpp_overload_set.type = cpp_overload_set_value @Invoke_const.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %Invoke_const.type: type = fn_type @Invoke_const [concrete]
|
||||
// CHECK:STDOUT: %Invoke_const: %Invoke_const.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op.type: type = fn_type @Destroy.Op [concrete]
|
||||
// CHECK:STDOUT: %Destroy.Op: %Destroy.Op.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
@@ -647,18 +647,18 @@ fn F() {
|
||||
// CHECK:STDOUT: imports {
|
||||
// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
||||
// CHECK:STDOUT: .void = constants.%Cpp.void
|
||||
// CHECK:STDOUT: .Return = %Return.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Invoke = %Invoke.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Return_const = %Return_const.cpp_overload_set.value
|
||||
// CHECK:STDOUT: .Invoke_const = %Invoke_const.cpp_overload_set.value
|
||||
// CHECK:STDOUT: import Cpp//...
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Return.cpp_overload_set.value: %Return.cpp_overload_set.type = cpp_overload_set_value @Return.cpp_overload_set [concrete = constants.%Return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return.decl: %Return.type = fn_decl @Return [concrete = constants.%Return] {
|
||||
// CHECK:STDOUT: %Return_const.cpp_overload_set.value: %Return_const.cpp_overload_set.type = cpp_overload_set_value @Return_const.cpp_overload_set [concrete = constants.%Return_const.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return_const.decl: %Return_const.type = fn_decl @Return_const [concrete = constants.%Return_const] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Invoke.cpp_overload_set.value: %Invoke.cpp_overload_set.type = cpp_overload_set_value @Invoke.cpp_overload_set [concrete = constants.%Invoke.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke.decl: %Invoke.type = fn_decl @Invoke [concrete = constants.%Invoke] {
|
||||
// CHECK:STDOUT: %Invoke_const.cpp_overload_set.value: %Invoke_const.cpp_overload_set.type = cpp_overload_set_value @Invoke_const.cpp_overload_set [concrete = constants.%Invoke_const.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke_const.decl: %Invoke_const.type = fn_decl @Invoke_const [concrete = constants.%Invoke_const] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -669,9 +669,9 @@ fn F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: %const_void_pointer.var: ref %ptr = var_storage %const_void_pointer.var_patt
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11_45: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Return.ref: %Return.cpp_overload_set.type = name_ref Return, imports.%Return.cpp_overload_set.value [concrete = constants.%Return.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return.call: init %ptr = call imports.%Return.decl()
|
||||
// CHECK:STDOUT: assign %const_void_pointer.var, %Return.call
|
||||
// CHECK:STDOUT: %Return_const.ref: %Return_const.cpp_overload_set.type = name_ref Return_const, imports.%Return_const.cpp_overload_set.value [concrete = constants.%Return_const.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Return_const.call: init %ptr = call imports.%Return_const.decl()
|
||||
// CHECK:STDOUT: assign %const_void_pointer.var, %Return_const.call
|
||||
// CHECK:STDOUT: %.loc11: type = splice_block %ptr [concrete = constants.%ptr] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc11_33: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %void.ref: type = name_ref void, constants.%Cpp.void [concrete = constants.%Cpp.void]
|
||||
@@ -684,10 +684,10 @@ fn F() {
|
||||
// CHECK:STDOUT: %const_void_pointer.var_patt: %pattern_type.c83 = var_pattern %const_void_pointer.patt [concrete = constants.%const_void_pointer.var_patt]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc12: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Invoke.ref: %Invoke.cpp_overload_set.type = name_ref Invoke, imports.%Invoke.cpp_overload_set.value [concrete = constants.%Invoke.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %Invoke_const.ref: %Invoke_const.cpp_overload_set.type = name_ref Invoke_const, imports.%Invoke_const.cpp_overload_set.value [concrete = constants.%Invoke_const.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %const_void_pointer.ref: ref %ptr = name_ref const_void_pointer, %const_void_pointer
|
||||
// CHECK:STDOUT: %.loc12: %ptr = acquire_value %const_void_pointer.ref
|
||||
// CHECK:STDOUT: %Invoke.call: init %empty_tuple.type = call imports.%Invoke.decl(%.loc12)
|
||||
// CHECK:STDOUT: %Invoke_const.call: init %empty_tuple.type = call imports.%Invoke_const.decl(%.loc12)
|
||||
// CHECK:STDOUT: %Destroy.Op.bound: <bound method> = bound_method %const_void_pointer.var, constants.%Destroy.Op
|
||||
// CHECK:STDOUT: %Destroy.Op.call: init %empty_tuple.type = call %Destroy.Op.bound(%const_void_pointer.var)
|
||||
// CHECK:STDOUT: <elided>
|
||||
|
||||
Reference in New Issue
Block a user