|
|
@@ -11,20 +11,20 @@
|
|
|
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interop/cpp/function/pointer.carbon
|
|
|
|
|
|
// ============================================================================
|
|
|
-// Pointer as a parameter type
|
|
|
+// Non-nullable pointer as a parameter type
|
|
|
// ============================================================================
|
|
|
|
|
|
-// --- pointer_param.h
|
|
|
+// --- non_nullable_pointer_param.h
|
|
|
|
|
|
struct S {};
|
|
|
|
|
|
auto foo(S* _Nonnull) -> void;
|
|
|
|
|
|
-// --- import_pointer_param.carbon
|
|
|
+// --- import_non_nullable_pointer_param.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
-import Cpp library "pointer_param.h";
|
|
|
+import Cpp library "non_nullable_pointer_param.h";
|
|
|
|
|
|
fn F() {
|
|
|
//@dump-sem-ir-begin
|
|
|
@@ -33,21 +33,57 @@ fn F() {
|
|
|
//@dump-sem-ir-end
|
|
|
}
|
|
|
|
|
|
+// --- fail_import_non_nullable_pointer_param_using_const_value.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+import Cpp library "non_nullable_pointer_param.h";
|
|
|
+
|
|
|
+fn G() -> const Cpp.S;
|
|
|
+
|
|
|
+fn F() {
|
|
|
+ var s: const Cpp.S = G();
|
|
|
+ // CHECK:STDERR: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE+8]]:13: error: no matching function for call to 'foo' [CppInteropParseError]
|
|
|
+ // CHECK:STDERR: 18 | Cpp.foo(&s);
|
|
|
+ // CHECK:STDERR: | ^
|
|
|
+ // CHECK:STDERR: fail_import_non_nullable_pointer_param_using_const_value.carbon:[[@LINE-9]]:10: in file included here [InCppInclude]
|
|
|
+ // CHECK:STDERR: ./non_nullable_pointer_param.h:4:6: note: candidate function not viable: 1st argument ('const S * _Nonnull') would lose const qualifier [CppInteropParseNote]
|
|
|
+ // CHECK:STDERR: 4 | auto foo(S* _Nonnull) -> void;
|
|
|
+ // CHECK:STDERR: | ^ ~~~~~~~~~~~
|
|
|
+ // CHECK:STDERR:
|
|
|
+ Cpp.foo(&s);
|
|
|
+}
|
|
|
+
|
|
|
+// --- import_non_nullable_pointer_param_using_const_pointer.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+import Cpp library "non_nullable_pointer_param.h";
|
|
|
+
|
|
|
+fn G() -> const (Cpp.S*);
|
|
|
+
|
|
|
+fn F() {
|
|
|
+ //@dump-sem-ir-begin
|
|
|
+ var p: const (Cpp.S*) = G();
|
|
|
+ Cpp.foo(p);
|
|
|
+ //@dump-sem-ir-end
|
|
|
+}
|
|
|
+
|
|
|
// ============================================================================
|
|
|
-// Double pointer as a parameter type
|
|
|
+// Double non-nullable pointer as a parameter type
|
|
|
// ============================================================================
|
|
|
|
|
|
-// --- double_pointer_param.h
|
|
|
+// --- double_non_nullable_pointer_param.h
|
|
|
|
|
|
struct S {};
|
|
|
|
|
|
auto foo(S* _Nonnull * _Nonnull) -> void;
|
|
|
|
|
|
-// --- import_double_pointer_param.carbon
|
|
|
+// --- import_double_non_nullable_pointer_param.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
-import Cpp library "double_pointer_param.h";
|
|
|
+import Cpp library "double_non_nullable_pointer_param.h";
|
|
|
|
|
|
fn F() {
|
|
|
//@dump-sem-ir-begin
|
|
|
@@ -58,20 +94,20 @@ fn F() {
|
|
|
}
|
|
|
|
|
|
// ============================================================================
|
|
|
-// Pointer to const as a parameter type
|
|
|
+// Non-nullable pointer to const as a parameter type
|
|
|
// ============================================================================
|
|
|
|
|
|
-// --- const_value_pointer_param.h
|
|
|
+// --- non_nullable_pointer_to_const_param.h
|
|
|
|
|
|
struct S {};
|
|
|
|
|
|
auto foo(const S* _Nonnull) -> void;
|
|
|
|
|
|
-// --- import_const_value_pointer_param.carbon
|
|
|
+// --- import_non_nullable_pointer_to_const_param_using_const.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
-import Cpp library "const_value_pointer_param.h";
|
|
|
+import Cpp library "non_nullable_pointer_to_const_param.h";
|
|
|
|
|
|
fn G() -> const Cpp.S;
|
|
|
|
|
|
@@ -82,57 +118,125 @@ fn F() {
|
|
|
//@dump-sem-ir-end
|
|
|
}
|
|
|
|
|
|
+// --- import_non_nullable_pointer_to_const_param_using_non_const.carbon
|
|
|
+
|
|
|
+import Cpp library "non_nullable_pointer_to_const_param.h";
|
|
|
+
|
|
|
+fn G() -> Cpp.S;
|
|
|
+
|
|
|
+fn F() {
|
|
|
+ //@dump-sem-ir-begin
|
|
|
+ var s: Cpp.S = G();
|
|
|
+ Cpp.foo(&s);
|
|
|
+ //@dump-sem-ir-end
|
|
|
+}
|
|
|
+
|
|
|
// ============================================================================
|
|
|
-// Const pointer as a parameter type
|
|
|
+// Const non-nullable pointer as a parameter type
|
|
|
// ============================================================================
|
|
|
|
|
|
-// --- const_pointer_param.h
|
|
|
+// --- const_non_nullable_pointer_param.h
|
|
|
|
|
|
struct S {};
|
|
|
|
|
|
auto foo(S* _Nonnull const) -> void;
|
|
|
|
|
|
-// --- fail_todo_import_const_pointer_param.carbon
|
|
|
+// --- import_const_non_nullable_pointer_param_using_const.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
-import Cpp library "const_pointer_param.h";
|
|
|
+import Cpp library "const_non_nullable_pointer_param.h";
|
|
|
|
|
|
fn G() -> const (Cpp.S*);
|
|
|
|
|
|
fn F() {
|
|
|
//@dump-sem-ir-begin
|
|
|
var p: const (Cpp.S*) = G();
|
|
|
- // CHECK:STDERR: fail_todo_import_const_pointer_param.carbon:[[@LINE+11]]:11: error: cannot implicitly convert expression of type `const (Cpp.S*)` to `Core.Optional(Cpp.S* as Core.OptionalStorage)` [ConversionFailure]
|
|
|
+ Cpp.foo(p);
|
|
|
+ //@dump-sem-ir-end
|
|
|
+}
|
|
|
+
|
|
|
+// --- import_const_non_nullable_pointer_param_using_non_const.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+import Cpp library "const_non_nullable_pointer_param.h";
|
|
|
+
|
|
|
+fn G() -> Cpp.S*;
|
|
|
+
|
|
|
+fn F() {
|
|
|
+ //@dump-sem-ir-begin
|
|
|
+ var p: Cpp.S* = G();
|
|
|
+ Cpp.foo(p);
|
|
|
+ //@dump-sem-ir-end
|
|
|
+}
|
|
|
+
|
|
|
+// ============================================================================
|
|
|
+// Const nullable pointer as a parameter type
|
|
|
+// ============================================================================
|
|
|
+
|
|
|
+// --- const_nullable_pointer_param.h
|
|
|
+
|
|
|
+struct S {};
|
|
|
+
|
|
|
+auto foo(S* const) -> void;
|
|
|
+
|
|
|
+// --- fail_todo_import_const_nullable_pointer_param_using_const.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+import Cpp library "const_nullable_pointer_param.h";
|
|
|
+
|
|
|
+fn G() -> const (Cpp.S*);
|
|
|
+
|
|
|
+fn F() {
|
|
|
+ //@dump-sem-ir-begin
|
|
|
+ var p: const (Cpp.S*) = G();
|
|
|
+ // CHECK:STDERR: fail_todo_import_const_nullable_pointer_param_using_const.carbon:[[@LINE+11]]:11: error: cannot implicitly convert expression of type `const (Cpp.S*)` to `Core.Optional(Cpp.S* as Core.OptionalStorage)` [ConversionFailure]
|
|
|
// CHECK:STDERR: Cpp.foo(p);
|
|
|
// CHECK:STDERR: ^
|
|
|
- // CHECK:STDERR: fail_todo_import_const_pointer_param.carbon:[[@LINE+8]]:11: note: type `const (Cpp.S*)` does not implement interface `Core.ImplicitAs(Core.Optional(Cpp.S* as Core.OptionalStorage))` [MissingImplInMemberAccessNote]
|
|
|
+ // CHECK:STDERR: fail_todo_import_const_nullable_pointer_param_using_const.carbon:[[@LINE+8]]:11: note: type `const (Cpp.S*)` does not implement interface `Core.ImplicitAs(Core.Optional(Cpp.S* as Core.OptionalStorage))` [MissingImplInMemberAccessNote]
|
|
|
// CHECK:STDERR: Cpp.foo(p);
|
|
|
// CHECK:STDERR: ^
|
|
|
- // CHECK:STDERR: fail_todo_import_const_pointer_param.carbon:[[@LINE-13]]:10: in file included here [InCppInclude]
|
|
|
- // CHECK:STDERR: ./const_pointer_param.h:4:27: note: initializing function parameter [InCallToFunctionParam]
|
|
|
- // CHECK:STDERR: auto foo(S* _Nonnull const) -> void;
|
|
|
- // CHECK:STDERR: ^
|
|
|
+ // CHECK:STDERR: fail_todo_import_const_nullable_pointer_param_using_const.carbon:[[@LINE-13]]:10: in file included here [InCppInclude]
|
|
|
+ // CHECK:STDERR: ./const_nullable_pointer_param.h:4:18: note: initializing function parameter [InCallToFunctionParam]
|
|
|
+ // CHECK:STDERR: auto foo(S* const) -> void;
|
|
|
+ // CHECK:STDERR: ^
|
|
|
// CHECK:STDERR:
|
|
|
Cpp.foo(p);
|
|
|
//@dump-sem-ir-end
|
|
|
}
|
|
|
|
|
|
+// --- import_const_nullable_pointer_param_using_non_const.carbon
|
|
|
+
|
|
|
+library "[[@TEST_NAME]]";
|
|
|
+
|
|
|
+import Cpp library "const_nullable_pointer_param.h";
|
|
|
+
|
|
|
+fn G() -> Cpp.S*;
|
|
|
+
|
|
|
+fn F() {
|
|
|
+ //@dump-sem-ir-begin
|
|
|
+ var p: Cpp.S* = G();
|
|
|
+ Cpp.foo(p);
|
|
|
+ //@dump-sem-ir-end
|
|
|
+}
|
|
|
+
|
|
|
// ============================================================================
|
|
|
-// Pointer as a return value
|
|
|
+// Non-nullable pointer as a return value
|
|
|
// ============================================================================
|
|
|
|
|
|
-// --- pointer_return.h
|
|
|
+// --- non_nullable_pointer_return.h
|
|
|
|
|
|
struct S {};
|
|
|
|
|
|
auto foo() -> S* _Nonnull;
|
|
|
|
|
|
-// --- import_pointer_return.carbon
|
|
|
+// --- import_non_nullable_pointer_return.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
-import Cpp library "pointer_return.h";
|
|
|
+import Cpp library "non_nullable_pointer_return.h";
|
|
|
|
|
|
fn IngestDoublePointer(s: Cpp.S*);
|
|
|
|
|
|
@@ -144,10 +248,10 @@ fn F() {
|
|
|
}
|
|
|
|
|
|
// ============================================================================
|
|
|
-// Double pointer as a return value
|
|
|
+// Double non-nullable pointer as a return value
|
|
|
// ============================================================================
|
|
|
|
|
|
-// --- double_pointer_return.h
|
|
|
+// --- double_non_nullable_pointer_return.h
|
|
|
|
|
|
struct S {};
|
|
|
|
|
|
@@ -157,7 +261,7 @@ auto foo() -> S* _Nonnull * _Nonnull;
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
-import Cpp library "double_pointer_return.h";
|
|
|
+import Cpp library "double_non_nullable_pointer_return.h";
|
|
|
|
|
|
fn IngestDoublePointer(s: Cpp.S**);
|
|
|
|
|
|
@@ -169,20 +273,20 @@ fn F() {
|
|
|
}
|
|
|
|
|
|
// ============================================================================
|
|
|
-// Const pointer as a return value
|
|
|
+// Const non-nullable pointer as a return value
|
|
|
// ============================================================================
|
|
|
|
|
|
-// --- const_pointer_return.h
|
|
|
+// --- const_non_nullable_pointer_return.h
|
|
|
|
|
|
struct S {};
|
|
|
|
|
|
auto foo() -> const S* _Nonnull;
|
|
|
|
|
|
-// --- import_const_pointer_return.carbon
|
|
|
+// --- import_const_non_nullable_pointer_return.carbon
|
|
|
|
|
|
library "[[@TEST_NAME]]";
|
|
|
|
|
|
-import Cpp library "const_pointer_return.h";
|
|
|
+import Cpp library "const_non_nullable_pointer_return.h";
|
|
|
|
|
|
fn IngestConstPointer(s: const Cpp.S*);
|
|
|
|
|
|
@@ -311,7 +415,7 @@ fn F() {
|
|
|
let a: Cpp.S* = Cpp.Indirect({} as Cpp.S);
|
|
|
}
|
|
|
|
|
|
-// CHECK:STDOUT: --- import_pointer_param.carbon
|
|
|
+// CHECK:STDOUT: --- import_non_nullable_pointer_param.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
@@ -374,7 +478,75 @@ fn F() {
|
|
|
// CHECK:STDOUT: <elided>
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- import_double_pointer_param.carbon
|
|
|
+// CHECK:STDOUT: --- import_non_nullable_pointer_param_using_const_pointer.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
+// CHECK:STDOUT: %S: type = class_type @S [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
|
|
|
+// CHECK:STDOUT: %const: type = const_type %ptr.5c7 [concrete]
|
|
|
+// CHECK:STDOUT: %pattern_type.f25: type = pattern_type %const [concrete]
|
|
|
+// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
|
|
+// CHECK:STDOUT: %G: %G.type = struct_value () [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: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
|
|
|
+// CHECK:STDOUT: %facet_value: %type_where = facet_value %const, () [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.2ba: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.14a: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.2ba = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.6c1: type = ptr_type %const [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
|
|
+// CHECK:STDOUT: .S = %S.decl
|
|
|
+// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
|
|
+// CHECK:STDOUT: import Cpp//...
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
|
|
|
+// 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: <elided>
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @F() {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: name_binding_decl {
|
|
|
+// CHECK:STDOUT: %p.patt: %pattern_type.f25 = ref_binding_pattern p [concrete]
|
|
|
+// CHECK:STDOUT: %p.var_patt: %pattern_type.f25 = var_pattern %p.patt [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %p.var: ref %const = var %p.var_patt
|
|
|
+// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
|
|
+// CHECK:STDOUT: %G.call: init %const = call %G.ref()
|
|
|
+// CHECK:STDOUT: assign %p.var, %G.call
|
|
|
+// CHECK:STDOUT: %.loc10: type = splice_block %const [concrete = constants.%const] {
|
|
|
+// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
|
|
+// CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
|
|
+// CHECK:STDOUT: %ptr: type = ptr_type %S.ref [concrete = constants.%ptr.5c7]
|
|
|
+// CHECK:STDOUT: %const: type = const_type %ptr [concrete = constants.%const]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %p: ref %const = ref_binding p, %p.var
|
|
|
+// CHECK:STDOUT: %Cpp.ref.loc11: <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: %p.ref: ref %const = name_ref p, %p
|
|
|
+// CHECK:STDOUT: %.loc11_11.1: ref %ptr.5c7 = as_compatible %p.ref
|
|
|
+// CHECK:STDOUT: %.loc11_11.2: ref %ptr.5c7 = converted %p.ref, %.loc11_11.1
|
|
|
+// CHECK:STDOUT: %.loc11_11.3: %ptr.5c7 = acquire_value %.loc11_11.2
|
|
|
+// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11_11.3)
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %p.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.14a
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: %bound_method: <bound method> = bound_method %p.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
|
|
|
+// CHECK:STDOUT: %addr: %ptr.6c1 = addr_of %p.var
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- import_double_non_nullable_pointer_param.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
@@ -479,7 +651,7 @@ fn F() {
|
|
|
// CHECK:STDOUT: <elided>
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- import_const_value_pointer_param.carbon
|
|
|
+// CHECK:STDOUT: --- import_non_nullable_pointer_to_const_param_using_const.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
@@ -544,7 +716,206 @@ fn F() {
|
|
|
// CHECK:STDOUT: <elided>
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- fail_todo_import_const_pointer_param.carbon
|
|
|
+// CHECK:STDOUT: --- import_non_nullable_pointer_to_const_param_using_non_const.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
+// CHECK:STDOUT: %S: type = class_type @S [concrete]
|
|
|
+// CHECK:STDOUT: %pattern_type.7da: type = pattern_type %S [concrete]
|
|
|
+// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
|
|
+// CHECK:STDOUT: %G: %G.type = struct_value () [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: %ptr.5c7: type = ptr_type %S [concrete]
|
|
|
+// CHECK:STDOUT: %const: type = const_type %S [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.ff5: type = ptr_type %const [concrete]
|
|
|
+// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
|
|
+// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
|
|
|
+// CHECK:STDOUT: %facet_value: %type_where = facet_value %S, () [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.572: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.552 = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
|
|
+// CHECK:STDOUT: .S = %S.decl
|
|
|
+// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
|
|
+// CHECK:STDOUT: import Cpp//...
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
|
|
|
+// 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: <elided>
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @F() {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: name_binding_decl {
|
|
|
+// CHECK:STDOUT: %s.patt: %pattern_type.7da = ref_binding_pattern s [concrete]
|
|
|
+// CHECK:STDOUT: %s.var_patt: %pattern_type.7da = var_pattern %s.patt [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %s.var: ref %S = var %s.var_patt
|
|
|
+// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
|
|
+// CHECK:STDOUT: %.loc8_3: ref %S = splice_block %s.var {}
|
|
|
+// CHECK:STDOUT: %G.call: init %S = call %G.ref() to %.loc8_3
|
|
|
+// CHECK:STDOUT: assign %s.var, %G.call
|
|
|
+// CHECK:STDOUT: %.loc8_13: type = splice_block %S.ref [concrete = constants.%S] {
|
|
|
+// CHECK:STDOUT: %Cpp.ref.loc8: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
|
|
+// CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %s: ref %S = ref_binding s, %s.var
|
|
|
+// CHECK:STDOUT: %Cpp.ref.loc9: <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: %s.ref: ref %S = name_ref s, %s
|
|
|
+// CHECK:STDOUT: %addr.loc9: %ptr.5c7 = addr_of %s.ref
|
|
|
+// CHECK:STDOUT: %.loc9_11.1: %ptr.ff5 = as_compatible %addr.loc9
|
|
|
+// CHECK:STDOUT: %.loc9_11.2: %ptr.ff5 = converted %addr.loc9, %.loc9_11.1
|
|
|
+// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc9_11.2)
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %s.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.572
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: %bound_method: <bound method> = bound_method %s.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
|
|
|
+// CHECK:STDOUT: %addr.loc8: %ptr.5c7 = addr_of %s.var
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr.loc8)
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- import_const_non_nullable_pointer_param_using_const.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
+// CHECK:STDOUT: %S: type = class_type @S [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
|
|
|
+// CHECK:STDOUT: %const: type = const_type %ptr.5c7 [concrete]
|
|
|
+// CHECK:STDOUT: %pattern_type.f25: type = pattern_type %const [concrete]
|
|
|
+// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
|
|
+// CHECK:STDOUT: %G: %G.type = struct_value () [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: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
|
|
|
+// CHECK:STDOUT: %facet_value: %type_where = facet_value %const, () [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.2ba: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.14a: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.2ba = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.6c1: type = ptr_type %const [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
|
|
+// CHECK:STDOUT: .S = %S.decl
|
|
|
+// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
|
|
+// CHECK:STDOUT: import Cpp//...
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
|
|
|
+// 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: <elided>
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @F() {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: name_binding_decl {
|
|
|
+// CHECK:STDOUT: %p.patt: %pattern_type.f25 = ref_binding_pattern p [concrete]
|
|
|
+// CHECK:STDOUT: %p.var_patt: %pattern_type.f25 = var_pattern %p.patt [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %p.var: ref %const = var %p.var_patt
|
|
|
+// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
|
|
+// CHECK:STDOUT: %G.call: init %const = call %G.ref()
|
|
|
+// CHECK:STDOUT: assign %p.var, %G.call
|
|
|
+// CHECK:STDOUT: %.loc10: type = splice_block %const [concrete = constants.%const] {
|
|
|
+// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
|
|
+// CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
|
|
+// CHECK:STDOUT: %ptr: type = ptr_type %S.ref [concrete = constants.%ptr.5c7]
|
|
|
+// CHECK:STDOUT: %const: type = const_type %ptr [concrete = constants.%const]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %p: ref %const = ref_binding p, %p.var
|
|
|
+// CHECK:STDOUT: %Cpp.ref.loc11: <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: %p.ref: ref %const = name_ref p, %p
|
|
|
+// CHECK:STDOUT: %.loc11_11.1: ref %ptr.5c7 = as_compatible %p.ref
|
|
|
+// CHECK:STDOUT: %.loc11_11.2: ref %ptr.5c7 = converted %p.ref, %.loc11_11.1
|
|
|
+// CHECK:STDOUT: %.loc11_11.3: %ptr.5c7 = acquire_value %.loc11_11.2
|
|
|
+// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11_11.3)
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %p.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.14a
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: %bound_method: <bound method> = bound_method %p.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
|
|
|
+// CHECK:STDOUT: %addr: %ptr.6c1 = addr_of %p.var
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- import_const_non_nullable_pointer_param_using_non_const.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
+// CHECK:STDOUT: %S: type = class_type @S [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
|
|
|
+// CHECK:STDOUT: %pattern_type.259: type = pattern_type %ptr.5c7 [concrete]
|
|
|
+// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
|
|
+// CHECK:STDOUT: %G: %G.type = struct_value () [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: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
|
|
|
+// CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr.5c7, () [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7f4: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value) [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.d4c: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7f4 = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.dfe: type = ptr_type %ptr.5c7 [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
|
|
+// CHECK:STDOUT: .S = %S.decl
|
|
|
+// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
|
|
+// CHECK:STDOUT: import Cpp//...
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
|
|
|
+// 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: <elided>
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @F() {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: name_binding_decl {
|
|
|
+// CHECK:STDOUT: %p.patt: %pattern_type.259 = ref_binding_pattern p [concrete]
|
|
|
+// CHECK:STDOUT: %p.var_patt: %pattern_type.259 = var_pattern %p.patt [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %p.var: ref %ptr.5c7 = var %p.var_patt
|
|
|
+// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
|
|
+// CHECK:STDOUT: %G.call: init %ptr.5c7 = call %G.ref()
|
|
|
+// CHECK:STDOUT: assign %p.var, %G.call
|
|
|
+// CHECK:STDOUT: %.loc10: type = splice_block %ptr [concrete = constants.%ptr.5c7] {
|
|
|
+// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
|
|
+// CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
|
|
+// CHECK:STDOUT: %ptr: type = ptr_type %S.ref [concrete = constants.%ptr.5c7]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %p: ref %ptr.5c7 = ref_binding p, %p.var
|
|
|
+// CHECK:STDOUT: %Cpp.ref.loc11: <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: %p.ref: ref %ptr.5c7 = name_ref p, %p
|
|
|
+// CHECK:STDOUT: %.loc11: %ptr.5c7 = acquire_value %p.ref
|
|
|
+// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11)
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound: <bound method> = bound_method %p.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.d4c
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: %bound_method: <bound method> = bound_method %p.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn
|
|
|
+// CHECK:STDOUT: %addr: %ptr.dfe = addr_of %p.var
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call: init %empty_tuple.type = call %bound_method(%addr)
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- fail_todo_import_const_nullable_pointer_param_using_const.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
@@ -629,7 +1000,123 @@ fn F() {
|
|
|
// CHECK:STDOUT: <elided>
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- import_pointer_return.carbon
|
|
|
+// CHECK:STDOUT: --- import_const_nullable_pointer_param_using_non_const.carbon
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: constants {
|
|
|
+// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
+// CHECK:STDOUT: %S: type = class_type @S [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
|
|
|
+// CHECK:STDOUT: %pattern_type.259: type = pattern_type %ptr.5c7 [concrete]
|
|
|
+// CHECK:STDOUT: %G.type: type = fn_type @G [concrete]
|
|
|
+// CHECK:STDOUT: %G: %G.type = struct_value () [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: %OptionalStorage.type: type = facet_type <@OptionalStorage> [concrete]
|
|
|
+// CHECK:STDOUT: %T.3fe: %OptionalStorage.type = symbolic_binding T, 0 [symbolic]
|
|
|
+// CHECK:STDOUT: %T.d9f: type = symbolic_binding T, 0 [symbolic]
|
|
|
+// CHECK:STDOUT: %ptr.4f0: type = ptr_type %T.d9f [symbolic]
|
|
|
+// CHECK:STDOUT: %MaybeUnformed.cff: type = class_type @MaybeUnformed, @MaybeUnformed(%ptr.4f0) [symbolic]
|
|
|
+// CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.type.911: type = fn_type @ptr.as.OptionalStorage.impl.Some, @ptr.as.OptionalStorage.impl(%T.d9f) [symbolic]
|
|
|
+// CHECK:STDOUT: %ptr.as.OptionalStorage.impl.Some.2a0: %ptr.as.OptionalStorage.impl.Some.type.911 = struct_value () [symbolic]
|
|
|
+// CHECK:STDOUT: %OptionalStorage.impl_witness.fef: <witness> = impl_witness imports.%OptionalStorage.impl_witness_table.236, @ptr.as.OptionalStorage.impl(%S) [concrete]
|
|
|
+// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value %ptr.5c7, (%OptionalStorage.impl_witness.fef) [concrete]
|
|
|
+// CHECK:STDOUT: %Optional.454: type = class_type @Optional, @Optional(%OptionalStorage.facet) [concrete]
|
|
|
+// CHECK:STDOUT: %foo.type: type = fn_type @foo [concrete]
|
|
|
+// CHECK:STDOUT: %foo: %foo.type = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.type.099: type = facet_type <@ImplicitAs, @ImplicitAs(%Optional.454)> [concrete]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.Convert.type.d3b: type = fn_type @ImplicitAs.Convert, @ImplicitAs(%Optional.454) [concrete]
|
|
|
+// CHECK:STDOUT: %T.binding.as_type.as.ImplicitAs.impl.Convert.type.a78: type = fn_type @T.binding.as_type.as.ImplicitAs.impl.Convert.1, @T.binding.as_type.as.ImplicitAs.impl.339(%T.3fe) [symbolic]
|
|
|
+// CHECK:STDOUT: %T.binding.as_type.as.ImplicitAs.impl.Convert.d1b: %T.binding.as_type.as.ImplicitAs.impl.Convert.type.a78 = struct_value () [symbolic]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.impl_witness.ff2: <witness> = impl_witness imports.%ImplicitAs.impl_witness_table.284, @T.binding.as_type.as.ImplicitAs.impl.339(%OptionalStorage.facet) [concrete]
|
|
|
+// CHECK:STDOUT: %T.binding.as_type.as.ImplicitAs.impl.Convert.type.398: type = fn_type @T.binding.as_type.as.ImplicitAs.impl.Convert.1, @T.binding.as_type.as.ImplicitAs.impl.339(%OptionalStorage.facet) [concrete]
|
|
|
+// CHECK:STDOUT: %T.binding.as_type.as.ImplicitAs.impl.Convert.6d1: %T.binding.as_type.as.ImplicitAs.impl.Convert.type.398 = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.facet: %ImplicitAs.type.099 = facet_value %ptr.5c7, (%ImplicitAs.impl_witness.ff2) [concrete]
|
|
|
+// CHECK:STDOUT: %.681: type = fn_type_with_self_type %ImplicitAs.Convert.type.d3b, %ImplicitAs.facet [concrete]
|
|
|
+// CHECK:STDOUT: %T.binding.as_type.as.ImplicitAs.impl.Convert.specific_fn: <specific function> = specific_function %T.binding.as_type.as.ImplicitAs.impl.Convert.6d1, @T.binding.as_type.as.ImplicitAs.impl.Convert.1(%OptionalStorage.facet) [concrete]
|
|
|
+// CHECK:STDOUT: %type_where: type = facet_type <type where .Self impls <CanDestroy>> [concrete]
|
|
|
+// CHECK:STDOUT: %facet_value.542: %type_where = facet_value %Optional.454, () [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.6e8: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.542) [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.de7: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.6e8 = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.3c6: type = ptr_type %Optional.454 [concrete]
|
|
|
+// CHECK:STDOUT: %facet_value.448: %type_where = facet_value %ptr.5c7, () [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7f4: type = fn_type @DestroyT.binding.as_type.as.Destroy.impl.Op, @DestroyT.binding.as_type.as.Destroy.impl(%facet_value.448) [concrete]
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.d4c: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.7f4 = struct_value () [concrete]
|
|
|
+// CHECK:STDOUT: %ptr.dfe: type = ptr_type %ptr.5c7 [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: imports {
|
|
|
+// CHECK:STDOUT: %Cpp: <namespace> = namespace file.%Cpp.import_cpp, [concrete] {
|
|
|
+// CHECK:STDOUT: .S = %S.decl
|
|
|
+// CHECK:STDOUT: .foo = %foo.cpp_overload_set.value
|
|
|
+// CHECK:STDOUT: import Cpp//...
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
|
|
|
+// 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: %Core.import_ref.2fb: type = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @ptr.as.OptionalStorage.impl.%MaybeUnformed (constants.%MaybeUnformed.cff)]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.a7c = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
|
|
+// CHECK:STDOUT: %Core.import_ref.1b2: @ptr.as.OptionalStorage.impl.%ptr.as.OptionalStorage.impl.Some.type (%ptr.as.OptionalStorage.impl.Some.type.911) = 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.2a0)]
|
|
|
+// CHECK:STDOUT: %Core.import_ref.6a9 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
|
|
+// CHECK:STDOUT: %Core.import_ref.971 = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, unloaded
|
|
|
+// CHECK:STDOUT: %OptionalStorage.impl_witness_table.236 = impl_witness_table (%Core.import_ref.2fb, %Core.import_ref.a7c, %Core.import_ref.1b2, %Core.import_ref.6a9, %Core.import_ref.971), @ptr.as.OptionalStorage.impl [concrete]
|
|
|
+// CHECK:STDOUT: %foo.decl: %foo.type = fn_decl @foo [concrete = constants.%foo] {
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: } {
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: %.loc11_12.1: type = splice_block %Optional [concrete = constants.%Optional.454] {
|
|
|
+// CHECK:STDOUT: %OptionalStorage.facet: %OptionalStorage.type = facet_value constants.%ptr.5c7, (constants.%OptionalStorage.impl_witness.fef) [concrete = constants.%OptionalStorage.facet]
|
|
|
+// CHECK:STDOUT: %.loc11_12.2: %OptionalStorage.type = converted constants.%ptr.5c7, %OptionalStorage.facet [concrete = constants.%OptionalStorage.facet]
|
|
|
+// CHECK:STDOUT: %Optional: type = class_type @Optional, @Optional(constants.%OptionalStorage.facet) [concrete = constants.%Optional.454]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %Core.import_ref.7bc: @T.binding.as_type.as.ImplicitAs.impl.339.%T.binding.as_type.as.ImplicitAs.impl.Convert.type (%T.binding.as_type.as.ImplicitAs.impl.Convert.type.a78) = import_ref Core//prelude/types/optional, loc{{\d+_\d+}}, loaded [symbolic = @T.binding.as_type.as.ImplicitAs.impl.339.%T.binding.as_type.as.ImplicitAs.impl.Convert (constants.%T.binding.as_type.as.ImplicitAs.impl.Convert.d1b)]
|
|
|
+// CHECK:STDOUT: %ImplicitAs.impl_witness_table.284 = impl_witness_table (%Core.import_ref.7bc), @T.binding.as_type.as.ImplicitAs.impl.339 [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: fn @F() {
|
|
|
+// CHECK:STDOUT: !entry:
|
|
|
+// CHECK:STDOUT: name_binding_decl {
|
|
|
+// CHECK:STDOUT: %p.patt: %pattern_type.259 = ref_binding_pattern p [concrete]
|
|
|
+// CHECK:STDOUT: %p.var_patt: %pattern_type.259 = var_pattern %p.patt [concrete]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %p.var: ref %ptr.5c7 = var %p.var_patt
|
|
|
+// CHECK:STDOUT: %G.ref: %G.type = name_ref G, file.%G.decl [concrete = constants.%G]
|
|
|
+// CHECK:STDOUT: %G.call: init %ptr.5c7 = call %G.ref()
|
|
|
+// CHECK:STDOUT: assign %p.var, %G.call
|
|
|
+// CHECK:STDOUT: %.loc10: type = splice_block %ptr [concrete = constants.%ptr.5c7] {
|
|
|
+// CHECK:STDOUT: %Cpp.ref.loc10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
|
|
+// CHECK:STDOUT: %S.ref: type = name_ref S, imports.%S.decl [concrete = constants.%S]
|
|
|
+// CHECK:STDOUT: %ptr: type = ptr_type %S.ref [concrete = constants.%ptr.5c7]
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT: %p: ref %ptr.5c7 = ref_binding p, %p.var
|
|
|
+// CHECK:STDOUT: %Cpp.ref.loc11: <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: %p.ref: ref %ptr.5c7 = name_ref p, %p
|
|
|
+// CHECK:STDOUT: %impl.elem0: %.681 = impl_witness_access constants.%ImplicitAs.impl_witness.ff2, element0 [concrete = constants.%T.binding.as_type.as.ImplicitAs.impl.Convert.6d1]
|
|
|
+// CHECK:STDOUT: %bound_method.loc11_11.1: <bound method> = bound_method %p.ref, %impl.elem0
|
|
|
+// CHECK:STDOUT: %specific_fn: <specific function> = specific_function %impl.elem0, @T.binding.as_type.as.ImplicitAs.impl.Convert.1(constants.%OptionalStorage.facet) [concrete = constants.%T.binding.as_type.as.ImplicitAs.impl.Convert.specific_fn]
|
|
|
+// CHECK:STDOUT: %bound_method.loc11_11.2: <bound method> = bound_method %p.ref, %specific_fn
|
|
|
+// CHECK:STDOUT: %.loc11_11.1: ref %Optional.454 = temporary_storage
|
|
|
+// CHECK:STDOUT: %.loc11_11.2: %ptr.5c7 = acquire_value %p.ref
|
|
|
+// CHECK:STDOUT: %T.binding.as_type.as.ImplicitAs.impl.Convert.call: init %Optional.454 = call %bound_method.loc11_11.2(%.loc11_11.2) to %.loc11_11.1
|
|
|
+// CHECK:STDOUT: %.loc11_11.3: init %Optional.454 = converted %p.ref, %T.binding.as_type.as.ImplicitAs.impl.Convert.call
|
|
|
+// CHECK:STDOUT: %.loc11_11.4: ref %Optional.454 = temporary %.loc11_11.1, %.loc11_11.3
|
|
|
+// CHECK:STDOUT: %.loc11_11.5: %Optional.454 = acquire_value %.loc11_11.4
|
|
|
+// CHECK:STDOUT: %foo.call: init %empty_tuple.type = call imports.%foo.decl(%.loc11_11.5)
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc11: <bound method> = bound_method %.loc11_11.4, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.de7
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: %bound_method.loc11_11.3: <bound method> = bound_method %.loc11_11.4, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.1
|
|
|
+// CHECK:STDOUT: %addr.loc11: %ptr.3c6 = addr_of %.loc11_11.4
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc11: init %empty_tuple.type = call %bound_method.loc11_11.3(%addr.loc11)
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.bound.loc10: <bound method> = bound_method %p.var, constants.%DestroyT.binding.as_type.as.Destroy.impl.Op.d4c
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: %bound_method.loc10: <bound method> = bound_method %p.var, %DestroyT.binding.as_type.as.Destroy.impl.Op.specific_fn.2
|
|
|
+// CHECK:STDOUT: %addr.loc10: %ptr.dfe = addr_of %p.var
|
|
|
+// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.call.loc10: init %empty_tuple.type = call %bound_method.loc10(%addr.loc10)
|
|
|
+// CHECK:STDOUT: <elided>
|
|
|
+// CHECK:STDOUT: }
|
|
|
+// CHECK:STDOUT:
|
|
|
+// CHECK:STDOUT: --- import_non_nullable_pointer_return.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
|
|
@@ -718,7 +1205,7 @@ fn F() {
|
|
|
// CHECK:STDOUT: <elided>
|
|
|
// CHECK:STDOUT: }
|
|
|
// CHECK:STDOUT:
|
|
|
-// CHECK:STDOUT: --- import_const_pointer_return.carbon
|
|
|
+// CHECK:STDOUT: --- import_const_non_nullable_pointer_return.carbon
|
|
|
// CHECK:STDOUT:
|
|
|
// CHECK:STDOUT: constants {
|
|
|
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|