mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:20:13 +01:00
C++ interop: Add return reference types support (#6178)
This is a follow up of #6082, which added support for reference types, but not for return types. C++ Interop Demo: ```carbon // main.carbon library "Main"; import Core library "io"; import Cpp inline ''' struct C { auto Inc() -> void { ++x; } int x = 0; }; auto GetC() -> C& { static C c; return c; } '''; fn Run() -> i32 { Core.Print(Cpp.GetC()->x); Cpp.GetC()->Inc(); Core.Print(Cpp.GetC()->x); Cpp.GetC()->Inc(); Core.Print(Cpp.GetC()->x); return 0; } ``` ```shell $ bazel build toolchain:carbon && bazel-bin/toolchain/carbon compile main.carbon && bazel-bin/toolchain/carbon link main.o --output=demo && ./demo 0 1 2 ``` **Without this change**: ```shell main.carbon:19:14: error: semantics TODO: `Unsupported: return type: C &` Core.Print(Cpp.GetC()->x); ^~~~~~~~~~ ``` Part of #6148.
This commit is contained in:
@@ -1446,16 +1446,26 @@ static auto MakeParamPatternsBlockId(Context& context, SemIR::LocId loc_id,
|
||||
// TODO: Support more return types.
|
||||
static auto GetReturnTypeExpr(Context& context, SemIR::LocId loc_id,
|
||||
clang::FunctionDecl* clang_decl) -> TypeExpr {
|
||||
clang::QualType ret_type = clang_decl->getReturnType();
|
||||
if (!ret_type->isVoidType()) {
|
||||
TypeExpr mapped_type = MapType(context, loc_id, ret_type);
|
||||
if (!mapped_type.inst_id.has_value()) {
|
||||
clang::QualType orig_ret_type = clang_decl->getReturnType();
|
||||
if (!orig_ret_type->isVoidType()) {
|
||||
// We map `T&` return type to `addr param: T*`, and `T&&` parameters to
|
||||
// `param: T`.
|
||||
// TODO: Revisit this and decide what we really want to do here.
|
||||
clang::QualType ret_type = orig_ret_type.getNonReferenceType();
|
||||
|
||||
auto [orig_type_inst_id, type_id] = MapType(context, loc_id, ret_type);
|
||||
if (!orig_type_inst_id.has_value()) {
|
||||
context.TODO(loc_id, llvm::formatv("Unsupported: return type: {0}",
|
||||
ret_type.getAsString()));
|
||||
orig_ret_type.getAsString()));
|
||||
return {.inst_id = SemIR::ErrorInst::TypeInstId,
|
||||
.type_id = SemIR::ErrorInst::TypeId};
|
||||
}
|
||||
return mapped_type;
|
||||
|
||||
if (orig_ret_type->isLValueReferenceType()) {
|
||||
type_id = GetPointerType(context, orig_type_inst_id);
|
||||
}
|
||||
|
||||
return {orig_type_inst_id, type_id};
|
||||
}
|
||||
|
||||
auto* ctor = dyn_cast<clang::CXXConstructorDecl>(clang_decl);
|
||||
|
||||
@@ -241,6 +241,14 @@ static auto GetNonnullType(clang::ASTContext& ast_context,
|
||||
pointer_type, pointer_type);
|
||||
}
|
||||
|
||||
// Given a type, returns the corresponding _Nonnull-qualified pointer type,
|
||||
// ignoring references.
|
||||
static auto GetNonNullablePointerType(clang::ASTContext& ast_context,
|
||||
clang::QualType type) {
|
||||
return GetNonnullType(ast_context,
|
||||
ast_context.getPointerType(type.getNonReferenceType()));
|
||||
}
|
||||
|
||||
// Given the type of a callee parameter, returns the type to use for the
|
||||
// corresponding thunk parameter.
|
||||
static auto GetThunkParameterType(clang::ASTContext& ast_context,
|
||||
@@ -249,8 +257,7 @@ static auto GetThunkParameterType(clang::ASTContext& ast_context,
|
||||
if (IsSimpleAbiType(ast_context, callee_type)) {
|
||||
return callee_type;
|
||||
}
|
||||
return GetNonnullType(ast_context, ast_context.getPointerType(
|
||||
callee_type.getNonReferenceType()));
|
||||
return GetNonNullablePointerType(ast_context, callee_type);
|
||||
}
|
||||
|
||||
// Creates the thunk parameter types given the callee function.
|
||||
@@ -272,9 +279,8 @@ static auto BuildThunkParameterTypes(clang::ASTContext& ast_context,
|
||||
}
|
||||
|
||||
if (!callee_info.has_simple_return_type) {
|
||||
thunk_param_types.push_back(GetNonnullType(
|
||||
ast_context,
|
||||
ast_context.getPointerType(callee_info.effective_return_type)));
|
||||
thunk_param_types.push_back(GetNonNullablePointerType(
|
||||
ast_context, callee_info.effective_return_type));
|
||||
}
|
||||
|
||||
CARBON_CHECK(thunk_param_types.size() == callee_info.num_thunk_params());
|
||||
@@ -524,7 +530,7 @@ static auto BuildThunkBody(clang::Sema& sema,
|
||||
|
||||
auto* return_object_addr = BuildThunkParamRef(
|
||||
sema, thunk_function_decl, callee_info.GetThunkReturnParamIndex());
|
||||
auto return_type = callee_info.effective_return_type;
|
||||
auto return_type = callee_info.effective_return_type.getNonReferenceType();
|
||||
auto* return_type_info =
|
||||
sema.Context.getTrivialTypeSourceInfo(return_type, clang_loc);
|
||||
auto placement_new = sema.BuildCXXNew(
|
||||
|
||||
+84
-66
@@ -223,22 +223,20 @@ fn F() {
|
||||
// Lvalue reference as return type
|
||||
// ============================================================================
|
||||
|
||||
// --- fail_todo_call_return_lvalue_ref.carbon
|
||||
// --- return_lvalue_ref.h
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
struct S {};
|
||||
|
||||
auto ReturnsLValue() -> S&;
|
||||
''';
|
||||
|
||||
// --- call_return_lvalue_ref.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "return_lvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_call_return_lvalue_ref.carbon:[[@LINE+4]]:19: error: semantics TODO: `Unsupported: return type: S &` [SemanticsTodo]
|
||||
// CHECK:STDERR: let s: Cpp.S* = Cpp.ReturnsLValue();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
let s: Cpp.S* = Cpp.ReturnsLValue();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
@@ -247,22 +245,20 @@ fn F() {
|
||||
// Rvalue reference as return type
|
||||
// ============================================================================
|
||||
|
||||
// --- fail_todo_call_return_rvalue_ref.carbon
|
||||
// --- return_rvalue_ref.h
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
struct S {};
|
||||
|
||||
auto ReturnsRValue() -> S&&;
|
||||
''';
|
||||
|
||||
// --- call_return_rvalue_ref.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "return_rvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_call_return_rvalue_ref.carbon:[[@LINE+4]]:18: error: semantics TODO: `Unsupported: return type: S &&` [SemanticsTodo]
|
||||
// CHECK:STDERR: var s: Cpp.S = Cpp.ReturnsRValue();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var s: Cpp.S = Cpp.ReturnsRValue();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
@@ -271,26 +267,41 @@ fn F() {
|
||||
// Const reference as return type
|
||||
// ============================================================================
|
||||
|
||||
// --- fail_todo_call_return_const_lvalue_ref.carbon
|
||||
// --- return_const_lvalue_ref.h
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
struct S {};
|
||||
|
||||
auto ReturnConstLValue() -> const S&;
|
||||
''';
|
||||
|
||||
// --- call_return_const_lvalue_ref.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "return_const_lvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
//@dump-sem-ir-begin
|
||||
// CHECK:STDERR: fail_todo_call_return_const_lvalue_ref.carbon:[[@LINE+4]]:24: error: semantics TODO: `Unsupported: return type: const S &` [SemanticsTodo]
|
||||
// CHECK:STDERR: var s: const Cpp.S = Cpp.ReturnConstLValue();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var s: const Cpp.S = Cpp.ReturnConstLValue();
|
||||
var s: const Cpp.S* = Cpp.ReturnConstLValue();
|
||||
//@dump-sem-ir-end
|
||||
}
|
||||
|
||||
// --- fail_call_return_const_lvalue_ref_const_correctness.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "return_const_lvalue_ref.h";
|
||||
|
||||
fn F() {
|
||||
// CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+7]]:3: error: cannot implicitly convert expression of type `const Cpp.S*` to `Cpp.S*` [ConversionFailure]
|
||||
// CHECK:STDERR: var s: Cpp.S* = Cpp.ReturnConstLValue();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR: fail_call_return_const_lvalue_ref_const_correctness.carbon:[[@LINE+4]]:3: note: type `const Cpp.S*` does not implement interface `Core.ImplicitAs(Cpp.S*)` [MissingImplInMemberAccessNote]
|
||||
// CHECK:STDERR: var s: Cpp.S* = Cpp.ReturnConstLValue();
|
||||
// CHECK:STDERR: ^~~~~~~~~~~~~
|
||||
// CHECK:STDERR:
|
||||
var s: Cpp.S* = Cpp.ReturnConstLValue();
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: --- call_param_lvalue_ref.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
@@ -873,7 +884,7 @@ fn F() {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_todo_call_return_lvalue_ref.carbon
|
||||
// CHECK:STDOUT: --- call_return_lvalue_ref.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %S: type = class_type @S [concrete]
|
||||
@@ -905,19 +916,21 @@ fn F() {
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type = binding_pattern s [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8_19: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ReturnsLValue.ref: %ReturnsLValue.cpp_overload_set.type = name_ref ReturnsLValue, imports.%ReturnsLValue.cpp_overload_set.value [concrete = constants.%ReturnsLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %ReturnsLValue.call: init <error> = call imports.%ReturnsLValue.decl()
|
||||
// CHECK:STDOUT: %.loc16: type = splice_block %ptr [concrete = constants.%ptr] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16_10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ReturnsLValue.call: init %ptr = call imports.%ReturnsLValue.decl()
|
||||
// CHECK:STDOUT: %.loc8_15: type = splice_block %ptr [concrete = constants.%ptr] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8_10: <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]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %s: %ptr = bind_name s, <error> [concrete = <error>]
|
||||
// CHECK:STDOUT: %.loc8_37.1: %ptr = value_of_initializer %ReturnsLValue.call
|
||||
// CHECK:STDOUT: %.loc8_37.2: %ptr = converted %ReturnsLValue.call, %.loc8_37.1
|
||||
// CHECK:STDOUT: %s: %ptr = bind_name s, %.loc8_37.2
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_todo_call_return_rvalue_ref.carbon
|
||||
// CHECK:STDOUT: --- call_return_rvalue_ref.carbon
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: constants {
|
||||
// CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [concrete]
|
||||
@@ -925,13 +938,13 @@ fn F() {
|
||||
// CHECK:STDOUT: %pattern_type.7da: type = pattern_type %S [concrete]
|
||||
// CHECK:STDOUT: %ReturnsRValue.cpp_overload_set.type: type = cpp_overload_set_type @ReturnsRValue.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %ReturnsRValue.cpp_overload_set.value: %ReturnsRValue.cpp_overload_set.type = cpp_overload_set_value @ReturnsRValue.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %ReturnsRValue.type: type = fn_type @ReturnsRValue [concrete]
|
||||
// CHECK:STDOUT: %ReturnsRValue: %ReturnsRValue.type = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
|
||||
// CHECK:STDOUT: %ReturnsRValue__carbon_thunk.type: type = fn_type @ReturnsRValue__carbon_thunk [concrete]
|
||||
// CHECK:STDOUT: %ReturnsRValue__carbon_thunk: %ReturnsRValue__carbon_thunk.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.34a: 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.016: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.34a = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.5c7: type = ptr_type %S [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -942,7 +955,7 @@ fn F() {
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %S.decl: type = class_decl @S [concrete = constants.%S] {} {}
|
||||
// CHECK:STDOUT: %ReturnsRValue.cpp_overload_set.value: %ReturnsRValue.cpp_overload_set.type = cpp_overload_set_value @ReturnsRValue.cpp_overload_set [concrete = constants.%ReturnsRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %ReturnsRValue.decl: %ReturnsRValue.type = fn_decl @ReturnsRValue [concrete = constants.%ReturnsRValue] {
|
||||
// CHECK:STDOUT: %ReturnsRValue__carbon_thunk.decl: %ReturnsRValue__carbon_thunk.type = fn_decl @ReturnsRValue__carbon_thunk [concrete = constants.%ReturnsRValue__carbon_thunk] {
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: } {
|
||||
// CHECK:STDOUT: <elided>
|
||||
@@ -956,41 +969,45 @@ fn F() {
|
||||
// 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: %Cpp.ref.loc16_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8_18: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ReturnsRValue.ref: %ReturnsRValue.cpp_overload_set.type = name_ref ReturnsRValue, imports.%ReturnsRValue.cpp_overload_set.value [concrete = constants.%ReturnsRValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %ReturnsRValue.call: init <error> = call imports.%ReturnsRValue.decl()
|
||||
// CHECK:STDOUT: assign %s.var, <error>
|
||||
// CHECK:STDOUT: %.loc16_13: type = splice_block %S.ref [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16_10: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %.loc8_3.1: ref %S = splice_block %s.var {}
|
||||
// CHECK:STDOUT: %addr.loc8_36: %ptr.5c7 = addr_of %.loc8_3.1
|
||||
// CHECK:STDOUT: %ReturnsRValue__carbon_thunk.call: init %empty_tuple.type = call imports.%ReturnsRValue__carbon_thunk.decl(%addr.loc8_36)
|
||||
// CHECK:STDOUT: %.loc8_36: init %S = in_place_init %ReturnsRValue__carbon_thunk.call, %.loc8_3.1
|
||||
// CHECK:STDOUT: assign %s.var, %.loc8_36
|
||||
// CHECK:STDOUT: %.loc8_13: type = splice_block %S.ref [concrete = constants.%S] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8_10: <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 = bind_name s, %s.var
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%S, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc16_3: %type_where = converted constants.%S, %facet_value [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc8_3.2: %type_where = converted constants.%S, %facet_value [concrete = constants.%facet_value]
|
||||
// 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.016
|
||||
// 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: %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)
|
||||
// CHECK:STDOUT: %addr.loc8_3: %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_3)
|
||||
// CHECK:STDOUT: <elided>
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: --- fail_todo_call_return_const_lvalue_ref.carbon
|
||||
// CHECK:STDOUT: --- call_return_const_lvalue_ref.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: %const: type = const_type %S [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.9be: type = pattern_type %const [concrete]
|
||||
// CHECK:STDOUT: %ptr.ff5: type = ptr_type %const [concrete]
|
||||
// CHECK:STDOUT: %pattern_type.32f: type = pattern_type %ptr.ff5 [concrete]
|
||||
// CHECK:STDOUT: %ReturnConstLValue.cpp_overload_set.type: type = cpp_overload_set_type @ReturnConstLValue.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %ReturnConstLValue.cpp_overload_set.value: %ReturnConstLValue.cpp_overload_set.type = cpp_overload_set_value @ReturnConstLValue.cpp_overload_set [concrete]
|
||||
// CHECK:STDOUT: %ReturnConstLValue.type: type = fn_type @ReturnConstLValue [concrete]
|
||||
// CHECK:STDOUT: %ReturnConstLValue: %ReturnConstLValue.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.56e: 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.089: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.56e = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.ff5: type = ptr_type %const [concrete]
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value %ptr.ff5, () [concrete]
|
||||
// CHECK:STDOUT: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.40d: 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.c44: %DestroyT.binding.as_type.as.Destroy.impl.Op.type.40d = struct_value () [concrete]
|
||||
// CHECK:STDOUT: %ptr.dec: type = ptr_type %ptr.ff5 [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: imports {
|
||||
@@ -1011,26 +1028,27 @@ fn F() {
|
||||
// CHECK:STDOUT: fn @F() {
|
||||
// CHECK:STDOUT: !entry:
|
||||
// CHECK:STDOUT: name_binding_decl {
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.9be = binding_pattern s [concrete]
|
||||
// CHECK:STDOUT: %s.var_patt: %pattern_type.9be = var_pattern %s.patt [concrete]
|
||||
// CHECK:STDOUT: %s.patt: %pattern_type.32f = binding_pattern s [concrete]
|
||||
// CHECK:STDOUT: %s.var_patt: %pattern_type.32f = var_pattern %s.patt [concrete]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %s.var: ref %const = var %s.var_patt
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16_24: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %s.var: ref %ptr.ff5 = var %s.var_patt
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8_25: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ReturnConstLValue.ref: %ReturnConstLValue.cpp_overload_set.type = name_ref ReturnConstLValue, imports.%ReturnConstLValue.cpp_overload_set.value [concrete = constants.%ReturnConstLValue.cpp_overload_set.value]
|
||||
// CHECK:STDOUT: %ReturnConstLValue.call: init <error> = call imports.%ReturnConstLValue.decl()
|
||||
// CHECK:STDOUT: assign %s.var, <error>
|
||||
// CHECK:STDOUT: %.loc16_10: type = splice_block %const [concrete = constants.%const] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc16_16: <namespace> = name_ref Cpp, imports.%Cpp [concrete = imports.%Cpp]
|
||||
// CHECK:STDOUT: %ReturnConstLValue.call: init %ptr.ff5 = call imports.%ReturnConstLValue.decl()
|
||||
// CHECK:STDOUT: assign %s.var, %ReturnConstLValue.call
|
||||
// CHECK:STDOUT: %.loc8_21: type = splice_block %ptr [concrete = constants.%ptr.ff5] {
|
||||
// CHECK:STDOUT: %Cpp.ref.loc8_16: <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: %const: type = const_type %S.ref [concrete = constants.%const]
|
||||
// CHECK:STDOUT: %ptr: type = ptr_type %const [concrete = constants.%ptr.ff5]
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT: %s: ref %const = bind_name s, %s.var
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%const, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc16_3: %type_where = converted constants.%const, %facet_value [concrete = constants.%facet_value]
|
||||
// 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.089
|
||||
// CHECK:STDOUT: %s: ref %ptr.ff5 = bind_name s, %s.var
|
||||
// CHECK:STDOUT: %facet_value: %type_where = facet_value constants.%ptr.ff5, () [concrete = constants.%facet_value]
|
||||
// CHECK:STDOUT: %.loc8_3: %type_where = converted constants.%ptr.ff5, %facet_value [concrete = constants.%facet_value]
|
||||
// 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.c44
|
||||
// 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: %ptr.ff5 = addr_of %s.var
|
||||
// CHECK:STDOUT: %addr: %ptr.dec = addr_of %s.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: }
|
||||
|
||||
+156
-33
@@ -10,23 +10,25 @@
|
||||
// TIP: To dump output, run:
|
||||
// TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/lower/testdata/interop/cpp/reference.carbon
|
||||
|
||||
// --- reference_params.h
|
||||
|
||||
class C {};
|
||||
|
||||
void TakeCRef(C&);
|
||||
void TakeCRRef(C&&);
|
||||
void TakeConstCRef(const C&);
|
||||
|
||||
void TakeIntRef(int&);
|
||||
void TakeIntRRef(int&&);
|
||||
void TakeConstIntRef(const int&);
|
||||
// ============================================================================
|
||||
// Reference params
|
||||
// ============================================================================
|
||||
|
||||
// --- pass_references.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp library "reference_params.h";
|
||||
import Cpp inline '''
|
||||
class C {};
|
||||
|
||||
auto TakeCRef(C&) -> void;
|
||||
auto TakeCRRef(C&&) -> void;
|
||||
auto TakeConstCRef(const C&) -> void;
|
||||
|
||||
auto TakeIntRef(int&) -> void;
|
||||
auto TakeIntRRef(int&&) -> void;
|
||||
auto TakeConstIntRef(const int&) -> void;
|
||||
''';
|
||||
|
||||
fn PassRefs() {
|
||||
var c: Cpp.C;
|
||||
@@ -40,30 +42,60 @@ fn PassRefs() {
|
||||
Cpp.TakeConstIntRef(n);
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Reference return values
|
||||
// ============================================================================
|
||||
|
||||
// --- return_references.carbon
|
||||
|
||||
library "[[@TEST_NAME]]";
|
||||
|
||||
import Cpp inline '''
|
||||
class C {};
|
||||
|
||||
auto ReturnCRef() -> C&;
|
||||
auto ReturnCRRef() -> C&&;
|
||||
auto ReturnConstCRef() -> const C&;
|
||||
|
||||
auto ReturnIntRef() -> int&;
|
||||
auto ReturnIntRRef() -> int&&;
|
||||
auto ReturnConstIntRef() -> const int&;
|
||||
''';
|
||||
|
||||
fn GetRefs() {
|
||||
var c1: Cpp.C* = Cpp.ReturnCRef();
|
||||
var c2: Cpp.C = Cpp.ReturnCRRef();
|
||||
var c3: const Cpp.C* = Cpp.ReturnConstCRef();
|
||||
|
||||
var n1: i32* = Cpp.ReturnIntRef();
|
||||
var n2: i32 = Cpp.ReturnIntRRef();
|
||||
var n3: const i32* = Cpp.ReturnConstIntRef();
|
||||
}
|
||||
|
||||
// CHECK:STDOUT: ; ModuleID = 'pass_references.carbon'
|
||||
// CHECK:STDOUT: source_filename = "pass_references.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: @C.val.loc9_18.3 = internal constant {} zeroinitializer
|
||||
// CHECK:STDOUT: @C.val.loc19_18.3 = internal constant {} zeroinitializer
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: define void @_CPassRefs.Main() !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %c.var = alloca {}, align 8, !dbg !10
|
||||
// CHECK:STDOUT: %.loc9_18.2.temp = alloca {}, align 8, !dbg !11
|
||||
// CHECK:STDOUT: %.loc19_18.2.temp = alloca {}, align 8, !dbg !11
|
||||
// CHECK:STDOUT: %n.var = alloca i32, align 4, !dbg !12
|
||||
// CHECK:STDOUT: %.loc14_22.3.temp = alloca i32, align 4, !dbg !13
|
||||
// CHECK:STDOUT: %.loc24_22.3.temp = alloca i32, align 4, !dbg !13
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c.var), !dbg !10
|
||||
// CHECK:STDOUT: call void @_Z8TakeCRefR1C.carbon_thunk(ptr %c.var), !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc9_18.2.temp), !dbg !11
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc9_18.2.temp, ptr align 1 @C.val.loc9_18.3, i64 0, i1 false), !dbg !11
|
||||
// CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk(ptr %.loc9_18.2.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc19_18.2.temp), !dbg !11
|
||||
// CHECK:STDOUT: call void @llvm.memcpy.p0.p0.i64(ptr align 1 %.loc19_18.2.temp, ptr align 1 @C.val.loc19_18.3, i64 0, i1 false), !dbg !11
|
||||
// CHECK:STDOUT: call void @_Z9TakeCRRefO1C.carbon_thunk(ptr %.loc19_18.2.temp), !dbg !15
|
||||
// CHECK:STDOUT: call void @_Z13TakeConstCRefRK1C.carbon_thunk(ptr %c.var), !dbg !16
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n.var), !dbg !12
|
||||
// CHECK:STDOUT: call void @_Z10TakeIntRefRi.carbon_thunk(ptr %n.var), !dbg !17
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc14_22.3.temp), !dbg !13
|
||||
// CHECK:STDOUT: store i32 42, ptr %.loc14_22.3.temp, align 4, !dbg !13
|
||||
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi.carbon_thunk(ptr %.loc14_22.3.temp), !dbg !18
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %.loc24_22.3.temp), !dbg !13
|
||||
// CHECK:STDOUT: store i32 42, ptr %.loc24_22.3.temp, align 4, !dbg !13
|
||||
// CHECK:STDOUT: call void @_Z11TakeIntRRefOi.carbon_thunk(ptr %.loc24_22.3.temp), !dbg !18
|
||||
// CHECK:STDOUT: call void @_Z15TakeConstIntRefRKi.carbon_thunk(ptr %n.var), !dbg !19
|
||||
// CHECK:STDOUT: ret void, !dbg !20
|
||||
// CHECK:STDOUT: }
|
||||
@@ -164,17 +196,108 @@ fn PassRefs() {
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "pass_references.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !6, line: 6, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "PassRefs", linkageName: "_CPassRefs.Main", scope: null, file: !6, line: 16, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 7, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 9, column: 17, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 12, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 14, column: 19, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 8, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 9, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 10, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 13, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 14, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 15, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 6, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 17, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 19, column: 17, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 22, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 24, column: 19, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 18, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 19, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 20, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 23, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 24, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 25, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 16, column: 1, scope: !7)
|
||||
// CHECK:STDOUT: ; ModuleID = 'return_references.carbon'
|
||||
// CHECK:STDOUT: source_filename = "return_references.carbon"
|
||||
// CHECK:STDOUT: target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
|
||||
// CHECK:STDOUT: target triple = "x86_64-unknown-linux-gnu"
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: define void @_CGetRefs.Main() !dbg !7 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %c1.var = alloca ptr, align 8, !dbg !10
|
||||
// CHECK:STDOUT: %c2.var = alloca {}, align 8, !dbg !11
|
||||
// CHECK:STDOUT: %c3.var = alloca ptr, align 8, !dbg !12
|
||||
// CHECK:STDOUT: %n1.var = alloca ptr, align 8, !dbg !13
|
||||
// CHECK:STDOUT: %n2.var = alloca i32, align 4, !dbg !14
|
||||
// CHECK:STDOUT: %n3.var = alloca ptr, align 8, !dbg !15
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c1.var), !dbg !10
|
||||
// CHECK:STDOUT: %ReturnCRef.call = call ptr @_Z10ReturnCRefv(), !dbg !16
|
||||
// CHECK:STDOUT: store ptr %ReturnCRef.call, ptr %c1.var, align 8, !dbg !10
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c2.var), !dbg !11
|
||||
// CHECK:STDOUT: call void @_Z11ReturnCRRefv.carbon_thunk(ptr %c2.var), !dbg !17
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %c3.var), !dbg !12
|
||||
// CHECK:STDOUT: %ReturnConstCRef.call = call ptr @_Z15ReturnConstCRefv(), !dbg !18
|
||||
// CHECK:STDOUT: store ptr %ReturnConstCRef.call, ptr %c3.var, align 8, !dbg !12
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n1.var), !dbg !13
|
||||
// CHECK:STDOUT: %ReturnIntRef.call = call ptr @_Z12ReturnIntRefv(), !dbg !19
|
||||
// CHECK:STDOUT: store ptr %ReturnIntRef.call, ptr %n1.var, align 8, !dbg !13
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n2.var), !dbg !14
|
||||
// CHECK:STDOUT: %ReturnIntRRef.call = call i32 @_Z13ReturnIntRRefv(), !dbg !20
|
||||
// CHECK:STDOUT: store i32 %ReturnIntRRef.call, ptr %n2.var, align 4, !dbg !14
|
||||
// CHECK:STDOUT: call void @llvm.lifetime.start.p0(ptr %n3.var), !dbg !15
|
||||
// CHECK:STDOUT: %ReturnConstIntRef.call = call ptr @_Z17ReturnConstIntRefv(), !dbg !21
|
||||
// CHECK:STDOUT: store ptr %ReturnConstIntRef.call, ptr %n3.var, align 8, !dbg !15
|
||||
// CHECK:STDOUT: ret void, !dbg !22
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare ptr @_Z10ReturnCRefv()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare ptr @_Z15ReturnConstCRefv()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare ptr @_Z12ReturnIntRefv()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare i32 @_Z13ReturnIntRRefv()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare ptr @_Z17ReturnConstIntRefv()
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
|
||||
// CHECK:STDOUT: declare void @llvm.lifetime.start.p0(ptr captures(none)) #0
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; Function Attrs: alwaysinline mustprogress
|
||||
// CHECK:STDOUT: define dso_local void @_Z11ReturnCRRefv.carbon_thunk(ptr %return) #1 {
|
||||
// CHECK:STDOUT: entry:
|
||||
// CHECK:STDOUT: %return.addr = alloca ptr, align 8
|
||||
// CHECK:STDOUT: store ptr %return, ptr %return.addr, align 8
|
||||
// CHECK:STDOUT: %0 = load ptr, ptr %return.addr, align 8
|
||||
// CHECK:STDOUT: %call = call nonnull align 1 dereferenceable(1) ptr @_Z11ReturnCRRefv()
|
||||
// CHECK:STDOUT: ret void
|
||||
// CHECK:STDOUT: }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: declare nonnull align 1 dereferenceable(1) ptr @_Z11ReturnCRRefv() #2
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: ; uselistorder directives
|
||||
// CHECK:STDOUT: uselistorder ptr @llvm.lifetime.start.p0, { 5, 4, 3, 2, 1, 0 }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
|
||||
// CHECK:STDOUT: attributes #1 = { alwaysinline mustprogress "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="0" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT: attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="0" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !llvm.module.flags = !{!0, !1, !2, !3, !4}
|
||||
// CHECK:STDOUT: !llvm.dbg.cu = !{!5}
|
||||
// CHECK:STDOUT:
|
||||
// CHECK:STDOUT: !0 = !{i32 7, !"Dwarf Version", i32 5}
|
||||
// CHECK:STDOUT: !1 = !{i32 2, !"Debug Info Version", i32 3}
|
||||
// CHECK:STDOUT: !2 = !{i32 1, !"wchar_size", i32 4}
|
||||
// CHECK:STDOUT: !3 = !{i32 8, !"PIC Level", i32 0}
|
||||
// CHECK:STDOUT: !4 = !{i32 7, !"PIE Level", i32 2}
|
||||
// CHECK:STDOUT: !5 = distinct !DICompileUnit(language: DW_LANG_C, file: !6, producer: "carbon", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
|
||||
// CHECK:STDOUT: !6 = !DIFile(filename: "return_references.carbon", directory: "")
|
||||
// CHECK:STDOUT: !7 = distinct !DISubprogram(name: "GetRefs", linkageName: "_CGetRefs.Main", scope: null, file: !6, line: 16, type: !8, spFlags: DISPFlagDefinition, unit: !5)
|
||||
// CHECK:STDOUT: !8 = !DISubroutineType(types: !9)
|
||||
// CHECK:STDOUT: !9 = !{}
|
||||
// CHECK:STDOUT: !10 = !DILocation(line: 17, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !11 = !DILocation(line: 18, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !12 = !DILocation(line: 19, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !13 = !DILocation(line: 21, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !14 = !DILocation(line: 22, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !15 = !DILocation(line: 23, column: 3, scope: !7)
|
||||
// CHECK:STDOUT: !16 = !DILocation(line: 17, column: 20, scope: !7)
|
||||
// CHECK:STDOUT: !17 = !DILocation(line: 18, column: 19, scope: !7)
|
||||
// CHECK:STDOUT: !18 = !DILocation(line: 19, column: 26, scope: !7)
|
||||
// CHECK:STDOUT: !19 = !DILocation(line: 21, column: 18, scope: !7)
|
||||
// CHECK:STDOUT: !20 = !DILocation(line: 22, column: 17, scope: !7)
|
||||
// CHECK:STDOUT: !21 = !DILocation(line: 23, column: 24, scope: !7)
|
||||
// CHECK:STDOUT: !22 = !DILocation(line: 16, column: 1, scope: !7)
|
||||
|
||||
Reference in New Issue
Block a user